Importing an archive: a CV's link entries are dropped because the importer's section map has no \"link\ #470

Closed
opened 2026-10-01 10:46:56 +00:00 by tiagoagueda · 1 comment
Owner

Found on 2026-09-29 in a read-only review of postulo at 95348908d, comparing the importer's section map with the export's and running an export-and-import round trip.

Checked again on 2026-10-01 against main at 0a5cad587: still present.

A CV can hold Link entries: link is in OVERVIEW_ORDER (resume/registry.py:83-91), which the CV's "add entries" form offers. The export writes each CV item's content_type.model, so a link is written as link. The importer resolves CV items through its own hand-written content_types map, which lists experience, education, project, skillgroup, certification and languageskill but not link, so every link on every CV is skipped as "no such record", although the link itself was imported into resume_map["links"]. The export already keeps the full map as TRANSLATION_SECTIONS (with "link": "links"), and says the importer reads it the other way round; this second copy has drifted from it.

  • Where: core/importer.py:789-796 (content_types) and :812-819 (the lookup) in load; core/export.py:120-129 (TRANSLATION_SECTIONS) and :734-749 (the CV entries written).
  • What happens: a CV holding an experience and a link, exported and imported into a second account, came back with only the experience, and the report said CV entry link#1 on Main: no such record.
  • Why it matters: after moving or restoring an account, CVs silently lose their portfolio, GitHub and similar lines, and the next rendered CV lacks them.
  • Fix: resolve CV items through export.TRANSLATION_SECTIONS (or one shared map both modules import) and delete the importer's copy.

Done when

  • The round trip in tests/test_export.py includes a CV with a link entry and asserts it comes back on the CV with nothing in report.skipped.
Found on 2026-09-29 in a read-only review of postulo at 95348908d, comparing the importer's section map with the export's and running an export-and-import round trip. Checked again on 2026-10-01 against `main` at `0a5cad587`: still present. A CV can hold Link entries: `link` is in `OVERVIEW_ORDER` (`resume/registry.py:83-91`), which the CV's "add entries" form offers. The export writes each CV item's `content_type.model`, so a link is written as `link`. The importer resolves CV items through its own hand-written `content_types` map, which lists experience, education, project, skillgroup, certification and languageskill but not link, so every link on every CV is skipped as "no such record", although the link itself was imported into `resume_map["links"]`. The export already keeps the full map as `TRANSLATION_SECTIONS` (with `"link": "links"`), and says the importer reads it the other way round; this second copy has drifted from it. - **Where:** `core/importer.py:789-796` (`content_types`) and `:812-819` (the lookup) in `load`; `core/export.py:120-129` (`TRANSLATION_SECTIONS`) and `:734-749` (the CV entries written). - **What happens:** a CV holding an experience and a link, exported and imported into a second account, came back with only the experience, and the report said `CV entry link#1 on Main: no such record`. - **Why it matters:** after moving or restoring an account, CVs silently lose their portfolio, GitHub and similar lines, and the next rendered CV lacks them. - **Fix:** resolve CV items through `export.TRANSLATION_SECTIONS` (or one shared map both modules import) and delete the importer's copy. ## Done when - The round trip in `tests/test_export.py` includes a CV with a link entry and asserts it comes back on the CV with nothing in `report.skipped`.
tiagoagueda added this to the 0.5.0 milestone 2026-10-01 10:46:56 +00:00
Author
Owner

Two issues filed on 2026-10-03 from the maintainer's list of improvements of 2026-10-02 depend on this one: #687 (publications) and #692 (the additional career sections). #692's guard test names link in the importer's CV-entry map as its one standing exception until this lands, and #687 adds its own entry to the same map. Both first described this as untracked; they now point here.

Still present on main at 0df9c342e: the map is content_types at src/postulo/core/importer.py:952-958 and the lookup that reports “no such record” is at :1014-1018; the lines this issue cites have moved. The fix is unchanged: resolve CV items through the export's map, with the round-trip test in tests/test_export.py that this issue already asks for.

From the list of improvements of 2026-10-02.

Two issues filed on 2026-10-03 from the maintainer's list of improvements of 2026-10-02 depend on this one: #687 (publications) and #692 (the additional career sections). #692's guard test names `link` in the importer's CV-entry map as its one standing exception until this lands, and #687 adds its own entry to the same map. Both first described this as untracked; they now point here. Still present on `main` at `0df9c342e`: the map is `content_types` at `src/postulo/core/importer.py:952-958` and the lookup that reports “no such record” is at `:1014-1018`; the lines this issue cites have moved. The fix is unchanged: resolve CV items through the export's map, with the round-trip test in `tests/test_export.py` that this issue already asks for. From the list of improvements of 2026-10-02.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#470
No description provided.