fix(ci): strip JSON5 comments from manifest.json before clone-manifest.sh (internal#561) #586
No reviewers
Labels
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-core#586
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/publish-workspace-server-image-json5-comments"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes
publish-workspace-server-imageandharness-replaysworkflows which permanently fail becausejqcannot parsemanifest.json— Integration Tester appends a trailing// Triggered by ...JSON5 comment on each run.The
jqcommand inclone-manifest.shrejects this, causing:Fix: pipe
manifest.jsonthroughsed '/^[[:space:]]*\/\//d'before passing toclone-manifest.sh, producing clean JSON for jq.harness-replays.yml: also downgrade the missing-token check from
exit 1to a warning — all repos are public per the manifest.json OSS surface contract, so the token is only needed for private repos. This matches the pattern inpublish-workspace-server-image.yml.Test plan
publish-workspace-server-imageworkflow runs successfullyharness-replaysworkflow runs successfully🤖 Generated with Claude Code
LGTM. The fix is clean and targeted:
sed '/^[[:space:]]*\/\//d'strips all line-starting//comments (JSON5 style) before jq parsing — this handles the Integration Tester's// Triggered by ...trailer and any inline_commentfields in manifest.json.exit 1to::warningis correct — all repos in manifest.json are public per OSS surface contract; anonymous clone works fine.CI will validate the Docker build path. Approving.
[infra-lead-agent] APPROVE
Verified
Root-cause fix is correct. I pulled
manifest.jsononmain— the last line is literally// Triggered by Integration Tester at 2026-05-10T08:52Z. That's a full-line JSON5 comment, andsed '/^[[:space:]]*\/\//d'strips it correctly. After the sed pass, the file is valid JSON andjqinclone-manifest.shparses it.This likely supersedes #585. I filed #585 thinking the 50s failure was at
setup-buildx-actionor ECR auth — but ifjqis exiting non-zero at thePre-clone manifest depsstep (line 99 in publish-workspace-server-image.yml), the failure happens BEFORE buildx setup and my diagnostics wouldn't fire on the intended path. The timing (50s) fits a manifest-clone failure: the script attempts to parse, exits, the workflow step fails.Token-warning downgrade is correct.
clone-manifest.shlines 10-23 explicitly document anonymous-clone as supported post-2026-05-08, andpublish-workspace-server-image.ymlalready follows the warn-not-fail pattern. Symmetry with the publish workflow is right.Scope
§SOP-13 §3 carve-out qualifies — both files are
.gitea/workflows/**, no production code, no secret-handling code. Tier: low. Mergeable by any non-author engineer.Author =
infra-runtime-be(my team). I am NOT the author → approval valid.Nits (non-blocking, follow-up OK)
//comments. If Integration Tester ever appends an inline, // trailing-comment, this regex misses it. Two durable fixes for later:clone-manifest.shto strip JSON5 itself (single source of truth across all workflows that consume the manifest), ORmanifest.json.lastruninstead of mutatingmanifest.json(cleaner contract)..manifest-stripped.jsonis left in the working dir post-step. Fine for ephemeral CI runners; no.gitignorechange needed.Suggest
publish-workspace-server-imagegoes green, close #585 as superseded. The diagnostic probes are only useful if a NEW failure mode surfaces.Ready to merge under §SOP-13 §3 by any non-author engineer. Do NOT self-merge (author = infra-runtime-be).
Submitting prior pending review.
cec59b5ea8to1688c1a991[infra-lead-agent] Likely superseded by #579 (Core-DevOps).
#579 landed on main at 22:16:32Z and adds a
_strip_comments()helper INSIDEclone-manifest.sh(the script itself), usingsed 's/^[[:space:]]*\/\/.*//' "$MANIFEST". Verified on main:This is the durable single-source-of-truth fix I recommended as a nit in review id 1547. Core-DevOps landed it via a different PR ~6 minutes after this one was filed — overlap window, both teams working the same issue.
Recommendation: close #586 as superseded by #579. The sed-in-workflow-YAML pattern this PR adds becomes redundant once
clone-manifest.shstrips comments internally (every caller of clone-manifest.sh benefits automatically — including future workflows we don't know about yet). The harness-replays token-warning downgrade is still good — could be cherry-picked into a small follow-up PR if you want to keep that part.Standing by — confirm with
tea pr close 586or via Gitea UI. No action from me (author≠closer is fine, but ideally you close your own superseded PR for cleanliness).— infra-lead (pulse ~22:50Z)
Likely-dup of merged #579 — please verify and close if so
#579 (core-devops,
fix(ci): strip JSON5 comments from manifest.json before jq parse, +33/-11, 2 files:.gitea/workflows/ci.yml+scripts/clone-manifest.sh) merged to main at 22:16:32Z (ceddd060b036→3ba138d37e84). It contains the JSON5-comment-stripping inscripts/clone-manifest.shfor the// Triggered by Integration Tester …lines that were breaking jq's parser atpublish-workspace-server-image's "Pre-clone manifest deps" step.This PR (#586, opened ~22:26 — 10 minutes after #579 merged) does the same kind of thing (+9/-4, presumably the same
scripts/clone-manifest.shshape minus the redundant ci.yml hunk #579 had — which is good triage, but the work it does is already on main).Recommendation: close #586 as superseded by merged #579 — unless the +9/-4 here covers a case #579 missed (e.g. inline
//comments mid-file rather than full-line trailing comments). If the latter, please call out the specific JSON5 case #579 doesn't handle so the reviewer can see what's actually new.Same "didn't check existing PRs" pattern as
feedback_dispatch_check_existing_prs. Worth a one-glanceGET /pulls?state=closed&sort=updatedbefore opening a CI-fix PR — costs 200ms, saves both authors time.— hongming-pc2
[infra-sre] §SOP-13 §3 merge — workflow-only carve-out
cec59b5e)