From 74cbd6de321fa1f556258f6757f4f44e5b594a12 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:41:42 -0800 Subject: [PATCH] Enable ad-hoc deeptest workflow execution via workflow_dispatch (#8448) * Initial plan * Remove slash_command and blocking activation conditions from deeptest workflow - Remove slash_command configuration to eliminate team membership and command position checks - Simplify workflow to only support workflow_dispatch for ad-hoc execution - Remove pre_activation job and complex activation conditions - Update README to reflect workflow_dispatch-only usage - Keep file_path input parameter for specifying source files to test Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- .github/workflows/README-deeptest.md | 29 ++--- .github/workflows/deeptest.lock.yml | 158 +++------------------------ .github/workflows/deeptest.md | 5 - 3 files changed, 26 insertions(+), 166 deletions(-) diff --git a/.github/workflows/README-deeptest.md b/.github/workflows/README-deeptest.md index ce630c34b..c94bf128e 100644 --- a/.github/workflows/README-deeptest.md +++ b/.github/workflows/README-deeptest.md @@ -15,7 +15,7 @@ DeepTest is an AI-powered GitHub Agentic Workflow that automatically generates c ## How to Use -### Method 1: Workflow Dispatch (Manual Trigger) +### Workflow Dispatch (Manual Trigger) 1. Go to **Actions** → **Deeptest** in the GitHub repository 2. Click **Run workflow** @@ -23,20 +23,11 @@ DeepTest is an AI-powered GitHub Agentic Workflow that automatically generates c 4. Optionally link to an issue number 5. Click **Run workflow** -### Method 2: Slash Command (In Issues/PRs) - -Simply comment on any issue or pull request: - -``` -/deeptest src/util/vector.h -``` - The workflow will: -1. Extract the file path from your comment -2. Analyze the source file -3. Generate comprehensive tests -4. Create a pull request with the test files -5. Add a comment with statistics and instructions +1. Analyze the source file +2. Generate comprehensive tests +3. Create a pull request with the test files +4. Optionally add a comment to the linked issue with statistics and instructions ## What Gets Generated @@ -83,16 +74,12 @@ After running, DeepTest will: ## Example Usage ### Example 1: Test a C++ utility file -``` -/deeptest src/util/vector.h -``` +Via workflow dispatch with file path: `src/util/vector.h` ### Example 2: Test a Python API file -``` -/deeptest src/api/python/z3/z3.py -``` +Via workflow dispatch with file path: `src/api/python/z3/z3.py` -### Example 3: Via workflow dispatch +### Example 3: Link to an issue - File path: `src/ast/ast.cpp` - Issue number: `1234` (optional) diff --git a/.github/workflows/deeptest.lock.yml b/.github/workflows/deeptest.lock.yml index bdc62c256..8cce8474c 100644 --- a/.github/workflows/deeptest.lock.yml +++ b/.github/workflows/deeptest.lock.yml @@ -13,30 +13,18 @@ # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ # -# This file was automatically generated by gh-aw (v0.38.2). DO NOT EDIT. +# This file was automatically generated by gh-aw (v0.38.4). DO NOT EDIT. # # To update this file, edit the corresponding .md file and run: # gh aw compile # For more information: https://github.com/githubnext/gh-aw/blob/main/.github/aw/github-agentic-workflows.md # # Generate comprehensive test cases for Z3 source files +# +# frontmatter-hash: 04aea80f42871dda0fb3052041a21a8783c9a3eeba0ad4f86eb41741b3974367 name: "Deeptest" "on": - issue_comment: - types: - - created - - edited - issues: - types: - - opened - - edited - - reopened - pull_request: - types: - - opened - - edited - - reopened workflow_dispatch: inputs: file_path: @@ -51,37 +39,21 @@ name: "Deeptest" permissions: {} concurrency: - group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number }}" + group: "gh-aw-${{ github.workflow }}" run-name: "Deeptest" jobs: activation: - needs: pre_activation - if: > - ((needs.pre_activation.result == 'skipped') || (needs.pre_activation.outputs.activated == 'true')) && - (((github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request') && - ((github.event_name == 'issues') && (contains(github.event.issue.body, '/deeptest')) || (github.event_name == 'issue_comment') && - ((contains(github.event.comment.body, '/deeptest')) && (github.event.issue.pull_request == null)) || - (github.event_name == 'issue_comment') && - ((contains(github.event.comment.body, '/deeptest')) && (github.event.issue.pull_request != null)) || - (github.event_name == 'pull_request') && - (contains(github.event.pull_request.body, '/deeptest')))) || (!(github.event_name == 'issues' || github.event_name == 'issue_comment' || - github.event_name == 'pull_request'))) runs-on: ubuntu-slim permissions: contents: read - discussions: write - issues: write - pull-requests: write outputs: - comment_id: ${{ steps.add-comment.outputs.comment-id }} - comment_repo: ${{ steps.add-comment.outputs.comment-repo }} - comment_url: ${{ steps.add-comment.outputs.comment-url }} - slash_command: ${{ needs.pre_activation.outputs.matched_command }} + comment_id: "" + comment_repo: "" steps: - name: Setup Scripts - uses: githubnext/gh-aw/actions/setup@v0.38.2 + uses: githubnext/gh-aw/actions/setup@v0.38.4 with: destination: /opt/gh-aw/actions - name: Check workflow file timestamps @@ -94,23 +66,13 @@ jobs: setupGlobals(core, github, context, exec, io); const { main } = require('/opt/gh-aw/actions/check_workflow_timestamp_api.cjs'); await main(); - - name: Add comment with workflow run link - id: add-comment - if: github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment' || (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.id == github.repository_id) - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - GH_AW_WORKFLOW_NAME: "Deeptest" - with: - script: | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('/opt/gh-aw/actions/add_workflow_run_comment.cjs'); - await main(); agent: needs: activation runs-on: ubuntu-latest permissions: read-all + concurrency: + group: "gh-aw-copilot-${{ github.workflow }}" env: DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} GH_AW_ASSETS_ALLOWED_EXTS: "" @@ -128,7 +90,7 @@ jobs: secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} steps: - name: Setup Scripts - uses: githubnext/gh-aw/actions/setup@v0.38.2 + uses: githubnext/gh-aw/actions/setup@v0.38.4 with: destination: /opt/gh-aw/actions - name: Create gh-aw temp directory @@ -517,7 +479,7 @@ jobs: model: process.env.GH_AW_MODEL_AGENT_COPILOT || "", version: "", agent_version: "0.0.397", - cli_version: "v0.38.2", + cli_version: "v0.38.4", workflow_name: "Deeptest", experimental: false, supports_tools_allowlist: true, @@ -562,8 +524,6 @@ jobs: GH_AW_GITHUB_ACTOR: ${{ github.actor }} GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} - GH_AW_GITHUB_EVENT_INPUTS_FILE_PATH: ${{ github.event.inputs.file_path }} - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_NUMBER: ${{ github.event.inputs.issue_number }} GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} @@ -624,23 +584,7 @@ jobs: PROMPT_EOF cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT" - - {{#runtime-import agentics/deeptest.md}} - - ## Context - - You are the DeepTest agent for the Z3 theorem prover repository. - - **Workflow dispatch file path**: __GH_AW_GITHUB_EVENT_INPUTS_FILE_PATH__ - - **Issue number** (if linked): __GH_AW_GITHUB_EVENT_INPUTS_ISSUE_NUMBER__ - - If triggered by a slash command (`/deeptest`), extract the file path from the issue or comment text. - - ## Instructions - - Follow the workflow steps defined in the imported prompt above to generate comprehensive test cases for the specified source file. - + {{#runtime-import workflows/deeptest.md}} PROMPT_EOF - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 @@ -651,8 +595,6 @@ jobs: GH_AW_GITHUB_ACTOR: ${{ github.actor }} GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} - GH_AW_GITHUB_EVENT_INPUTS_FILE_PATH: ${{ github.event.inputs.file_path }} - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_NUMBER: ${{ github.event.inputs.issue_number }} GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} @@ -671,8 +613,6 @@ jobs: GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR, GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID, GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER, - GH_AW_GITHUB_EVENT_INPUTS_FILE_PATH: process.env.GH_AW_GITHUB_EVENT_INPUTS_FILE_PATH, - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_INPUTS_ISSUE_NUMBER, GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER, GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER, GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, @@ -684,8 +624,6 @@ jobs: uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_GITHUB_EVENT_INPUTS_FILE_PATH: ${{ github.event.inputs.file_path }} - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_NUMBER: ${{ github.event.inputs.issue_number }} with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -779,7 +717,6 @@ jobs: GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_COMMAND: deeptest with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -872,7 +809,7 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Setup Scripts - uses: githubnext/gh-aw/actions/setup@v0.38.2 + uses: githubnext/gh-aw/actions/setup@v0.38.4 with: destination: /opt/gh-aw/actions - name: Debug job inputs @@ -980,12 +917,14 @@ jobs: if: needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true' runs-on: ubuntu-latest permissions: {} + concurrency: + group: "gh-aw-copilot-${{ github.workflow }}" timeout-minutes: 10 outputs: success: ${{ steps.parse_results.outputs.success }} steps: - name: Setup Scripts - uses: githubnext/gh-aw/actions/setup@v0.38.2 + uses: githubnext/gh-aw/actions/setup@v0.38.4 with: destination: /opt/gh-aw/actions - name: Download agent artifacts @@ -1116,67 +1055,6 @@ jobs: path: /tmp/gh-aw/threat-detection/detection.log if-no-files-found: ignore - pre_activation: - if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request') && - ((github.event_name == 'issues') && (contains(github.event.issue.body, '/deeptest')) || (github.event_name == 'issue_comment') && - ((contains(github.event.comment.body, '/deeptest')) && (github.event.issue.pull_request == null)) || - (github.event_name == 'issue_comment') && - ((contains(github.event.comment.body, '/deeptest')) && (github.event.issue.pull_request != null)) || - (github.event_name == 'pull_request') && - (contains(github.event.pull_request.body, '/deeptest')))) || (!(github.event_name == 'issues' || github.event_name == 'issue_comment' || - github.event_name == 'pull_request'))) - runs-on: ubuntu-slim - permissions: - discussions: write - issues: write - pull-requests: write - outputs: - activated: ${{ (steps.check_membership.outputs.is_team_member == 'true') && (steps.check_command_position.outputs.command_position_ok == 'true') }} - matched_command: ${{ steps.check_command_position.outputs.matched_command }} - steps: - - name: Setup Scripts - uses: githubnext/gh-aw/actions/setup@v0.38.2 - with: - destination: /opt/gh-aw/actions - - name: Add eyes reaction for immediate feedback - id: react - if: github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment' || (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.id == github.repository_id) - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - GH_AW_REACTION: "eyes" - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('/opt/gh-aw/actions/add_reaction.cjs'); - await main(); - - name: Check team membership for command workflow - id: check_membership - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - GH_AW_REQUIRED_ROLES: admin,maintainer,write - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('/opt/gh-aw/actions/check_membership.cjs'); - await main(); - - name: Check command position - id: check_command_position - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - GH_AW_COMMANDS: "[\"deeptest\"]" - with: - script: | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('/opt/gh-aw/actions/check_command_position.cjs'); - await main(); - safe_outputs: needs: - activation @@ -1199,7 +1077,7 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Setup Scripts - uses: githubnext/gh-aw/actions/setup@v0.38.2 + uses: githubnext/gh-aw/actions/setup@v0.38.4 with: destination: /opt/gh-aw/actions - name: Download agent output artifact @@ -1262,7 +1140,7 @@ jobs: permissions: {} steps: - name: Setup Scripts - uses: githubnext/gh-aw/actions/setup@v0.38.2 + uses: githubnext/gh-aw/actions/setup@v0.38.4 with: destination: /opt/gh-aw/actions - name: Download cache-memory artifact (default) diff --git a/.github/workflows/deeptest.md b/.github/workflows/deeptest.md index c9b66411d..79d3a6f94 100644 --- a/.github/workflows/deeptest.md +++ b/.github/workflows/deeptest.md @@ -12,9 +12,6 @@ on: description: 'Issue number to link the generated tests to (optional)' required: false type: string - slash_command: - name: deeptest - events: [issues, issue_comment, pull_request, pull_request_comment] permissions: read-all @@ -59,8 +56,6 @@ You are the DeepTest agent for the Z3 theorem prover repository. **Issue number** (if linked): ${{ github.event.inputs.issue_number }} -If triggered by a slash command (`/deeptest`), extract the file path from the issue or comment text. - ## Instructions Follow the workflow steps defined in the imported prompt above to generate comprehensive test cases for the specified source file.