fix(git): harden Gitea PR metadata lookup #517

Closed
jason.woltje wants to merge 1 commits from fix/t_a292e96f-pr-metadata-gitea into main
Owner

Summary

  • fail closed when Gitea PR API returns non-2xx instead of normalizing error JSON into null metadata
  • try explicit, Mosaic credential-loader, and git HTTPS credential tokens before anonymous fallback
  • preserve GitHub behavior and normalize Gitea number/head/base/author/url fields for downstream pr-merge.sh base detection

Verification

  • shellcheck -x -P packages/mosaic/framework/tools/git packages/mosaic/framework/tools/git/pr-metadata.sh packages/mosaic/framework/tools/git/pr-merge.sh
  • live U-Connect Gitea PR #1905 returns number/head/base/state/author/url/mergeable
  • live U-Connect Gitea PR #1908 returns number/head/base/state/author/url/mergeable
  • nonexistent PR returns exit=1 with HTTP 404 error
  • pr-merge.sh baseRefName extraction path returns main for PR #1905

Kanban: t_a292e96f

## Summary - fail closed when Gitea PR API returns non-2xx instead of normalizing error JSON into null metadata - try explicit, Mosaic credential-loader, and git HTTPS credential tokens before anonymous fallback - preserve GitHub behavior and normalize Gitea number/head/base/author/url fields for downstream pr-merge.sh base detection ## Verification - shellcheck -x -P packages/mosaic/framework/tools/git packages/mosaic/framework/tools/git/pr-metadata.sh packages/mosaic/framework/tools/git/pr-merge.sh - live U-Connect Gitea PR #1905 returns number/head/base/state/author/url/mergeable - live U-Connect Gitea PR #1908 returns number/head/base/state/author/url/mergeable - nonexistent PR returns exit=1 with HTTP 404 error - pr-merge.sh baseRefName extraction path returns main for PR #1905 Kanban: t_a292e96f
jason.woltje added 1 commit 2026-05-22 15:30:57 +00:00
fix(git): harden Gitea PR metadata lookup
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
06783958f7
Author
Owner

Closing duplicate Kanban recovery PR. Superseded by PR #518, which carries the fuller fix for Gitea metadata, git.uscllc.com token/login selection, merge dry-run preflight, regression harness, PRD/TASKS, and scratchpad updates for t_a292e96f.

Closing duplicate Kanban recovery PR. Superseded by PR #518, which carries the fuller fix for Gitea metadata, git.uscllc.com token/login selection, merge dry-run preflight, regression harness, PRD/TASKS, and scratchpad updates for t_a292e96f.
jason.woltje closed this pull request 2026-05-22 16:06:55 +00:00
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#517