Repository navigation
fix(push): restore --file/--path, removed in 0.30.0 on a mistaken premise - #1855
Conversation
…mise 0.30.0's Tencent#1700 removed 'teamai push --file <local file> --path <team path>' as 'never released'. It was released in 0.29.0 (documented for Tencent#1402), and the removal shipped without a migration path or a changelog entry, so members and scripts that proposed one benchmark task or scorer file byte for byte lost the path (Tencent#1852, and Tencent#1851's case C confirms it independently). This restores src/push-file.ts and its e2e as they were at v0.29.0, with two adjustments to the test file only: proposed() scopes to refs/heads/teamai/push/ (self mode's init leaves its own bookkeeping branch on origin today, which is not this command's proposal), plus an optional named branch for the --branch cases. The CLI wiring in index.ts regains the two options and the isFilePush routing. teamai-session-to-task no longer calls this (its propose step delivers through the workflow engine since Tencent#1700), so the restoration serves direct CLI and script use. Closes Tencent#1852 Co-Authored-By: Claude Code <[email protected]>
Testing: The description records 20/20 real-CLI E2E cases, satisfying the review rule’s verification-record requirement. I only read the specified diff; I did not run, build, or install PR code. |
The history checks out. If the option comes back, one finding first:
CI review. One P1, which I agree with (above). Its P2 is real but repo-wide, so I graded it P3. Merge risk. Low for existing behaviour: the restored path runs only under @jeff-r2026 your call on this one. It reverses a removal #1700 made on purpose, so the choice is between restoring |
…ch's bytes teamai push --file --path compared the local bytes with the default branch and returned 'No changes to push' before it looked at --branch and that branch's open pull request. A member who pushed changed bytes, put the file back and ran the same command again got 'nothing to push' while their request still proposed the old bytes. The comparison now asks first whether the target branch has an open request: when it does, the push names it and says to close it or push the bytes wanted there. The host owns closing a request, and rebuilding the branch would leave a request proposing nothing — a member would read that as withdrawn while it stayed open. 0.29.0 behaved the same way, so this fixes the restored path rather than a regression of it. Co-Authored-By: Claude Code <[email protected]>
|
P1 — addressed in Reproduced first: the test fails on I took the second of your two options, refuse and name the PR, over rebuilding the branch:
So the push now says: P3 — not in this PR, as you said. The fixture spreading The restore itself is unchanged in this commit — the P1 fix and the restoration are separate commits, so the product decision ( |
Resolved: The earlier stale-PR finding is addressed: restoring the default branch’s bytes now reports the open request and exits nonzero instead of silently reporting success. Testing: The description records 20/20 real-CLI E2E cases, satisfying the verification-record requirement. I only read the specified diff; I did not run, build, or install PR code. |
Re-checked at 9c0fd7f. The P1 is fixed. When the local file holds the default branch's bytes and the requested branch has an open pull request, the push now names that request and exits non-zero. It no longer reports nothing to push. Refusing is a better choice than rebuilding the branch, for the reason you gave: an empty-tree commit reported as
CI review. It marks the P1 resolved; we agree. It still lists the E2E environment item as P2. As discussed, that belongs in the shared The product decision is unchanged and still with @jeff-r2026. |
|
@jeff-r2026 — the technical side of this is settled: CI is green at Restore, or document the removal. Two costs, both small:
Either answer is fine by me — I only pushed the restore so the decision would have something concrete to weigh against, and the evidence for the wrong premise ("never released") is in #1852 either way. If restoring: two commits, |
# Conflicts: # CHANGELOG.md
Resolved: The earlier stale-PR finding is addressed: restoring the default branch’s bytes now reports the open request and exits nonzero rather than silently reporting success. Testing: The description records 20/20 real-CLI E2E cases, satisfying the verification-record requirement. I only read the specified diff; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving ad90457. We're taking the restore: it brings back a documented 0.29.0 option a team relies on, it only runs under --file, and it changes nothing for members who don't use it. The P1 was fixed in 9c0fd7f.
I checked this merge of main on its own. A local merge of the same two commits gives an identical tree. The only conflict was CHANGELOG.md, and both sides' entries are kept. check-docs --write changes nothing, so commands.md is current. Typecheck and lint pass on the merged tree, along with push-file-path-1402 (21 passed) and the push*.test.ts unit files (241 passed). In a verify world, teamai push --file … --path docs/… pushes the branch, and the pushed file is byte-identical to the local one. That world uses the git provider, so the PR-creation step wasn't reached there; the E2E covers it with a fake gh.
The two P3s (the host lookup without --branch, and the two CHANGELOG entries) don't hold the merge.
Merge risk. Low for existing behaviour. The cost is keeping a second way to propose one team file.
Summary
0.30.0 removed
teamai push --file <local file> --path <team path>— the byte-for-byte, single-file proposal path documented for #1402 in 0.29.0. The removal (#1700) shipped on the breaking note "never released"; it was released, and 0.30.0 dropped it with no migration path and no changelog entry. Two member reports hit it (#1852, and #1851's case C). This restores the feature as it stood at v0.29.0, against today's tree.Type of Change
What changed
src/push-file.ts— restored verbatim from v0.29.0 (335 lines): refuses an unsafe--pathbefore touching any repo, builds the proposal commit with git plumbing in a temporary index (the clone's files, index and HEAD stay untouched), pushes a new or--branch-named branch with a lease, and opens or updates the pull request through push's PR code.src/index.ts— thepushcommand regains--file/--pathand theisFilePushrouting next to the existing options; no other command touched.src/__tests__/e2e/push-file-path-1402.test.ts— restored from v0.29.0 with one fixture adjustment:proposed()now scopes torefs/heads/teamai/push/(self mode's init leaves its own bookkeeping branch on origin today, which is not this command's proposal), plus an optional named branch for the two--branchcases. The 20 cases are otherwise the 0.29.0 set: byte-for-byte content, exact placement, refusals (symlink on the path,--branch main, destination not under a resource directory), lease-rebuild semantics, and the checkout untouched in both dedicated-repo and self mode.skill-data/core/references/commands.md— regenerated bycheck-docs --writefor the two new option help texts.CHANGELOG.md— bug-fix entry under Unreleased saying the option is back and why it went away.teamai-session-to-taskdoes not call this (its propose step delivers through the workflow engine since #1700), so the restoration serves direct CLI and script use — the shape the two reports ask for.Test Plan
npx tsc --noEmitpassesnpm run lintpasses (oxlint type-aware + docs checks)npm run test:e2e -- push-file-path-1402— 20/20 against the built CLI (pretest:e2ebuildsdist/first; the file spawns the real binary against real local git repos with a fakegh)mainthis test file fails for the reported reason:push-file.tsdoes not exist, soteamai push --fileanswersunknown option '--file'— the first run's failure mode on main is the bug itself.npx vitest runnot re-run here for this diff: the touched paths are covered by the e2e file above; the two other open PRs' CI runs cover the shared matrix. Say the word and I will run it.Related Issues
Closes #1852. References #1851 (case C independently confirms the removal), #1402 (the feature's origin), #1700 (the removing change).
Notes for Reviewers
proposed()scoping, with the reason in its comment.httpprovider workspaces cannot push at all (read-only consumer), unchanged; Windows CI's subset covers the git-plumbing paths.Disclosure
Implemented with AI assistance (Claude Code); every line reviewed and tested by the author.