Repository navigation
rule-selector: optional check line, run once by stage-implement #957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
15 changes: 14 additions & 1 deletion
15
lib/skills/__tests__/fixtures/rule-selector/pack/skills.jsonc
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,21 @@ | ||
| { | ||
| "version": 2, | ||
| "pipelines": { | ||
| "feature": [ | ||
| "mattstack:stage-provision", | ||
| "mattstack:stage-plan", | ||
| "mattstack:stage-gates", | ||
| "mattstack:stage-evidence", | ||
| "mattstack:stage-implement", | ||
| "mattstack:stage-self-review", | ||
| "mattstack:stage-ship", | ||
| "mattstack:stage-watch-ci" | ||
| ] | ||
| }, | ||
| "bindings": { | ||
| "mattstack:review/rule-selector": { "rule-selector": "acme:acme-rule-selector" }, | ||
| "mattstack:self-review/rule-selector": { "rule-selector": "acme:acme-rule-selector" }, | ||
| "mattstack:receive-review/rule-selector": { "rule-selector": "acme:acme-rule-selector" } | ||
| "mattstack:receive-review/rule-selector": { "rule-selector": "acme:acme-rule-selector" }, | ||
| "mattstack:stage-implement/rule-selector": { "rule-selector": "acme:acme-rule-selector" } | ||
| } | ||
| } |
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
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
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
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
12 changes: 12 additions & 0 deletions
12
plugins/mattstack/attachments/pipeline/stage-implement/fix-rule-breaks.block.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| node: fix_rule_breaks | ||
| --- | ||
|
|
||
| # Fix the rules the change breaks, then commit | ||
|
|
||
| Fix each rule the check showed the change breaking. A fix that changes | ||
| behavior is test-first, as in the rest of this stage. Commit the fixes on | ||
| the branch, inside the worktree. A rule you judge does not apply, or a | ||
| fix you cannot make without leaving the plan, stays as it is: name the | ||
| rule and the line in one line when the stage returns to the orchestrator. | ||
| Then record the commits; there is no second check. |
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
45 changes: 45 additions & 0 deletions
45
plugins/mattstack/attachments/pipeline/stage-implement/rule-selector.block.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| node: check_rules | ||
| props: | ||
| rule-selector: | ||
| merge: replace | ||
| default: "" | ||
| contract: "rule-selector@1" | ||
| --- | ||
|
|
||
| # Check the work against the team's rules | ||
|
|
||
| The pack's rule selector is the text after the italic line at the end of | ||
| this section; an unbound slot leaves it empty. Resolve it now, on this | ||
| run, since it may consult settings or the environment. It resolves to the | ||
| single line `selector: none`, or to `selector:`, `verdicts:` and `fence:` | ||
| lines with an optional fourth, `check: <command template>`. Only the | ||
| `check:` line matters here. Skip this step (the `no` edge of Does the rule | ||
| selector resolve to a check line?) when the text is empty, resolves to | ||
| `selector: none`, or has no `check:` line. | ||
|
|
||
| With a `check:` line: | ||
|
|
||
| 1. Find the branch point the way self-review does: `git merge-base | ||
| origin/HEAD HEAD`, or the default branch by name when `origin/HEAD` is | ||
| unset. | ||
| 2. Replace `{base}` in the command with that sha and run it once on Bash, | ||
| in the worktree, with nothing on stdin. Capture its stdout and its exit | ||
| status. | ||
| 3. Read the stdout. It is written for you: the rules that apply to this | ||
| change and the lines worth a look. Decide, rule by rule, whether the | ||
| change breaks it. | ||
|
|
||
| An exit other than 0 is one observation, never a failure of the stage: | ||
| quote the exit status and the first line of stderr in one line when the | ||
| stage returns to the orchestrator, fix nothing on its account, and record | ||
| the commits. | ||
|
|
||
| Run it once. The check never runs again in this stage. Rule verdicts come | ||
| later only where the pack's self-review runs the self-review verb with | ||
| this same selector bound; the default self-review stage reads the diff | ||
| without the rules. | ||
|
|
||
| *If a rule below asks for a move this skill's graph marks STOP, take the off-script edge instead.* | ||
|
|
||
| {{props.rule-selector}} |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.