Add target descriptions and netsuke help targets (#551) - #555
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:
Summary
References
WalkthroughThe change adds ChangesHelp catalogue and target metadata
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant HelpQuery
participant Manifest
participant Renderer
User->>CLI: run help targets
CLI->>HelpQuery: load selected manifest
HelpQuery->>Manifest: parse with restricted helpers
Manifest-->>HelpQuery: validated actions and targets
HelpQuery->>Renderer: provide catalogue
Renderer-->>User: write text or JSON output
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (17 passed)
📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideAdds an optional description field to manifest targets/actions and introduces a localized Sequence diagram for
|
| Change | Details | Files |
|---|---|---|
| Introduce optional discovery descriptions on targets and actions, including render/expand behaviour and AST validation. |
|
src/ast.rssrc/manifest/render.rssrc/manifest/expand_tests.rssrc/manifest/expand_test_cases/description_cases.rstests/ast_tests.rstests/ast_tests/descriptions.rstests/ast_tests/actions.rs |
Add netsuke help subcommand with topic-based dispatch, including help targets catalogue rendering and JSON output. |
|
src/cli/help.rssrc/cli/mod.rssrc/cli/parser.rssrc/runner/mod.rssrc/runner/dispatch.rssrc/runner/help.rssrc/localization/keys.rssrc/output_prefs.rs |
| Extend localization for the new help subcommand and catalogue headings across all locales and status reporting. |
|
src/localization/keys.rssrc/cli_l10n.rslocales/ar/messages.ftllocales/cs/messages.ftllocales/cy/messages.ftllocales/da/messages.ftllocales/de/messages.ftllocales/el/messages.ftllocales/en-GB/messages.ftllocales/en-US/messages.ftllocales/es-419/messages.ftllocales/es-ES/messages.ftllocales/fa/messages.ftllocales/fi/messages.ftllocales/fr/messages.ftllocales/gd/messages.ftllocales/he/messages.ftllocales/hi/messages.ftllocales/hu/messages.ftllocales/id/messages.ftllocales/it/messages.ftllocales/ja/messages.ftllocales/ko/messages.ftllocales/nb/messages.ftllocales/nl/messages.ftllocales/pl/messages.ftllocales/pt-BR/messages.ftllocales/pt-PT/messages.ftllocales/ro/messages.ftllocales/ru/messages.ftllocales/sv/messages.ftllocales/th/messages.ftllocales/tr/messages.ftllocales/uk/messages.ftllocales/vi/messages.ftllocales/zh-Hans/messages.ftllocales/zh-Hant/messages.ftl |
Add tests and BDD coverage for parsing and running netsuke help/help targets, including snapshots and integration tests. |
|
tests/bdd/steps/cli_verify.rstests/features/cli.featuretests/bdd/steps/cli.rstests/bdd/steps/help_targets.rstests/features/help_targets.featuretests/documentation_examples_tests.rstests/runner_help_targets_tests.rssrc/runner/help_tests.rssrc/snapshots/help_targets/netsuke__runner__help__tests__accessible_catalogue.snapsrc/snapshots/help_targets/netsuke__runner__help__tests__json_catalogue.snapsrc/snapshots/help_targets/netsuke__runner__help__tests__localized_catalogue_es_es.snapsrc/snapshots/help_targets/netsuke__runner__help__tests__text_catalogue.snapsrc/snapshots/cli/netsuke__cli__parser__tests__help_en_us.snapsrc/snapshots/cli/netsuke__cli__parser__tests__help_es_es.snaptests/ast_tests/actions.rstests/ast_tests/descriptions.rstests/ast_tests.rstests/manifest_command.rstests/bdd/steps/manifest_command_helpers.rstests/bdd/steps/mod.rsdylint.toml |
| Update user documentation and execution plan to describe target descriptions and the new help targets subcommand. |
|
docs/users-guide.mddocs/execplans/fef13161.md |
Assessment against linked issues
| Issue | Objective | Addressed | Explanation |
|---|---|---|---|
| #551 | Extend the manifest, AST, rendering, expansion, and parsing so that targets and actions support an optional description field that is preserved through the pipeline without affecting rule descriptions or Ninja progress output. |
✅ | |
| #551 | Implement a netsuke help targets subcommand (and associated help-topic handling) that loads, expands, renders, and validates the selected manifest without running Ninja, then emits a deterministic catalogue of actions and targets with descriptions, supporting text, accessible, localized, and JSON modes and honouring manifest-selection and output preferences. |
✅ | |
| #551 | Update documentation and CLI help to describe the new description field for targets/actions and the netsuke help targets subcommand, including localized help text and related surfaces such as shell completions/man pages/PowerShell help. |
✅ |
Possibly linked issues
- Add target descriptions and netsuke help targets #551: The PR fully implements optional target/action descriptions plus the
netsuke help targetssubcommand, including rendering, JSON output, tests, and docs as specified in the issue.
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull
request title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment@sourcery-ai summaryon the pull request to
(re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others. - Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. Comment on lines +105 to +114 fn json_catalogue_snapshot() -> Result<()> {
let _lock = localizer_lock();
let _guard = en_localizer();
let entries = fixture_entries()?;
let rendered = render_json(&entries)?;
snapshot_settings("help_targets").bind(|| {
assert_snapshot!("json_catalogue", rendered);
});
Ok(())
}❌ New issue: Code Duplication |
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. Comment on lines +55 to +66 pub(super) fn verify_help_topic(world: &TestWorld, expected: &HelpTopic) -> Result<()> {
let command = get_command(world)?;
let Commands::Help(args) = &command else {
bail!("expected help command, got {command:?}");
};
ensure!(
args.topic.as_ref() == Some(expected),
"expected help topic {expected:?}, got {:?}",
args.topic
);
Ok(())
}❌ New issue: Code Duplication |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Overall Code Complexitysrc/manifest/render.rs: What lead to degradation?This module has a mean cyclomatic complexity of 4.14 across 7 functions. The mean complexity threshold is 4 Why does this problem occur?Overall Code Complexity is measured by the mean cyclomatic complexity across all functions in the file. The lower the number, the better. How to fix it?You address the overall cyclomatic complexity by a) modularizing the code, and b) abstract away the complexity. Let's look at some examples: |
This comment was marked as resolved.
This comment was marked as resolved.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Use idiomatic prepositions in the localized target-help status labels.
Centralize capability-scoped fixture setup and error-chain checks so the missing-rule and unknown-default tests retain the same assertions without duplicating their setup.
Document the complete `netsuke help targets` Jinja allowlist and its host-observing exclusions in the developer, user, CLI, and migration guides. Record the registration boundary and the normal-build full-stdlib guarantee in the issue-551 ExecPlan and developer guide.
Render discovery metadata with an explicitly safe helper surface that cannot read host state, execute commands, or perform network work. Prove foreach action descriptions render through the catalogue without executing their recipes.
Remove the duplicate blank line so the documented v0.1.0 changes pass the Markdown lint contract after the rebase.
Exercise accessibility, localisation, and rejected query rendering through the command boundary without allowing recipes or build outputs. Correct catalogue terminology and keep the design and execution plan factual about the remaining release-help integration.
Keep the integration scenario focused on manifest setup and graph semantics by moving its command-level catalogue assertions into a private helper.
Expose the Clap command surface through release-help metadata so the manual and PowerShell artefacts document `help targets`. Harden target-help diagnostics against manifest control characters and exercise root, topic, and no-Ninja command boundaries. Split the catalogue integration scenarios into a focused child module.
Replace `char::is_control` with direct Unicode Cc ranges so the Kani toolchain can compile target-help rendering. Cover every Cc range boundary through the catalogue renderer.
Describe the generated Bash, Elvish, Fish, PowerShell, and Zsh completion files, their `completions/<shell>/` archive layout, and manual copy guidance. Clarify that `build.rs` generates completions while `cargo-orthohelp` remains the release source for manual and PowerShell help.
Generate five shell completion formats from `Cli::command()` and stage them with every release archive. Cover the generated command tree, manual-page topic, PowerShell generator metadata, and staging contract so `help targets` cannot drift from the generated help surfaces.
Document that `help targets` always validates the rendered build graph and correct the design record's discovery-only description contract. Extend the foreach regression to prove catalogue rendering executes neither action nor rule-backed target recipes.
Preserve manifest I/O failures during preflight validation and bypass Ninja program resolution for help commands. Limit the process-wide localizer lock to catalogue rendering, before snapshot assertion work begins.
Record bounded outcomes and durations at the catalogue-query boundary so operators can distinguish successful and failed manifest queries without exposing manifest-controlled values. Correct the ExecPlan's evidence to use reachable commits from the current branch history.
Describe the orchestration boundary, bounded metrics and labels, redaction contract, one-time registration, and local recorder/subscriber tests for `netsuke help targets`.
Move manifest loading, validation, and catalogue construction behind a fallible result that carries only catalogue and stage data. Keep telemetry, status reporting, and rendering at the command boundary so inspection stays query-safe while failed query stages are still reported. Cover the non-RunnerError telemetry category and document the bounded metric contract for contributors.
Preserve the intended manifest-query tests while repairing replayed fixtures. Split the AST value type and rendering tests into focused modules so the rebased branch satisfies the repository's module-size policy without changing the public AST path.
Share the localizer, recorder, and bounded-telemetry assertions across the success, manifest-not-found, and other-failure scenarios while preserving their distinct fixtures and expected labels.
Localize invalid manifest-default errors without exposing terminal controls, and retain deterministic assertions across the command and documentation examples. Avoid unnecessary help-catalogue JSON name allocations and simplify its test-visible catalogue builder.
Require help-target telemetry metrics to carry exactly the two bounded labels, and cover the rejection of any future extra label. Use consistent manifest and target terminology in the affected translations.
Record the final query, telemetry, and localisation follow-ups with reachable commit references so the completed plan matches the implemented feature.
Preserve the build-script composition boundary, completion generation, and help command after replaying the target-description branch onto `main`.
Avoid blocking the contender thread when a localizer-lock assertion times out, and clarify the matching command-help sentence.
Prevent graph-validation diagnostics from interpolating terminal controls from manifest target names, and pin the command-boundary behaviour.
Preserve the configurable normal-build parser while routing its injected stdlib configuration through the query-aware registration boundary.
ed28fbe to
0f79f9d
Compare
There was a problem hiding this comment.
Gates Failed
Enforce advisory code health rules
(1 file with Code Duplication)
Our agent can fix these. Install it.
Gates Passed
5 Quality Gates Passed
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| runner_help_targets_tests.rs | 1 advisory rule | 9.39 | Suppress |
Active suppressions
1 suppression
Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Closes #551
Summary
Add an optional
descriptionfield to manifest targets (and, by inheritance,actions) and expose the rendered target and action catalogue through a new
netsuke help targetssubcommand.descriptionrendered through thenormal Jinja pipeline, including
foreachexpansions. A target descriptionis discovery metadata; it never replaces a referenced rule description in
Ninja progress output.
netsuke help targetsloads, expands, renders, and validates the selectedmanifest without invoking Ninja. It lists actions and targets with their
descriptions, defaults, and the established colour, accessibility, locale,
and JSON-output conventions.
documentation coverage support the new surface across all locales.
References