Skip to content

fix(sync): run pre_sync before source discovery - #72

Open
srnnkls wants to merge 1 commit into
mainfrom
fix/pre-sync-before-source-discovery
Open

fix(sync): run pre_sync before source discovery#72
srnnkls wants to merge 1 commit into
mainfrom
fix/pre-sync-before-source-discovery

Conversation

@srnnkls

@srnnkls srnnkls commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Run the existing global pre_sync hook before source capture and projection so generated local files deploy in the same sync. Failed hooks preserve existing locks and stop before recovery or deployment.

Adds missing/empty source and failed-hook regressions, plus hook-order documentation.

Validation: full cargo test passed; cargo fmt --check passed; strict Clippy passed on project Rust 1.96. Rust 1.98 Clippy flags two unchanged locations in src/digest.rs and src/source/mod.rs.

Copilot AI lite review requested due to automatic review settings September 9, 2026 00:01

Copilot AI 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.

🟢 Approval recommended

The change is narrowly scoped to hook ordering, is consistent with documented behavior, and is covered by targeted new regression tests.

Pull request overview

This PR changes sync execution order so the existing global pre_sync hook runs before source parsing/resolution and discovery, enabling hooks to generate local source directories/files that can be deployed in the same sync. It also documents the new hook ordering and adds regression tests covering both the “generated source” and “failed pre_sync aborts early” cases.

Changes:

  • Run global pre_sync immediately after config merge/validation and abort early on failure (preserving existing locks and skipping recovery/deploy/prune).
  • Add tests ensuring pre_sync can generate a local link-deployed source before capture/discovery and that a failing pre_sync aborts before missing-source resolution.
  • Update README hook documentation to describe pre_sync ordering and failure semantics.
File summaries
File Description
src/sync/mod.rs Moves pre_sync execution earlier in sync_core and returns early on hook failure before any source resolution or recovery/deploy phases.
src/sync/tests.rs Adds regression tests for pre-sync-generated local sources and for early abort behavior on failing pre_sync.
README.md Documents pre_sync order (before source resolution/selection) and clarifies what is skipped/preserved on hook failure.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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