fix(forge/gitea): route concepts through correct tea CLI/api commands#1138
Closed
pseudoseed wants to merge 1 commit into
Closed
fix(forge/gitea): route concepts through correct tea CLI/api commands#1138pseudoseed wants to merge 1 commit into
pseudoseed wants to merge 1 commit into
Conversation
The gitea forge preset was authored against the Gitea REST API JSON shape
but invokes the `tea` CLI, whose `--output json` emits a different,
flattened shape (and in places references a flag/field/subcommand tea does
not have). Verified against tea 0.14.2 + a live Gitea/Forgejo instance:
- user-identity: tea whoami --output json -> tea api user | jq .login
(tea whoami has no --output json flag)
- pr-exists: .head.ref -> .head (flattened to a branch-name string),
closed+merged -> state=="merged", + --limit
- pr-list: drop invalid `description` field (was erroring and
breaking the concept); body:"" (no body field on list)
- pr-view: tea pulls view (empty array) -> tea api .../pulls/:index
(full object incl. additions/deletions, head/base refs)
- issue-view: tea issues view (array, no body) -> singular tea issue
- issue-comment: tea issues comment (no subcommand) -> tea comments add
- recently-merged: .head.ref -> .head, merged filter via state=="merged",
drop invalid `description` field
- issue-search: drop "unverified" caveat (confirmed working)
The scripts are not exercised by CI (forge.test.ts uses mock scripts; per
the in-repo cluesmith#920 note tea is unavailable in the authoring env), so each
was validated manually against a live instance.
Fixes cluesmith#1137
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Would it be possible to run the bugfix protocol so that we end up with
tests for this? I really sincerely appreciate the fix, but the bugfix
protocol gives us tests and more often identifies latent issues.
…On Sun, Jul 5, 2026 at 9:04 PM Chris Dodge ***@***.***> wrote:
Fixes #1137 <#1137>.
The gitea forge preset was authored against the *Gitea REST API* JSON
shape,
but the scripts invoke the *tea CLI*, whose --output json emits a
different,
flattened shape — and in several places references a flag / field /
subcommand
that tea does not have. Per the in-repo #920 note, tea wasn't available in
the authoring environment, so the preset was never run end-to-end.
This is *not environment-specific*: the failing flags/subcommands are
defined
in the tea binary itself (independent of any server), and the canonical
Gitea
REST shape the jq assumes is confirmed against public gitea.com. Details +
repro in #1137 <#1137>.
Fixes (verified against tea 0.14.2 + a live Gitea/Forgejo instance)
Concept Before After
user-identity tea whoami --output json (no such flag) tea api user | jq
.login
pr-list --fields …,description → invalid field 'description' (concept
errored) drop field; body:""
pr-view tea pulls view → empty array tea api
repos/:owner/:repo/pulls/:index (incl. additions/deletions)
issue-view tea issues view → list array, no body singular tea issue <id>
issue-comment tea issues comment (no subcommand) tea comments add
pr-exists .head.ref + closed&&merged .head (string) + state=="merged",
--limit
recently-merged .head.ref, description, .merged .head, state=="merged",
drop field
issue-search marked "unverified" confirmed working; caveat removed
Design note: the preset stays *CLI-based* (consistent with the working
concepts
and the original design); tea api is used only where the CLI can't
produce the
contract (pr-view, user-identity). Output shapes were checked against
forge-contracts.ts.
Testing
Each concept was run against a live instance and its output validated:
user-identity → login string; pr-exists → correct true/false; pr-list
→ valid PrListItem[] (int number); pr-view → PrViewResult with real
additions/deletions; issue-view → object with body+browser url;
recently-merged → MergedPrItem[] (all merged); issue-search → array with
body. issue-comment syntax confirmed (not executed — mutating).
The gitea .sh scripts are not exercised by CI (forge.test.ts uses mock
scripts), so validation is necessarily manual against a real forge.
------------------------------
You can view, comment on, or merge this pull request online at:
#1138
Commit Summary
- e97bd79
<e97bd79>
fix(forge/gitea): route concepts through correct tea CLI/api commands
File Changes
(9 files <https://github.com/cluesmith/codev/pull/1138/files>)
- *M* CHANGELOG.md
<https://github.com/cluesmith/codev/pull/1138/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed>
(11)
- *M* packages/codev/scripts/forge/gitea/issue-comment.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-8aac32e0b2f6b50c88cdf37858afec6efb7ca0af4baefe4c129768771997176d>
(5)
- *M* packages/codev/scripts/forge/gitea/issue-search.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-f3f1ce65ba7202cbc369df2b31a00b7bb368b0ed1076bc2b65a2ce5fbb12e5b4>
(9)
- *M* packages/codev/scripts/forge/gitea/issue-view.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-078e415bec8050cebaf7820adf25261c226e7651b21c2be0db98a06e3df7dc7f>
(6)
- *M* packages/codev/scripts/forge/gitea/pr-exists.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-76de4d2416d1b8d34fe67e691f4d2a3d3484c7a1fa3fbb8215c4a208d1286aba>
(13)
- *M* packages/codev/scripts/forge/gitea/pr-list.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-ee3a8575a1e04354dc1e4d314ee5d87f9812520ce6a11caa9c2f348a8b75dade>
(29)
- *M* packages/codev/scripts/forge/gitea/pr-view.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-0e819fb5e958eb56bfb030e3ff46f61f0e1630d9a3ec693743ae08f3f3e7d799>
(25)
- *M* packages/codev/scripts/forge/gitea/recently-merged.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-4818d4e73615222bc3998a5c1fb61587d189d129c9f09ab6efc80ac09e98c3a3>
(31)
- *M* packages/codev/scripts/forge/gitea/user-identity.sh
<https://github.com/cluesmith/codev/pull/1138/files#diff-c6b368517a4c08ce2b3335cff946d52ca182d8ec7ca21b833c74ea0cc5009dfd>
(6)
Patch Links:
- https://github.com/cluesmith/codev/pull/1138.patch
- https://github.com/cluesmith/codev/pull/1138.diff
—
Reply to this email directly, view it on GitHub
<#1138?email_source=notifications&email_token=AAUXGUGJUHXX3SOMN7PBZID5DKYFFA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTSOJUGY4DANZYGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUXGUAKORLPUCC4OZWXHCL5DKYFFAVCNFSNUABGKJSXA33TNF2G64TZHMYTANRQGI2TAOJRGU5US43TOVSTWNBYGE2DENJUGA3DHILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AAUXGUHUV5X7ATSQYN7R3Y35DKYFFA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTSOJUGY4DANZYGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/AAUXGUGOYK4AYIGS2TABYOL5DKYFFA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTSOJUGY4DANZYGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Author
|
Closing in favor of re-implementing this fix through Codev's BUGFIX protocol (issue #1137 as source of truth), per the maintainer's request. A fresh The scope and approach here (routing gitea concepts through the correct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1137.
The
giteaforge preset was authored against the Gitea REST API JSON shape,but the scripts invoke the
teaCLI, whose--output jsonemits a different,flattened shape — and in several places references a flag / field / subcommand
that
teadoes not have. Per the in-repo#920note,teawasn't available inthe authoring environment, so the preset was never run end-to-end.
This is not environment-specific: the failing flags/subcommands are defined
in the
teabinary itself (independent of any server), and the canonical GiteaREST shape the jq assumes is confirmed against public
gitea.com. Details +repro in #1137.
Fixes (verified against
tea0.14.2 + a live Gitea/Forgejo instance)user-identitytea whoami --output json(no such flag)tea api user | jq .loginpr-list--fields …,description→invalid field 'description'(concept errored)body:""pr-viewtea pulls view→ empty arraytea api repos/:owner/:repo/pulls/:index(incl. additions/deletions)issue-viewtea issues view→ list array, no bodytea issue <id>issue-commenttea issues comment(no subcommand)tea comments addpr-exists.head.ref+closed&&merged.head(string) +state=="merged",--limitrecently-merged.head.ref,description,.merged.head,state=="merged", drop fieldissue-searchDesign note: the preset stays CLI-based (consistent with the working concepts
and the original design);
tea apiis used only where the CLI can't produce thecontract (
pr-view,user-identity). Output shapes were checked againstforge-contracts.ts.Testing
Each concept was run against a live instance and its output validated:
user-identity→ login string;pr-exists→ correcttrue/false;pr-list→ valid
PrListItem[](intnumber);pr-view→PrViewResultwith realadditions/deletions;
issue-view→ object with body+browser url;recently-merged→MergedPrItem[](all merged);issue-search→ array withbody.
issue-commentsyntax confirmed (not executed — mutating).The gitea
.shscripts are not exercised by CI (forge.test.tsuses mockscripts), so validation is necessarily manual against a real forge.