Repository navigation
fix(import): report failed team repo pushes - #1543
huong8373tt-beep wants to merge 1 commit into
Conversation
No other confirmed findings in the scoped diff. No earlier findings were supplied. |
|
Added the requested real-CLI verification on the current built I created an isolated workspace/team-repo fixture, installed a bare remote Observed CLI result: The captured output does not contain The prior focused tests/typecheck/lint/build/diff checks remain recorded in the PR description. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@huong8373tt-beep Thanks for the fix and the record. #1541 (opened earlier) fixes the same issue. We review both in full, the first one ready merges, and the other closes.
With the built CLI at 44145441 against main (f7e11fe4): when another member has pushed main first, main prints ⚠ [git] autoPush failed (non-blocking), then ✔ Pushed to team knowledge repo, and exits 0 with nothing on the remote. This branch exits 1 and prints neither. After teamai pull, rerunning the import publishes the docs. With a pre-receive hook refusing main, it exits 1 and shows [remote rejected] (pre-receive hook declined) and remote: main is protected. The success path is unchanged, and DetachedTeamRepoError still reaches callers (team-ref.test.ts:268). tsc, lint and the changed test files pass, and CI is green. What blocks approval:
-
[P2 non-blocking on its own; we hold approval for an important item in scope] A failed push prints raw git output with no teamai line and no next step. #1539 asks for the cause and the next step. In the moved-
maincase the member sees:✖ To file:///…/a.git ! refs/heads/main:refs/heads/main [rejected] (fetch first) Done Pushing to file:///…/a.git error: failed to push some refs to 'file:///…/a.git' hint: … use hint: 'git pull' before pushing again.Nothing says that publishing the import failed, and the only advice is git's
git pull, for a clone the member never works in. #1538 already does what's needed for deep-enrich: a teamai line (Failed to publish … to the team repo:), then git's full message, thenRun `teamai pull`, then rerun this command.. Here the advice should come only for afetch first/ non-fast-forward rejection. A protectedmaingets no fix from a pull. Showing git's reason, as this PR does, is the half #1541 lacks.
Non-blocking:
- [P2 non-blocking] The local claude-rules import (
src/import.ts:512) still prints✔ Import completebefore the push, so a failed push shows a success line followed by the error. Moving that line afterautoPushTeamRepofixes it. We found this in the code; that path is interactive. - [P3 nit] The
@deprecated Use autoPushViaMR instead for import flows.tag is removed fromautoPushTeamRepo. Unless that's intended, keep it. - [P3 nit] Your record is in a comment. Please move it into the body.
- [P3 nit] The new
import-dir.test.tscase also passes on main, becauseimportCmdalready exits 1 whenautoPushTeamReporejects. Only thegit.test.tscase against a real remote separates main from this branch.
We read the iWiki import (it now exits 1 without iWiki import complete) but didn't run it, since it needs the service. This PR conflicts with #1541 in src/utils/git.ts, and merges cleanly with #1534, #1538 and the other open PRs.
The CI review asked for a real-CLI record. It ran before your comment, and the run you posted matches ours for the protected-main case.
@huong8373tt-beep Thanks for this fix and for the record. #1541 fixed the same issue and was ready first, so it's merged ( The |
Closes #1539
Summary
import --dirpreviously swallowed team-repo push failures and printed a false success message. The next pull/push could discard the local-only import.This change makes
autoPushTeamRepopropagate push failures. Import commands therefore exit non-zero and do not printPushed to team knowledge repounless the push succeeds.Changes
import --dircommand path.Validation
npm run typechecknpm run lintnpm run buildgit diff --check