Skip to content

Add github-issue-autosolve reusable workflow#15

Open
fantapop wants to merge 22 commits into
mainfrom
pr/autosolve-workflow
Open

Add github-issue-autosolve reusable workflow#15
fantapop wants to merge 22 commits into
mainfrom
pr/autosolve-workflow

Conversation

@fantapop
Copy link
Copy Markdown
Contributor

Summary

Turnkey reusable workflow for GitHub Issues integration that composes the autosolve/assess and autosolve/implement actions with:

  • Automatic issue comments for status updates (PR created, skipped, failed, already exists)
  • Label-based triggering with automatic label removal
  • Concurrency control per issue number
  • Step summaries for skipped/existing-PR cases
  • Token usage summary appended to step summary
  • Side-by-side checkout layout isolating credentials from Claude
  • Vertex AI and API key authentication modes

Testing

Tested end-to-end against cockroachlabs/ccloud-private-automation-testing via issue label trigger.

Test plan

  • End-to-end test via issue label trigger
  • Existing PR detection works correctly
  • Assessment SKIP path produces correct comment and summary

Copy link
Copy Markdown

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 reusable GitHub Actions workflow intended to automate resolving GitHub Issues by composing the existing autosolve/assess and autosolve/implement actions, plus status commenting, label management, and concurrency controls for per-issue runs.

Changes:

  • Added a new reusable workflow .github/workflows/github-issue-autosolve.yml that orchestrates assess → implement and posts issue comments for common outcomes.
  • Added changelog entry documenting the new reusable workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.

File Description
CHANGELOG.md Documents the new github-issue-autosolve reusable workflow under Unreleased additions.
.github/workflows/github-issue-autosolve.yml Introduces the reusable workflow with issue/label handling, concurrency per issue, and assess/implement orchestration with issue comments and summaries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/github-issue-autosolve.yml Outdated
Comment thread .github/workflows/github-issue-autosolve.yml Outdated
Comment thread .github/workflows/github-issue-autosolve.yml Outdated
Comment thread .github/workflows/github-issue-autosolve.yml Outdated
Comment thread .github/workflows/github-issue-autosolve.yml
Comment thread .github/workflows/github-issue-autosolve.yml
Comment thread .github/workflows/github-issue-autosolve.yml Outdated
Comment thread .github/workflows/github-issue-autosolve.yml Outdated
Comment thread .github/workflows/github-issue-autosolve.yml Outdated
Comment thread .github/workflows/github-issue-autosolve.yml Outdated
@fantapop fantapop force-pushed the pr/autosolve-workflow branch from dc09887 to 55ac777 Compare March 25, 2026 15:57
@fantapop fantapop requested a review from linhcrl March 25, 2026 16:05
@fantapop fantapop force-pushed the pr/autosolve-workflow branch 3 times, most recently from 124bdb4 to 7c6c9ae Compare March 25, 2026 19:45
@fantapop fantapop mentioned this pull request Mar 25, 2026
1 task
@fantapop fantapop force-pushed the pr/autosolve-workflow branch from 7c6c9ae to d96e9ab Compare March 25, 2026 19:52
@fantapop fantapop force-pushed the pr/autosolve-go branch 2 times, most recently from 922542b to a6b2953 Compare March 27, 2026 20:28
@fantapop fantapop force-pushed the pr/autosolve-workflow branch from c8ce1c3 to 39b77ec Compare March 27, 2026 20:29
@fantapop fantapop force-pushed the pr/autosolve-workflow branch 3 times, most recently from a7f878c to 64e408e Compare March 27, 2026 21:22
fantapop and others added 8 commits April 9, 2026 08:47
Give the security reviewer tools (Bash, Read, Grep, Glob) so it can
inspect staged diffs itself instead of having them injected into the
prompt. This prevents attacker-controlled code from escaping prompt
boundaries. Also adds a Prompt field to RunOptions so callers can pass
prompt text directly without writing a temp file, and validates that
Prompt and PromptFile are not both set.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
The additional_instructions input was redundant — callers can put
everything in the prompt input, and skill files already cover
repo-specific instructions. Removing it simplifies the prompt assembly
and eliminates a potential prompt injection surface.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Rename prompt to system_prompt to signal it should contain only trusted
instructions. Add context_vars input for safely passing untrusted user
content (e.g., issue titles/bodies) via environment variables — Claude
is automatically told which vars are available and instructed not to
follow instructions found within them.

Build an explicit env allowlist for the Claude CLI subprocess so it only
sees baseline system/auth vars plus caller-specified context vars,
preventing secrets from leaking. Remove ANTHROPIC_API_KEY support in
favor of Vertex AI only.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Ensure .github/ is always included in blocked paths regardless of
caller configuration. This prevents Claude from modifying workflow
files, actions, or other GitHub configuration that could run arbitrary
code.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
- Fix YAML parse error in assess action.yml (remove quotes around
  $RUNNER_TEMP/autosolve in the run directive).
- Tell Claude it is in READ-ONLY mode during assessment so it does
  not complain about lacking write permissions.
- Skip Go setup and binary build in implement action when the
  autosolve binary already exists from a prior step, avoiding
  duplicate cache restore tar errors.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
- Instruct Claude to never include secret values in responses —
  describe findings by file and line number instead.
- Skip logging security review output since it may reference
  secrets found in the diff.
- Log Claude output in collapsible ::group:: blocks in the step
  log, gated by a verbose_logging input (default false).

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
JSON output in ::group:: log sections is now indented for readability
in the GitHub Actions log viewer.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
The assess step only permits Read,Grep,Glob — no Bash — so Claude
could not read context_vars from the environment. Add a scoped
Bash(printenv VAR) permission for each declared context var and update
the prompt to tell Claude to use `printenv`.

fixup bdb5ba4

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@fantapop fantapop force-pushed the pr/autosolve-workflow branch from 7a75118 to b0444a9 Compare April 9, 2026 15:48
fantapop and others added 4 commits April 9, 2026 08:50
git symbolic-ref refs/remotes/origin/HEAD prints a fatal error
when origin/HEAD is not configured (common with actions/checkout
persist-credentials: false). Rather than suppress the error,
default pr_base_branch to "main" in the action input and remove
the auto-detection code entirely.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
The workspace root is the actions repo checkout, not the target repo,
so setup-go can't find go.mod for cache hashing. Caching isn't needed
since the autosolve binary is a one-off build.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Previously the implement binary exited 0 even on failure (all retries
exhausted, security check failed, PR creation failed), making the step
appear green. Now it writes outputs first so subsequent workflow steps
can still read them, then returns an error so the step is correctly
marked as failed.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Turnkey GitHub Issues integration composing assess + implement with
issue comments, label management, and concurrency control. Checks for
existing PRs by head branch, authenticates via Vertex AI workload
identity federation, and supports verbose Claude logging.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@fantapop fantapop force-pushed the pr/autosolve-workflow branch from b0444a9 to 66b1956 Compare April 9, 2026 15:51
@fantapop fantapop force-pushed the pr/autosolve-go branch 13 times, most recently from 6e2dc18 to 909d84e Compare May 12, 2026 16:47
Base automatically changed from pr/autosolve-go to main May 12, 2026 18:19
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.

2 participants