3.9 KiB
3.9 KiB
t_a292e96f — Gitea PR metadata and merge wrapper fix
Objective
Fix Mosaic git wrappers so Gitea repositories on git.uscllc.com resolve PR metadata and merge preflight through the correct host credentials, without selecting the stale mosaicstack Tea login.
Acceptance criteria
pr-metadata.shreturnsbaseRefName=mainfor U-Connect PR #1905 and PR #1908.pr-metadata.shreturns source-branch-styleheadRefName; for Gitearefs/pull/<n>/headresponses, normalize tohead.label.pr-merge.shpreserves Mosaic squash-only and base-branch policy, then uses host-matched Gitea API credentials for Gitea merges instead of a hard-coded Tea login.- Add regression coverage/harness for Gitea metadata normalization and merge preflight.
- Do not print, log, or commit tokens.
Plan
- Reproduce current live metadata/login context with sanitized output.
- Patch repo-source shell wrappers under
packages/mosaic/framework/tools/git/. - Add a hermetic shell regression harness with fake
git,curl, andtea. - Validate with
bash -n, shellcheck if available, regression harness, and live sanitized U-Connect wrapper calls. - Apply the same script changes to the installed Mosaic wrapper location only after source changes validate, so active U-Connect merge wrappers are unblocked while the PR is reviewed.
- Commit, push through queue guard, open PR, and hand off to Ultron review task
t_848435ab; do not merge.
Progress
- Live sanitized metadata check before source patch:
- PR #1905:
baseRefName=main,headRefName=edith/t_39ce717c-authentik-smoke-gate. - PR #1908:
baseRefName=main,headRefName=refs/pull/1908/head; raw Giteahead.labelisfix/t_23fa9e1d-portal-health-backend. tea login listcontains onlygit.mosaicstack.dev, so the prior--login mosaicstackdefault cannot work forgit.uscllc.com.
- PR #1905:
Verification log
bash -n packages/mosaic/framework/tools/git/detect-platform.sh packages/mosaic/framework/tools/git/pr-metadata.sh packages/mosaic/framework/tools/git/pr-merge.sh packages/mosaic/framework/tools/git/tests/pr-gitea-wrapper-regression.sh— pass.shellcheck packages/mosaic/framework/tools/git/detect-platform.sh packages/mosaic/framework/tools/git/pr-metadata.sh packages/mosaic/framework/tools/git/pr-merge.sh packages/mosaic/framework/tools/git/tests/pr-gitea-wrapper-regression.sh— pass when available in the Kanban runtime.TMPDIR="$PWD/.agent-tmp" bash packages/mosaic/framework/tools/git/tests/pr-gitea-wrapper-regression.sh— pass; proves host-matched Gitea credential selection, metadata normalization, and merge dry-run preflight without invokingtea.- Live sanitized U-Connect metadata using the patched wrapper from
/src/uconnect:- PR #1905:
number=1905,baseRefName=main,headRefName=edith/t_39ce717c-authentik-smoke-gate,state=open. - PR #1908:
number=1908,baseRefName=main,headRefName=fix/t_23fa9e1d-portal-health-backend,state=closed.
- PR #1905:
- Live sanitized U-Connect merge preflight using
pr-merge.sh --skip-queue-guard --dry-run:- PR #1905:
Dry run: Gitea merge preflight OK for USC/uconnect#1905 targeting main via git.uscllc.com API. - PR #1908:
Dry run: Gitea merge preflight OK for USC/uconnect#1908 targeting main via git.uscllc.com API.
- PR #1905:
- Installed wrapper parity:
/home/hermes/.config/mosaic/tools/git/{detect-platform.sh,pr-metadata.sh,pr-merge.sh}byte-match the PR source copies after validation, so active U-Connect wrapper invocations use the same fix while source PR review runs.
Risks / notes
--dry-runwas added topr-merge.shto validate metadata/auth/preflight without merging a live PR.- Gitea branch deletion after merge remains a documented warning, matching prior behavior, and is not expanded in this fix.
- Duplicate recovery PR #517 was closed after wrapper-first
pr-close.sh -n 517failed headlessly with/dev/tty; PR #518 is the review target.