Repository navigation
fix: print server advisories on --dry-run (#1124731) - #81
Merged
Merged
Conversation
reportDryRunPlan never read plan.warnings, so --dry-run printed no server advisory although the preview carries the same warnings as the committing import. Each entry now renders as an indented `note:` line through the shared warningLine renderer, inside the plan block and before the closing "No changes made.". Tests cover the server dry run and the direct engine's local dry run (through the runDirect seam), control-character scrubbing on both, the line order, and negative controls with an empty list and a missing key. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A dry_run preview reports the same set of warnings as the committing import, and --dry-run renders them inside the plan block before "No changes made.". The direct engine's local dry run uses the same block, and the old-server fallback prints no note. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ngs (PR #81 review) - A parity test sends one edge-bearing warnings list through a committing run and a --dry-run, and asserts equal note: lines. A hand-rolled formatter in the dry-run block turns it red. - The direct engine's dry-run and committing outcomes pin warnings to [], the claim CONTRACT makes; #386282 changes the pin and that sentence together. - The old-server fallback test asserts no note: line. - The dry-run fixtures use dependencies_truncated in place of cross_reference_links_failed, a code that a preview never carries. - The server control-character test asserts exit 0, no ESC and no CR. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A preview reports the committing import's advisories except cross_reference_links_failed: only a committing GitHub import takes execute_github_streamed_import, which holds the PR-issue link attach that emits it. The "cannot read as a report of a write" clause now covers only a preview the server confirmed with dry_run: true. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
--dry-runprinted no server advisory.reportDryRunPlannever readplan.warnings, although a server preview returns the committing import'swarnings, except one code (agile-trackerimport-mapping.md§2.4.3 and §3 "Dry-run preview"). For a GitHub import, the dry run hidhistory_floor_clamped,dependencies_fetch_failedanddependencies_truncatedat the one moment an advisory is actionable. A preview never carriescross_reference_links_failed: only a committing GitHub import takes agile-tracker'sexecute_github_streamed_import, which holds the PR↔issue link attach that emits it.Story: https://eastagiletracker.com/s/ane8pe4m (#1124731)
What changed
src/cli.js:reportDryRunPlanrenders one indentednote:line perplan.warningsentry through the unchangedwarningLinerenderer (it scrubs control characters). A missingwarningskey renders nothing (?? [], as inreportImport). The direct engine shares this renderer, so its local dry run gets the same lines.src/direct.jsis unchanged (sibling story #386282 fills its warnings).Dry run: would import ... No changes made.) is unchanged. It has no server result, so it has no warnings.CONTRACT.md: thewarningssection says that the preview reports the committing run's advisories exceptcross_reference_links_failed, and where--dry-runrenders them. The "cannot read as a report of a write" clause covers only a preview that the server confirmed (dry_run: true). The warning-code list is out of scope (#1124732).Output format
The notes come after the
wouldlines (and after anywould create ... placeholder owner(s)line).No changes made.stays the last line. For a preview that the server confirmed (dry_run: true), no write took place, so an advisory cannot read as a report of a write.Test plan
New tests (node --test):
note:lines, andNo changes made.as the last stdout line.note:.runDirectseam) with a placeholder owner and two warnings: notes after the placeholder line, before the close, and close is the last line.warnings: []and with nowarningskey: nonote:.count: 0, afloor_yearwithoutcount, a bare string, a normal entry) gives equalnote:lines on a committing run and on--dry-run.warningsto[].note:.Red first: with the render line deleted,
node --test tests/cli.test.js tests/import.test.jsgivesℹ fail 4(the four positive tests). The negative controls stay green. A second mutation renders the notes afterNo changes made., and both ordering tests fail (ℹ fail 2). Review-round mutations: a hand-rolled formatter in the dry-run block fails the parity test; a non-emptywarningsin either direct-engine return fails its pin; anote:in the fallback fails the fallback test.Gates on the branch:
npm test: rc 0,ℹ tests 1287,ℹ pass 1286,ℹ fail 0,ℹ skipped 1(the pre-existing opt-in e2e)npm run lint: rc 0,Found 1 warning. Found 1 info.(both pre-existing on main)npm run typecheck: rc 0🤖 Generated with Claude Code