You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hatch: list patternFile/patternText in the catalog and point to them from the unknown-pattern error (#2000) - #2007
run_hatch already loads patternFile / patternText through patfile::load_param before it checks the pattern name, but neither the catalog nor the error said so:
The hatch entry of commands now lists patternFile? (path to a .pat file) and patternText? (its contents), and notes that pattern can be built in or come from one of them.
The error for a name that is not built in now reads unknown pattern GRAVEL: not built in; load it with patternFile or patternText (a .pat file). It still starts with unknown pattern X, so the existing json_hatch_refuses_an_undefined_pattern test still passes.
No new built-in patterns. No behaviour change: only the help text and the error message differ.
Test: unknown_pattern_error_and_catalog_name_the_pat_file_route checks that both the error and the hatch params string name the route. It fails on main.
Summary by CodeRabbit
Documentation
The hatch command’s parameter catalog now describes options for loading user-defined patterns from a file or text.
Bug Fixes
When a requested pattern is unavailable, the error message now points to loading a .pat file and identifies the available loading options.
Reviewing files that changed from the base of the PR and between f043540 and afef4a2.
📒 Files selected for processing: 1
crates/engine/src/cmd/hatch.rs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
📝 Walkthrough
The HATCH command parameters now document patternFile and patternText. The unknown-pattern error points callers to these options. A test checks the catalog text and error.
Changes: HATCH pattern discoverability
Layer / File(s)
Summary
Catalog, error, and test crates/engine/src/cmd/hatch.rs
The parameter description lists pattern-loading options. The unknown-pattern error points to them, and a test checks both updates.
storytold/cadcraft#954: Handles loaded user-defined hatch patterns in properties.set, using pattern data loaded by HATCH.
storytold/cadcraft#1443: Adds Hatch Editor support for loaded .pat patterns and user-defined hatch patterns.
Suggested reviewers:lloydnicholson, marcoarnulfo
Merge Risk:⚪ Minimal · up to afef4
This discoverability-only change does not alter HATCH execution behavior and is ready to merge.
Architecture risk:🟡 Medium · up to afef4
The change affects 1 system.
Changed systems:crates
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — crates (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
observed — Modified behavior in crates/engine/src/cmd/hatch.rs: The hatch command parameter description now documents patternFile and patternText as ways to load pattern definitions.
observed — Modified behavior in crates/engine/src/cmd/hatch.rs: The unknown-pattern error now says the pattern is not built in and directs callers to load it with patternFile or patternText.
observed — Modified behavior in crates/engine/src/cmd/hatch.rs: Added a test that requests an undefined pattern and checks that the error mentions patternFile; it also checks that the hatch command parameters mention both patternFile and patternText.
Reliability and maintainability
inferred — Risk-relevant change factors for crates: blast_radius_1; direct_dependents_1
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main changes: adding patternFile/patternText to the catalog and referencing them in the unknown-pattern error.
Linked Issues check
Issue [#2000] requires discoverability for the existing .pat loading route. The hatch catalog now lists patternFile? as a .pat file path and patternText? as its contents. The unknown-pattern…
Out of Scope Changes check
The pull request changes only the hatch parameter documentation, the related unknown-pattern error, and an automated test for those changes. These changes directly support issue [#2000]. No unrelate…
Full details: Linked Issues check
Explanation
Issue [#2000] requires discoverability for the existing .pat loading route. The hatch catalog now lists patternFile? as a .pat file path and patternText? as its contents. The unknown-pattern error now directs users to these parameters. The new test checks both the error and the catalog entry. No new built-in pattern is added.
Full details: Out of Scope Changes check
Explanation
The pull request changes only the hatch parameter documentation, the related unknown-pattern error, and an automated test for those changes. These changes directly support issue [#2000]. No unrelated behavior or feature change is present in the reviewed diff.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2000.
run_hatchalready loadspatternFile/patternTextthroughpatfile::load_parambefore it checks the pattern name, but neither the catalog nor the error said so:hatchentry ofcommandsnow listspatternFile?(path to a .pat file) andpatternText?(its contents), and notes thatpatterncan be built in or come from one of them.unknown pattern GRAVEL: not built in; load it with patternFile or patternText (a .pat file). It still starts withunknown pattern X, so the existingjson_hatch_refuses_an_undefined_patterntest still passes.No new built-in patterns. No behaviour change: only the help text and the error message differ.
Test:
unknown_pattern_error_and_catalog_name_the_pat_file_routechecks that both the error and thehatchparams string name the route. It fails on main.Summary by CodeRabbit
hatchcommand’s parameter catalog now describes options for loading user-defined patterns from a file or text..patfile and identifies the available loading options.