Generic autosolve github workflow for automated issue resolution#5
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new reusable GitHub Actions/workflows to support automated “autosolve” (assess + implement) flows and changelog-driven release tagging, along with a lightweight bash test harness and CI wiring for the repo.
Changes:
- Introduce
autotag-from-changelogcomposite action + script + tests to create/push tags based onCHANGELOG.md. - Add
autosolvecomposite actions (assess,implement), shared bash utilities, prompts, and reusable workflows (Jira + GitHub Issue). - Add bash test framework (
test.sh,test_helpers.sh) plus CI workflow to run tests on PRs.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
test_helpers.sh |
Adds shared bash assertions/helpers for repository test scripts. |
test.sh |
Adds a simple test runner that discovers and executes *_test.sh files. |
autotag-from-changelog/auto-tag-release.sh |
Implements tagging logic based on CHANGELOG.md state. |
autotag-from-changelog/auto-tag-release_test.sh |
Tests tagging behavior using temporary git repos. |
autotag-from-changelog/action.yml |
Composite action wrapper for the changelog autotag script. |
autosolve/scripts/shared.sh |
Shared autosolve functions (validation, prompt building, result parsing, CLI install). |
autosolve/scripts/shared_test.sh |
Unit tests for shared autosolve functions. |
autosolve/scripts/assess.sh |
Runs read-only Claude assessment and extracts structured outputs. |
autosolve/scripts/assess_test.sh |
Tests assess output formatting/extraction behavior. |
autosolve/scripts/implement.sh |
Runs Claude implementation, security validation, push+PR creation, and output plumbing. |
autosolve/scripts/implement_test.sh |
Tests security_check behavior in a temporary git repo. |
autosolve/scripts/jira.sh |
Jira prompt building, commenting, transitions, and final status helpers. |
autosolve/scripts/jira_test.sh |
Tests non-HTTP Jira helper functions. |
autosolve/run_step.sh |
Entry-point wrapper to run autosolve script functions from the workspace CWD. |
autosolve/prompts/security-preamble.md |
System/security preamble injected into prompts. |
autosolve/prompts/assessment-footer.md |
Standardizes assessment output markers. |
autosolve/prompts/implementation-footer.md |
Standardizes implementation output markers and instructions. |
autosolve/assess/action.yml |
Composite action wiring for assess flow. |
autosolve/implement/action.yml |
Composite action wiring for implement flow (incl. security check and PR creation). |
actions_helpers.sh |
Adds common logging + GitHub Actions output helpers. |
actions_helpers_test.sh |
Tests for actions_helpers.sh helpers. |
README.md |
Documents new actions/workflows and local development/testing. |
CLAUDE.md |
Adds repo conventions and guidance for Claude-driven workflows and testing. |
CHANGELOG.md |
Adds entries describing the new actions/workflows. |
.shellcheckrc |
Configures shellcheck behavior for repo sourcing patterns. |
.github/workflows/test.yml |
Adds CI job to run ./test.sh on PRs. |
.github/workflows/jira-autosolve.yml |
Adds reusable Jira autosolve workflow that composes assess+implement. |
.github/workflows/github-issue-autosolve.yml |
Adds reusable GitHub Issue autosolve workflow (assess+implement + commenting/label mgmt). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
autosolve/scripts/implement.sh
Outdated
| target=$(readlink -f "$f" 2>/dev/null || true) | ||
| for blocked in "${BLOCKED_PATHS[@]}"; do | ||
| [ -z "$blocked" ] && continue | ||
| if echo "$target" | grep -qiE "/${blocked}"; then | ||
| log_error "Symlink to blocked path: $f -> $target" | ||
| violation_found=true | ||
| fi |
There was a problem hiding this comment.
Done — see reply above, all three checks now use grep -F for literal matching.
2b58edf to
c3e5ff5
Compare
Feedback from testing in ccloud-private-automation-testingWhile building a test workflow that uses the composite actions directly (not the reusable workflows), I noticed the README's auth documentation is a bit thin for direct action usage. The reusable workflows (
This works fine once you read # Direct action usage with Vertex AI
- uses: google-github-actions/auth@v3
with:
project_id: my-project
service_account: my-sa@my-project.iam.gserviceaccount.com
workload_identity_provider: projects/.../providers/...
- uses: cockroachdb/actions/autosolve/assess@v1
env:
CLAUDE_CODE_USE_VERTEX: "1"
ANTHROPIC_VERTEX_PROJECT_ID: my-project
CLOUD_ML_REGION: us-east5
with:
prompt: "Fix the bug" |
Bug: status reports SUCCESS when push_and_pr failsWhen the implementation succeeds and security check passes, but the From a test run log: The implementation step succeeded (Claude created the file), security check passed, but # implement.sh:set_implement_outputs()
if [ "$impl_result" = "SUCCESS" ] && [ "$security_conclusion" != "failure" ]; then
status="SUCCESS"It doesn't check whether Suggested fix: pass |
Bug: summary output is always empty (AUTOSOLVE_TMPDIR not shared between steps)The assessment summary (and likely the implementation summary too) is always empty because Each step in a composite action runs in a new shell. # run_step.sh
if [ -z "${AUTOSOLVE_TMPDIR:-}" ]; then
AUTOSOLVE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/autosolve_XXXXXX")"
export AUTOSOLVE_TMPDIR
fiSo what happens:
Observed output: The Possible fix: write if [ -z "${AUTOSOLVE_TMPDIR:-}" ]; then
AUTOSOLVE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/autosolve_XXXXXX")"
export AUTOSOLVE_TMPDIR
echo "AUTOSOLVE_TMPDIR=$AUTOSOLVE_TMPDIR" >> "${GITHUB_ENV:-/dev/null}"
fi |
Docs: callers should checkout the PR base branch, not the trigger refThe autosolve actions work on whatever is already checked out. When a caller uses For example, if the workflow runs from branch This also causes a downstream problem: if the branch has workflow file modifications relative to the fork's main, GitHub requires the The fix in the caller workflow is simple: - uses: actions/checkout@v5
with:
ref: main # checkout the PR base branch, not the trigger ref
fetch-depth: 0
persist-credentials: false # prevent checkout's credential helper from interfering with fork pushWorth documenting in the README examples, especially for Also noting that |
Extract reusable actions_helpers.sh (log_error, log_warning, log_notice, set_output, set_output_multiline) and test_helpers.sh (expect_success, expect_failure, print_results) so all actions share common patterns. Update autotag-from-changelog to use the shared helpers. Configure shellcheck with source-path=SCRIPTDIR for IDE go-to-definition support.
646b620 to
6ff8275
Compare
Add autosolve/assess and autosolve/implement composite actions that use Claude Code to evaluate and fix issues autonomously. Add reusable workflows for GitHub Issues and Jira integration that compose the actions with ticket comments, label management, and transitions.
6ff8275 to
2a0f999
Compare
Cherry-picked actions_helpers.sh and test_helpers.sh from PR cockroachdb#5 (CNSL-1944 autosolve branch) to support the release-version-extract action's log_error and set_output functions.
- Added comprehensive test workflow covering: - Valid changelog format validation - Breaking change detection (full mode) - Version ordering validation (valid and invalid) - Date ordering validation - Invalid changelog format handling - Multiple version validation depth - Breaking change indentation handling - Cherry-picked actions_helpers.sh and test_helpers.sh from PR cockroachdb#5 (CNSL-1944 autosolve branch) to support the validate_version_order.sh script's log_error and set_output functions.
No description provided.