Replace tea and gh with forgejo-api and octokit in os-sdlc #858
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#858
Loading…
Reference in a new issue
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?
Problem
os-sdlc runs
teaandghto read tickets and to mark them blocked. It also runstea logins listand searches the text for a host name to decide if a remote is Forgejo. ADR-0256 replaces tea with theforgejo-apigem (ADR-0257) and gh with octokit.Reproduce
n/a: design change from ADR-0256.
Approach
IssueSource::Forgejo#fetchcallsrepo.issues.get(n)andIssueSource::Github#fetchcallsOctokit::Client#issue. Both still return"title\n\nbody".Tracker::TeabecomesTracker::Forgejo:add_waiting_labelresolves thewaitinglabel ID throughrepo.labels.listand callsrepo.issues.labels(n).add(labels: [id]),blocker_commentcallsrepo.comments.create(n, body: message), andfetch_bodycallsrepo.issues.get(n)in place of the os-backlog CLI. Label operations take numeric IDs, so resolve the ID from the name; do not pass label names.TrackerResolver#forgejo_host?compares the remote host with the Forgejo host constant, the same rule os-backlog uses (forgejo.swansoncloud.com), in place oftea logins list. Tokens come fromENV.fetch("FORGEJO_TOKEN")andENV.fetch("GITHUB_TOKEN").The gem is
forgejo-api(ADR-0257), the only Forgejo client. Build it with::Forgejo::Client.new(url: "https://forgejo.swansoncloud.com", api_key: ENV.fetch("FORGEJO_TOKEN")), thenrepo = client.repo(owner, name)(no HTTP call). The gem module is top-levelForgejo, so code insideOsSdlc::IssueSource::ForgejoandOsSdlc::Tracker::Forgejomust write::Forgejo::Clientand::Forgejo::NotFoundError; a bareForgejowould find the nested class. Errors come from::Forgejo::Error(NotFoundErrorfor 404,AuthenticationErrorfor 401).Test seam: each owner receives the client (or a repo object) by injection, so tests pass a fake and never use the network. The default builds the real client from ENV.
Required work:
gem "forgejo-api", git: "ssh://git@forgejo.swansoncloud.com:2222/jared/forgejo-api.git", require: "forgejo"andoctokittoplugins/os-sdlc/Gemfile, and updateplugins/os-sdlc/Gemfile.lock(ADR-0166). Each machine then needsbundle install.Rejected: call the os-backlog CLI for all tracker reads — it keeps a shell call and couples os-sdlc to os-backlog output (ADR-0256).
Acceptance criteria
forgejo:tracker, whenimplementation-openreads a ticket, then it gets the title and body from the Forgejo API and noteaprocess starts.github:tracker, whenimplementation-openreads a ticket, then it gets the title and body from the GitHub API and noghprocess starts.waitinglabel (added by its numeric ID, resolved from the name) and a blocker comment through the Forgejo API.forgejo.swansoncloud.comand no tracker key, when the tracker resolves, then it resolves toforgejo:<owner>/<repo>withouttea logins list.bundle installruns inplugins/os-sdlc, thenGemfile.locklistsforgejo-apiandoctokit, andbundle exec ruby -e 'require "forgejo"'succeeds.Owner sketch
Non-goals
Blocked by
forgejo-apigem, ADR-0257).Origin
tea logins listtext ← DESIGN: ADR-0123, amended by ADR-0256.Update 2026-09-30: #855 is resolved by the generated
forgejo-apigem (ADR-0257, commitb68750db) in place offorgejo-client, so this ticket is no longer blocked. Source for plugins/os-sdlc/Gemfile:gem "forgejo-api", git: "ssh://git@forgejo.swansoncloud.com:2222/jared/forgejo-api.git", require: "forgejo". Client:Forgejo::Client.new(url: "https://forgejo.swansoncloud.com", api_key: ENV.fetch("FORGEJO_TOKEN"));repo.issues.get(n)returns an Issue with.title/.body/.labels;repo.comments.create(n, body:);repo.issues.labels(n).add(labels: [id])with the id resolved fromrepo.labels.list.Replace tea and gh with forgejo-client and octokit in os-sdlcto Replace tea and gh with forgejo-api and octokit in os-sdlcWork started 2026-09-30 on branch ticket-858 (worktree .claude/worktrees/ticket-858), os-sdlc pipeline, target os-sdlc.
Pipeline note 2026-09-30: programmer dispatch 135 deadlocked ~14 min. It backgrounded its gate behind a stray
cat > /dev/null(stdin never closed) and polled with a self-matchingpgrep -f "os-sdlc-gate 135". Main loop killed the cat; the gate then ran. Skeptic verdict DROP for a follow-up ticket (one-off agent slip); re-file if it recurs.Resolution
Done: os-sdlc fetches tickets (IssueSource::Forgejo/Github) and labels blockers (Tracker::Forgejo) through forgejo-api and octokit in process; Tracker::Tea, TicketFetcher and tea-logins host detection deleted; Tracker::Backlog keeps the os-backlog body fetch for other trackers; Gemfile adds forgejo-api (git, ADR-0257), octokit, faraday-retry.
Evidence: main
67d32857+80c842c6(History row) +30a0094c(unused runner args and shell fakes removed). Suite 1337 runs, 4 failures, all pre-existing on main (#862). rubocop 0 offenses on changed files. Live read-only check against forgejo.swansoncloud.com: fetch(858) returned the ticket text, Tracker.for resolved Tracker::Forgejo, fetch_body(858) 5486 chars, fetch(999999) raised HarnessError HTTP 404. Implementation 17 escalated at programmer-repair (stale tea tests, masked by a Marshal crash in forked workers) and was hand-finished; test helper now preloads forgejo and octokit.Follow-ups: #862 pre-existing GateEvaluatorProjectShellTest bundler failures (skeptic CREATE). Programmer gate deadlock: skeptic DROP, noted on this ticket. Leftover cleanup: skeptic DROP, done in
30a0094c. Each machine needs bundle install in plugins/os-sdlc (ADR-0257); none otherwise.