From 40250bfcb8c37bd03db2574430a5459adc95d955 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 18:08:24 -0800 Subject: [PATCH] Change Code Conventions Analyzer to output to Discussions instead of Issues (#8163) * Initial plan * Change Code Conventions Analyzer to use Discussions instead of Issues 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> --- .../code-conventions-analyzer.lock.yml | 63 +++++++------------ .../workflows/code-conventions-analyzer.md | 17 ++--- 2 files changed, 30 insertions(+), 50 deletions(-) diff --git a/.github/workflows/code-conventions-analyzer.lock.yml b/.github/workflows/code-conventions-analyzer.lock.yml index f02b505f4..f91c11075 100644 --- a/.github/workflows/code-conventions-analyzer.lock.yml +++ b/.github/workflows/code-conventions-analyzer.lock.yml @@ -151,39 +151,25 @@ jobs: mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs cat > /opt/gh-aw/safeoutputs/config.json << 'EOF' - {"create_issue":{"max":1},"create_missing_tool_issue":{"max":1,"title_prefix":"[missing tool]"},"missing_data":{},"missing_tool":{},"noop":{"max":1}} + {"create_discussion":{"max":1},"create_missing_tool_issue":{"max":1,"title_prefix":"[missing tool]"},"missing_data":{},"missing_tool":{},"noop":{"max":1}} EOF cat > /opt/gh-aw/safeoutputs/tools.json << 'EOF' [ { - "description": "Create a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead. CONSTRAINTS: Maximum 1 issue(s) can be created. Title will be prefixed with \"Code Conventions Analysis\".", + "description": "Create a GitHub discussion for announcements, Q\u0026A, reports, status updates, or community conversations. Use this for content that benefits from threaded replies, doesn't require task tracking, or serves as documentation. For actionable work items that need assignment and status tracking, use create_issue instead. CONSTRAINTS: Maximum 1 discussion(s) can be created. Title will be prefixed with \"Code Conventions Analysis\". Discussions will be created in category \"General\".", "inputSchema": { "additionalProperties": false, "properties": { "body": { - "description": "Detailed issue description in Markdown. Do NOT repeat the title as a heading since it already appears as the issue's h1. Include context, reproduction steps, or acceptance criteria as appropriate.", + "description": "Discussion content in Markdown. Do NOT repeat the title as a heading since it already appears as the discussion's h1. Include all relevant context, findings, or questions.", "type": "string" }, - "labels": { - "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository.", - "items": { - "type": "string" - }, - "type": "array" - }, - "parent": { - "description": "Parent issue number for creating sub-issues. This is the numeric ID from the GitHub URL (e.g., 42 in github.com/owner/repo/issues/42). Can also be a temporary_id (e.g., 'aw_abc123def456') from a previously created issue in the same workflow run.", - "type": [ - "number", - "string" - ] - }, - "temporary_id": { - "description": "Unique temporary identifier for referencing this issue before it's created. Format: 'aw_' followed by 12 hex characters (e.g., 'aw_abc123def456'). Use '#aw_ID' in body text to reference other issues by their temporary_id; these are replaced with actual issue numbers after creation.", + "category": { + "description": "Discussion category by name (e.g., 'General'), slug (e.g., 'general'), or ID. If omitted, uses the first available category. Category must exist in the repository.", "type": "string" }, "title": { - "description": "Concise issue title summarizing the bug, feature, or task. The title appears as the main heading, so keep it brief and descriptive.", + "description": "Concise discussion title summarizing the topic. The title appears as the main heading, so keep it brief and descriptive.", "type": "string" } }, @@ -193,7 +179,7 @@ jobs: ], "type": "object" }, - "name": "create_issue" + "name": "create_discussion" }, { "description": "Report that a tool or capability needed to complete the task is not available. Use this when you cannot accomplish what was requested because the required functionality is missing or access is restricted.", @@ -242,7 +228,7 @@ jobs: EOF cat > /opt/gh-aw/safeoutputs/validation.json << 'EOF' { - "create_issue": { + "create_discussion": { "defaultMax": 1, "fields": { "body": { @@ -251,22 +237,15 @@ jobs: "sanitize": true, "maxLength": 65000 }, - "labels": { - "type": "array", - "itemType": "string", - "itemSanitize": true, - "itemMaxLength": 128 - }, - "parent": { - "issueOrPRNumber": true + "category": { + "type": "string", + "sanitize": true, + "maxLength": 128 }, "repo": { "type": "string", "maxLength": 256 }, - "temporary_id": { - "type": "string" - }, "title": { "required": true, "type": "string", @@ -537,14 +516,14 @@ jobs: - Identify which areas are most affected - Prioritize findings by impact and prevalence - ## Deliverable: Detailed Analysis Issue + ## Deliverable: Detailed Analysis Discussion - Create a comprehensive issue with your findings structured as follows: + Create a comprehensive discussion with your findings structured as follows: - ### Issue Title + ### Discussion Title "Code Conventions Analysis - [Date] - [Key Finding Summary]" - ### Issue Body Structure + ### Discussion Body Structure ```markdown # Code Conventions Analysis Report @@ -724,11 +703,11 @@ jobs: ## Output Requirements - - Create exactly ONE comprehensive issue with all findings + - Create exactly ONE comprehensive discussion with all findings - Use the structured format above - Include specific file references for all examples - Provide actionable recommendations - - Close any previous issues created by this workflow (using `close-older-issues: true`) + - Previous discussions created by this workflow will be automatically closed (using `close-older-discussions: true`) PROMPT_EOF - name: Append XPIA security instructions to prompt @@ -754,7 +733,7 @@ jobs: To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls. - **Available tools**: create_issue, missing_tool, noop + **Available tools**: create_discussion, missing_tool, noop **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped. @@ -1239,7 +1218,7 @@ jobs: runs-on: ubuntu-slim permissions: contents: read - issues: write + discussions: write timeout-minutes: 15 env: GH_AW_ENGINE_ID: "copilot" @@ -1269,7 +1248,7 @@ jobs: uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"expires\":14,\"max\":1,\"title_prefix\":\"Code Conventions Analysis\"}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_discussion\":{\"category\":\"General\",\"close_older_discussions\":true,\"expires\":168,\"max\":1,\"title_prefix\":\"Code Conventions Analysis\"}}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/code-conventions-analyzer.md b/.github/workflows/code-conventions-analyzer.md index b505f3f77..0f12ceb12 100644 --- a/.github/workflows/code-conventions-analyzer.md +++ b/.github/workflows/code-conventions-analyzer.md @@ -16,9 +16,10 @@ tools: - "git diff:*" - "git show:*" safe-outputs: - create-issue: + create-discussion: title-prefix: "Code Conventions Analysis" - expires: 14 + category: "General" + close-older-discussions: true missing-tool: create-issue: true network: defaults @@ -131,14 +132,14 @@ Look for patterns where Z3 could better leverage standard library features: - Identify which areas are most affected - Prioritize findings by impact and prevalence -## Deliverable: Detailed Analysis Issue +## Deliverable: Detailed Analysis Discussion -Create a comprehensive issue with your findings structured as follows: +Create a comprehensive discussion with your findings structured as follows: -### Issue Title +### Discussion Title "Code Conventions Analysis - [Date] - [Key Finding Summary]" -### Issue Body Structure +### Discussion Body Structure ```markdown # Code Conventions Analysis Report @@ -318,8 +319,8 @@ grep pattern: "^[ ]*enum [^c]" glob: "src/**/*.h" ## Output Requirements -- Create exactly ONE comprehensive issue with all findings +- Create exactly ONE comprehensive discussion with all findings - Use the structured format above - Include specific file references for all examples - Provide actionable recommendations -- Close any previous issues created by this workflow (using `close-older-issues: true`) +- Previous discussions created by this workflow will be automatically closed (using `close-older-discussions: true`)