Skip to content

fix: print server advisories on --dry-run (#1124731) - #81

Merged
ea-open-source merged 5 commits into
mainfrom
fix/1124731-dry-run-advisories
Oct 12, 2026
Merged

ea-open-source merged 5 commits into
mainfrom
fix/1124731-dry-run-advisories

Conversation

@ea-open-source

@ea-open-source ea-open-source commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

--dry-run printed no server advisory. reportDryRunPlan never read plan.warnings, although a server preview returns the committing import's warnings, except one code (agile-tracker import-mapping.md §2.4.3 and §3 "Dry-run preview"). For a GitHub import, the dry run hid history_floor_clamped, dependencies_fetch_failed and dependencies_truncated at the one moment an advisory is actionable. A preview never carries cross_reference_links_failed: only a committing GitHub import takes agile-tracker's execute_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: reportDryRunPlan renders one indented note: line per plan.warnings entry through the unchanged warningLine renderer (it scrubs control characters). A missing warnings key renders nothing (?? [], as in reportImport). The direct engine shares this renderer, so its local dry run gets the same lines. src/direct.js is unchanged (sibling story #386282 fills its warnings).
  • The old-server fallback (Dry run: would import ... No changes made.) is unchanged. It has no server result, so it has no warnings.
  • CONTRACT.md: the warnings section says that the preview reports the committing run's advisories except cross_reference_links_failed, and where --dry-run renders 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

Dry run plan for o/r into project 91 (Demo):
  would import 4 stories (0 labels), would skip 0, 0 error(s).
  note: history_floor_clamped (3 stories, floor year 2024)
No changes made.

The notes come after the would lines (and after any would 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):

  • Server dry run with two warnings: exact plan block with both note: lines, and No changes made. as the last stdout line.
  • Server dry run: a control-bearing warning code is scrubbed.
  • Server dry run without warnings: the block renders and stdout has no note:.
  • Direct dry run (through the runDirect seam) with a placeholder owner and two warnings: notes after the placeholder line, before the close, and close is the last line.
  • Direct dry run: an ESC and a U+202E in a warning code are scrubbed.
  • Direct dry run with warnings: [] and with no warnings key: no note:.
  • Parity: one edge-bearing warnings list (count: 0, a floor_year without count, a bare string, a normal entry) gives equal note: lines on a committing run and on --dry-run.
  • The direct engine's real dry-run and committing outcomes pin warnings to [].
  • The old-server fallback prints no note:.

Red first: with the render line deleted, node --test tests/cli.test.js tests/import.test.js gives ℹ fail 4 (the four positive tests). The negative controls stay green. A second mutation renders the notes after No 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-empty warnings in either direct-engine return fails its pin; a note: 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

ea-open-source and others added 5 commits October 12, 2026 11:56
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>
@ea-open-source
ea-open-source merged commit 6f0ee58 into main Oct 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant