Skip to content

sync pull: note hives the org's region does not have instead of failing - #481

Merged
maximelb merged 1 commit into
masterfrom
fix/sync-pull-unknown-hive
Nov 25, 2026
Merged

maximelb merged 1 commit into
masterfrom
fix/sync-pull-unknown-hive

Conversation

@maximelb

Copy link
Copy Markdown
Contributor

What

sync pull now reads skipped_hives[].reason from the Infrastructure extension's fetch response. reason: "unknown_hive" (the API does not know the hive in this org's region) prints Note: skipped hive <hive>: it is not available for this organization, so there is nothing to back up. on stderr (also with --quiet) and exits 0. Entries with reason: "unauthorized", or with no reason (older backend), keep today's warning text.

Configs.fetch_with_report / fetch_to_file already pass skipped_hives through regardless of --all-available; only the docstring said otherwise, so that is fixed. The CLI prints them for every pull (strict --all and explicit hive flags included).

investigation_policy / investigation_plan stay in --all.

Needs an Infrastructure extension that returns reason and skips unknown hives; against an older one nothing changes.

Tests

New unit tests at the request boundary: unknown_hive with --all, --all-available, --hive-fp and --quiet (note printed, exit 0, file written); mixed reasons; no-reason entry keeps the old text. pytest tests/unit/ tests/microbenchmarks/: 6544 passed.

Docs: doc/cli/infrastructure.md, the pull explain text, CHANGELOG "Unreleased".

🤖 Generated with Claude Code

@maximelb

Copy link
Copy Markdown
Contributor Author

/lc-review

@limacharlie-event-notifications limacharlie-event-notifications Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Code Review Summary

Verdict: APPROVED (0 High, 0 Medium, 0 Low)

No issues found. I read all five changed files. In sync pull, entries with reason == "unknown_hive" now print a Note: on stderr instead of a Warning:. Entries with reason: "unauthorized" or with no reason still follow the old permission/error path. fetch_with_report already returned every dict entry from skipped_hives, whatever skip_unauthorized_hives was set to, so the docstring fix matches the code. The new tests go through the CLI and mock only the transport. They cover --all, --all-available, --hive-fp, --quiet, mixed reasons and the no-reason fallback, and they check the stderr text, the exit code and the written file. I found no flaky patterns: no sleeps, no shared paths outside tmp_path, no network.

General Feedback

  • test-time-budget: no check run was found for this commit, and master does not require the check (branch protection and rulesets list no required checks).

Blast Radius

  • limacharlie sync pull stderr output changes. Scripts that grep stderr for Warning: skipped hive will no longer match unknown-region hives, because those lines now start with Note:. The exit code and stdout do not change.
  • SDK: Configs.fetch_with_report / fetch_to_file change only in their docstrings. Callers may now see a reason key in skipped_hives entries when a newer Infrastructure extension returns one. Older backends see no change.

This review was generated automatically by Claude Code.

@maximelb

Copy link
Copy Markdown
Contributor Author

Self-review (adversarial), head 53330bb: read the full diff. Checked that reason absent or unauthorized falls through to the old text, that unknown_hive with a permission still prints the Note, that the note goes to stderr under --quiet with exit 0, and that skipped_hives is read for every pull (SDK passes it through regardless of the flag). The investigation hives stay in --all. Tests mock only the transport. Findings: none.

lcbill
lcbill previously approved these changes Nov 25, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@maximelb

Copy link
Copy Markdown
Contributor Author

/lc-review

@limacharlie-event-notifications limacharlie-event-notifications Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Code Review Summary

Verdict: APPROVED (0 High, 0 Medium, 0 Low)

This is a re-review. The branch diverged from the last reviewed commit (53330bb), so I reviewed all five files again as a first round. The PR diff is the same as before and I found no issues.

  • sync pull: entries with reason == "unknown_hive" print the Note: line on stderr and skip the permission/error text. Entries with reason: "unauthorized" or no reason still print the old Warning: text. The loop runs for every pull, not only --all-available, and its output is not gated on --quiet.
  • Configs.fetch_with_report returns every dict entry of skipped_hives, whatever skip_unauthorized_hives is set to. fetch_to_file extends the caller's list with those entries, so the updated docstrings match the code.
  • The tests go through the CLI and mock only the transport. They check the stderr text, the exit code and the written file under tmp_path. They use no sleeps, no shared paths and no network.

General Feedback

  • test-time-budget: no check run was found for this commit. master does not require the check: branch protection and rulesets list no required checks.

Blast Radius

  • limacharlie sync pull stderr: lines for unknown-region hives now start with Note: skipped hive instead of Warning: skipped hive. Scripts that grep stderr for the warning will not match them. Exit codes and stdout do not change.
  • SDK: Configs.fetch_with_report and fetch_to_file change only in their docstrings. When a newer Infrastructure extension is used, callers may see a reason key in skipped_hives entries, and may see unknown-hive entries even when skip_unauthorized_hives=False.

This review was generated automatically by Claude Code.

@maximelb
maximelb merged commit e7c8761 into master Nov 25, 2026
7 checks passed
@maximelb
maximelb deleted the fix/sync-pull-unknown-hive branch November 25, 2026 20:20
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.

2 participants