Separate Ninja generation steps from runner reporting (#343) - #374
Separate Ninja generation steps from runner reporting (#343)#374leynos wants to merge 7 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. Summary
WalkthroughThe runner now delegates manifest loading, graph construction, and Ninja generation to reusable helpers. Stage reporting remains in the runner through an optional callback. A test verifies generation without a status reporter. ChangesGeneration and runner orchestration
Suggested labels: Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (2 errors, 2 warnings)
✅ Passed checks (16 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Your free Security trial is over. An organization admin can activate billing to continue. Comment |
Reviewer's GuideRefactors the Ninja generation pipeline into pure, composable steps in a new generation module, with runner-level reporting layered on top, and updates graph handling and tests to use the shared pipeline. Sequence diagram for generate_ninja with separated generation stepssequenceDiagram
participant Runner
participant Reporter
participant Generation
participant ManifestModule as manifest
participant BuildGraphType as BuildGraph
participant NinjaGen as ninja_gen
Runner->>Reporter: report_pipeline_stage(PipelineStage::IrGenerationValidation)
Runner->>Generation: generate_ninja
activate Generation
Generation->>BuildGraphType: build_graph(&manifest)
deactivate Generation
Runner->>Reporter: report_pipeline_stage(PipelineStage::NinjaSynthesisAndExecution)
Runner->>Generation: ninja_text(&graph)
activate Generation
Generation->>NinjaGen: generate(&graph)
deactivate Generation
Generation-->>Runner: NinjaContent
Flow diagram for manifest loading and reporting separationflowchart TD
A[load_manifest_with_stage_reporting]
B[stage_reporting_callback]
C[report_pipeline_stage]
D[generation::load_manifest]
E[manifest::from_path_with_policy]
A --> B
B --> C
A --> D
D --> E
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Your free Security trial is over. An organization admin can activate billing to continue. |
1dd9512 to
4b3d4be
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b3d4be64b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures. Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. (Treat o11y, code safety, documentation and validation coverage as in scope). ❌ Failed checks (2 errors, 2 warnings)
|
This comment was marked as resolved.
This comment was marked as resolved.
95348d2 to
33812c4
Compare
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures. Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. (Treat o11y, code safety, documentation and validation coverage as in scope). ❌ Failed checks (2 errors, 2 warnings)
|
This comment was marked as resolved.
This comment was marked as resolved.
Keep generation reusable without a status reporter while retaining runner orchestration for progress updates and bundle telemetry.
Define ownership, permitted callers, and composition rules so dry-run and background work reuse the pure generation pipeline safely.
Show how internal callers compose the pure pipeline without reporter dependencies, including the generated Ninja bundle outcome.
Separate read-only manifest queries from effectful build evaluation and protect the stage, error, and public progress-output contracts.
Exercise the public CLI with an isolated hello manifest so the generation/reporting boundary remains covered by observable output.
Keep the reporting adapter defined exactly once after the rebase. The duplicate was an automatic merge artefact and would otherwise prevent the runner from compiling.
Give every Cargo child in the packaging smoke test a per-test target directory. This prevents Cargo's package verification from racing a parallel Windows test process for the workspace `netsuke.exe` artefact. Retain the package manifest assertions and add a deterministic check of the child-process environment seam.
33812c4 to
8206ea8
Compare
Summary
Closes #343
Splits generation into composable query-style steps with reporting kept in a thin runner wrapper, as proposed.
Changes
src/runner/generation.rs(new): pure stepsload_manifest(with an optionalStageObservercallback),build_graph, andninja_text— noStatusReporteranywhere; localised error contexts preserved.src/runner/mod.rs:generate_ninjanow interleavesreport_pipeline_stagecalls between the pure steps (identical stage sequence);stage_reporting_callbackmaps manifest stages to reporter updates;load_manifest_with_stage_reportingbecomes a thin wrapper.src/runner/graph.rs: sharesgeneration::build_graphinstead of duplicating context wrapping.Testing
New
generation_steps_run_without_reporterunit test composes the pure pipeline end to end (manifest file → graph → Ninja text) with no reporter.All existing graph/build/manifest tests unchanged and green.
Validation
make check-fmt/make lint/make test— pass (37 suites)🤖 Generated with Claude Code
Summary by Sourcery
Separate reusable Ninja generation steps from runner reporting while preserving command-stage progress and generation behavior.
Enhancements:
Documentation:
Tests:
Enhancements:
Introduce a dedicated generation module with pure manifest loading, build graph construction, and Ninja text synthesis steps usable without a status reporter.
Refactor runner manifest loading to delegate to the generation pipeline while mapping manifest load stages into pipeline status updates.
Reuse the shared generation-based graph-building path in the graph handler to avoid duplicated context wrapping.
Tests:
References