feat(jsweep): add branch-prefix to create-pull-request safe-outputs, default to "signed/"#32224
Conversation
…set jsweep to signed/ Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a branch-prefix option to the create-pull-request safe-output configuration and updates jsweep to default PR branches to signed/*, including schema/docs updates and test coverage.
Changes:
- Add
branch-prefixtoCreatePullRequestsConfig, schema, compiler handler config serialization, and tool description constraints. - Implement
branch_prefixhandling in the JScreate_pull_requestsafe-output handler with idempotent prefix application. - Update jsweep workflow + lockfile and add tests for the new behavior.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/tool_description_enhancer.go | Adds a constraint string describing the configured PR branch prefix. |
| pkg/workflow/jsweep_workflow_test.go | Verifies jsweep workflow sets branch-prefix: "signed/". |
| pkg/workflow/create_pull_request.go | Extends CreatePullRequestsConfig with BranchPrefix YAML field. |
| pkg/workflow/compiler_safe_outputs_handlers.go | Serializes branch_prefix into the safe-outputs handler config JSON. |
| pkg/parser/schemas/main_workflow_schema.json | Adds branch-prefix to the create-pull-request schema. |
| docs/src/content/docs/reference/frontmatter-full.md | Documents the new branch-prefix frontmatter field. |
| actions/setup/js/create_pull_request.test.cjs | Adds unit tests covering branch-prefix application and idempotency. |
| actions/setup/js/create_pull_request.cjs | Applies branch_prefix to generated/agent-provided branch names. |
| .github/workflows/jsweep.md | Configures jsweep to use branch-prefix: "signed/". |
| .github/workflows/jsweep.lock.yml | Recompiled lockfile reflecting the new safe-outputs configuration. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 1
| // Apply the configured branch prefix (e.g. "signed/") if it hasn't already been applied. | ||
| if (branchPrefix && !branchName.startsWith(branchPrefix)) { | ||
| branchName = `${branchPrefix}${branchName}`; | ||
| core.info(`Applied branch prefix: ${branchName}`); | ||
| } |
|
Please refresh the branch and rerun checks so maintainers can verify the latest state.
|
|
@copilot lint go and review comments |
…racters Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Go linting ( |
New Feature
Introduces a
branch-prefixoption for thecreate-pull-requestsafe-output type and sets jsweep to use"signed/", so all jsweep PRs land onsigned/*branches.What does this feature do?
When
branch-prefixis set, the value is prepended to any PR branch name — whether agent-supplied or auto-generated. Double-application is guarded: if the branch already starts with the prefix it is left unchanged.Implementation details
CreatePullRequestsConfig— newBranchPrefix stringfield (yaml:"branch-prefix,omitempty")compiler_safe_outputs_handlers.go— serialisesbranch_prefixintoGH_AW_SAFE_OUTPUTS_HANDLER_CONFIGcreate_pull_request.cjs— readsconfig.branch_prefixand prepends it after branch name normalisation/salt, with an idempotency checktool_description_enhancer.go— emits aBranch name will be prefixed with "..."constraint when setmain_workflow_schema.json— addsbranch-prefixproperty to thecreate-pull-requestobject schemafrontmatter-full.md— documents the new fieldjsweep.lock.yml— recompiled;"branch_prefix":"signed/"now present in both the audit block and handler config