-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: forge-agnostic workflow commands (Gitea/GitLab support) #1101
Copy link
Copy link
Open
Labels
P3Low priority - Nice to have, consider closing if staleLow priority - Nice to have, consider closing if stalearchitectureArchitectural changes and designArchitectural changes and designarea: workflowsWorkflow engineWorkflow engineeffort/highCross-cutting changes, multiple domains, requires design decisionsCross-cutting changes, multiple domains, requires design decisionsfeature-requestNew functionality (external suggestion, needs review)New functionality (external suggestion, needs review)
Metadata
Metadata
Assignees
Labels
P3Low priority - Nice to have, consider closing if staleLow priority - Nice to have, consider closing if stalearchitectureArchitectural changes and designArchitectural changes and designarea: workflowsWorkflow engineWorkflow engineeffort/highCross-cutting changes, multiple domains, requires design decisionsCross-cutting changes, multiple domains, requires design decisionsfeature-requestNew functionality (external suggestion, needs review)New functionality (external suggestion, needs review)
Summary
Archon's Gitea and GitLab webhook adapters are implemented, but all default command files (
.md) and workflow files (.yaml) hardcodeghCLI calls. Running workflows against a Gitea or GitLab repository fails becausegh pr create,gh issue view, etc. only work with GitHub.Proposed Solution
Three layers of change:
1. Forge Detection (
@archon/git)detectForge(repoPath)utility that parsesgit remote get-url originto determine forge type (github|gitea|gitlab|unknown)GITEA_URLandGITLAB_URLenv vars for self-hosted instanceshttps://git.example.com/api/v1)2. Variable Injection + Env Passthrough
$FORGE_TYPE,$FORGE_API_BASE,$FORGE_CLISUBPROCESS_ENV_ALLOWLISTso AI subprocesses can read themGITLAB_TOKENandGITLAB_URLadded to the allowlist alongside existingGITEA_TOKEN/GITEA_URL3.
forge-cli.tsHelper Scriptbun, zero additional dependencies)bun forge-cli.ts pr create,bun forge-cli.ts issue view, etc.ghCLI for GitHub, nativefetch()API calls for Gitea/GitLabFiles Changed
packages/git/src/forge.ts(detection),.archon/scripts/forge-cli.ts(CLI wrapper)executor.ts,executor-shared.ts,dag-executor.ts(variable injection + plumbing)env-allowlist.ts(GITLAB_TOKEN, GITLAB_URL, FORGE_TYPE, FORGE_API_BASE)gh→bun "$FORGE_CLI")Testing
bun run validatepasses (type-check + lint + format + all tests)repo info— returns nameWithOwner, defaultBranchissue create— created test issue Model stucked at response stream text #1issue comment— posted automated commentissue view— fetched issue detailspr create— created PR updated code to use locally hosted llama LLM, nomic-embed-text model. #2 from test branchpr comment— posted PR commentpr diff— retrieved unified diffpr list— listed open PRsBackwards Compatibility
github)