audit(ci): comprehensive gh-CLI → Gitea-REST sweep across workflows (post-#66) #75
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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
Comprehensive sweep of
ghCLI invocations across.github/workflows/after the canonical SCM migration to Gitea (post-2026-05-06). PR #66 fixed the most-acute case (auto-sync main → staging) by replacinggh pr createwith direct push. This issue tracks the rest.Why
ghCLI is hardcoded against GitHub.com in two ways that both fail on Gitea:gh pr list/view/create/merge/diff,gh run list) → Gitea exposes no GraphQL endpoint, returnsHTTP 405 Method Not Allowed (https://git.moleculesai.app/api/graphql).gh api ...) →ghcalls/api/v3/...(GitHub Enterprise REST shape), Gitea exposes/api/v1/. SettingGH_HOST=git.moleculesai.appdoes NOT help — the path mismatch is inghsource.Confirmed empirically 2026-05-07:
Therefore: no
ghsubcommand currently works on this fleet. Workflows that callgheither fail noisily (the auto-sync case fixed in #66) or silently degrade (e.g.|| echo "none/none"fallbacks treat every Gitea 405 asnone/none→ wrong gate decision).Audit (excluding sister-agent work in flight)
EXCLUDED (sister agents):
auto-sync-main-to-staging.yml(PR #66, done),auto-promote-staging.yml,retarget-main-to-staging.yml.auto-promote-on-e2e.ymlgh run list --workflow=X --commit=SHAauto-promote-on-e2e.ymlgh api repos/.../compare/A...Bauto-tag-runtime.ymlgh pr list --state merged --search SHAci.ymlgh api -X POST repos/.../commits/SHA/commentscheck-merge-group-trigger.ymlgh api .../branches/X/protection/required_status_checksscripts/check-stale-promote-pr.shgh pr list/view/comment(called byauto-promote-stale-alarm.yml)scripts/ops/check_migration_collisions.pygh pr list/diff(called bycheck-migration-collisions.yml)Class plan (one PR per class)
gh pr ...calls in workflows + scripts. Replace withcurlto/api/v1/repos/.../pulls.... Affected:auto-tag-runtime.yml,scripts/check-stale-promote-pr.sh,scripts/ops/check_migration_collisions.py.gh apiREST passthroughs.auto-promote-on-e2e.ymlline 338: replace withcurl /api/v1/repos/.../compare/A...B(endpoint exists in Gitea).ci.ymlline 334: Gitea has NO commit-comments API → drop the step, write the deploy-reminder body toGITHUB_STEP_SUMMARYinstead. Operators read the run summary, not stale commit comments.check-merge-group-trigger.yml: this workflow exists exclusively to lint that workflows producing required-status-checks declaremerge_group:triggers. Gitea has no merge queue and nomerge_group:event type. Convert to no-op stub (same pattern as PR #51 / CodeQL).gh run list→ Gitea has NO workflow-runs API. Each workflow on Gitea Actions still emits a commit status. Replace withcurl /api/v1/repos/.../commits/{SHA}/statuses+ jq filter on context name. Affected:auto-promote-on-e2e.yml.Acceptance criteria
Discussion-with-Hongming items
None blocking. The class designs are local to per-workflow edits + script edits; no org-wide config change (e.g. act_runner env, branch-protection whitelist) is needed.
Status update — all 3 class PRs filed
Class A —
gh pr list / view / diff / comment→ Gitea v1 RESTauto-tag-runtime.yml,scripts/check-stale-promote-pr.sh,scripts/ops/check_migration_collisions.pyClass D —
gh apiREST passthroughs (3 different fix shapes per file)auto-promote-on-e2e.yml(compare → local git),ci.yml(commit-comment → step summary),check-merge-group-trigger.yml(no-op stub — Gitea has no merge queue)Class F —
gh run list→ Gitea commit-status queryauto-promote-on-e2e.yml(E2E gate)Empirical confirmations (2026-05-07)
GH_HOST=git.moleculesai.app gh pr list ...→ HTTP 405 (graphql)gh api repos/.../pulls→ HTTP 404 (gh CLI hits /api/v3, Gitea is /api/v1)curl /api/v1/repos/.../pulls→ HTTP 200/repos/.../actions/runs— no workflow-runs API/api/v1/repos/.../compare/A...Baccepts branch/tag refs but returnsBaseNotExistfor full commit SHAs/repos/.../commits/{sha}/commentsendpoint at all"<Workflow Name> / <Job Name> (<event>)"— usable as substitute for workflow-run state queriesNo follow-up needed before merging
No discuss-with-Hongming items surfaced. None of the fixes required org-wide config changes (e.g. act_runner env, branch-protection whitelist) — all changes are local to per-workflow edits + script edits.