Skip to content

fix: sync architecture record assets after raster-SVG to PNG conversion (scripts/import-architectures.mjs) - #336

Merged
mrbobbytables merged 1 commit into
mainfrom
ci/fix-import-svg-png-assets
Sep 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
ci/fix-import-svg-png-assets

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

CI Fix

Fixes the daily Import reference architectures failure (red since 2026-09-15, latest run 35416042974): validate:architectures failed with missing asset ... .svg for swisscom-cloud-native-telco and zeiss.

Root cause: importArchitecture() pushed copied image paths into record.assets before sanitizeArchitectureAssets() converted raster-embedded SVGs to PNG and deleted the originals. The record (and the imported markdown) kept stale .svg references to files that no longer existed, so validation failed every run before the workflow could open its update PR.

Fix (scripts/import-architectures.mjs only):

  • Rebuild record.assets from the on-disk contents of static/img/architectures/<id>/ after sanitization.
  • Detect svg→png conversions and rewrite /img/architectures/<id>/<name>.svg references to .png in the cleaned markdown body.

Verification: ran npm run import:architectures end-to-end against live upstream with an rsvg-convert renderer — import exits 0, both records list the .png assets, both docs reference the .png paths, and npm run validate:architectures passes (Validated 8 architecture records). Worktree dirt from the verification run was reset; the diff is the script only.

Note: PR #195 also touches this file (SVG active-content wiring in mirrorProjectAssets/sanitizeArchitectureAssets); this change is in importArchitecture() only and does not overlap its hunks. No test file added — offline coverage of this script is PR #216's ground.

Closes #331


Filed by ci-maintainer agent (ACMM L4/L5 — hold-gated mode). Hold-gated: human review required. Note: src/scripts/issue-coauthor.sh does not exist in this repository, so issue-author co-attribution could not be applied.

— hive: agent=ci-maintainer backend=copilot model=kimi-k3

…rsion

importArchitecture() built record.assets from the copy-time file list and
never revisited it after sanitizeArchitectureAssets() converted
raster-embedded SVGs to PNG and deleted the originals. The catalog record
kept the stale .svg path, validate-architectures.mjs failed on the missing
asset, and the daily Import reference architectures workflow exited red
before opening its update PR (failing since 2026-09-15).

Rebuild record.assets from the on-disk directory after sanitization and
rewrite .svg image references in the imported markdown to the converted
.png path.

Closes #331

Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "ci-maintainer" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "ci-maintainer". If this is an outreach PR, a human must review it and remove the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci-maintainer] Import reference architectures fails daily: record.assets keeps stale .svg entries after raster-SVG→PNG conversion

1 participant