Skip to content

feat(jsweep): add branch-prefix to create-pull-request safe-outputs, default to "signed/"#32224

Merged
pelikhan merged 4 commits into
mainfrom
copilot/signedupdate-jsweep-workflow
May 14, 2026
Merged

feat(jsweep): add branch-prefix to create-pull-request safe-outputs, default to "signed/"#32224
pelikhan merged 4 commits into
mainfrom
copilot/signedupdate-jsweep-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

New Feature

Introduces a branch-prefix option for the create-pull-request safe-output type and sets jsweep to use "signed/", so all jsweep PRs land on signed/* branches.

What does this feature do?

When branch-prefix is 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.

# jsweep.md
safe-outputs:
  create-pull-request:
    branch-prefix: "signed/"   # branches become signed/<workflow-id>-<hex>
    title-prefix: "[jsweep] "
    labels: [unbloat, automation]

Implementation details

  • CreatePullRequestsConfig — new BranchPrefix string field (yaml:"branch-prefix,omitempty")
  • compiler_safe_outputs_handlers.go — serialises branch_prefix into GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG
  • create_pull_request.cjs — reads config.branch_prefix and prepends it after branch name normalisation/salt, with an idempotency check
  • tool_description_enhancer.go — emits a Branch name will be prefixed with "..." constraint when set
  • main_workflow_schema.json — adds branch-prefix property to the create-pull-request object schema
  • frontmatter-full.md — documents the new field
  • jsweep.lock.yml — recompiled; "branch_prefix":"signed/" now present in both the audit block and handler config

Generated by 👨‍🍳 PR Sous Chef ·

…set jsweep to signed/

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title feat: add branch-prefix support to create-pull-request safe-outputs, set jsweep to signed/ feat(jsweep): add branch-prefix to create-pull-request safe-outputs, default to "signed/" May 14, 2026
Copilot AI requested a review from pelikhan May 14, 2026 22:16
@pelikhan pelikhan marked this pull request as ready for review May 14, 2026 23:01
Copilot AI review requested due to automatic review settings May 14, 2026 23:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-prefix to CreatePullRequestsConfig, schema, compiler handler config serialization, and tool description constraints.
  • Implement branch_prefix handling in the JS create_pull_request safe-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

Comment on lines +1317 to +1321
// 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}`);
}
@github-actions
Copy link
Copy Markdown
Contributor

Please refresh the branch and rerun checks so maintainers can verify the latest state.

Generated by 👨‍🍳 PR Sous Chef ·

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot lint go and review comments

Copilot AI and others added 2 commits May 14, 2026 23:44
…racters

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 14, 2026

@copilot lint go and review comments

Go linting (go vet ./...) passes cleanly. The reviewer's concern about unvalidated branch_prefix has been addressed: config.branch_prefix is now passed through normalizeBranchName at config-read time (commit 857ad1b). If the raw value contains characters that are invalid in a git ref, the normalized form is used and a core.warning is emitted to prompt operators to fix their configuration. A test covering the invalid-prefix path was also added.

@pelikhan pelikhan merged commit e971c25 into main May 14, 2026
@pelikhan pelikhan deleted the copilot/signedupdate-jsweep-workflow branch May 14, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants