Skip to content

Fix test-proxy.md to use PR comments instead of creating GitHub issues #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 22, 2025

Problem

The test-proxy.md workflow was creating a new GitHub issue every time it ran, which clutters the repository with test result issues. This behavior was problematic because:

  • Issues were created on every workflow run (both successful and failed tests)
  • The issues didn't provide actionable feedback in the context where they were most useful
  • Repository maintainers had to manually close these automated test result issues

Solution

Updated the workflow to use the issue comment output processing instead of issue creation:

Before:

permissions:
  issues: write # needed to write the output report to an issue

tools:
  github:
    allowed:
      - "create_issue"
      - "create_comment"
      - "get_issue"

After:

output:
  issue_comment: {}

tools:
  github:
    allowed:
      - "create_comment"
      - "get_issue"

Key Changes

  1. Replaced issue creation with comment creation: Added output.issue_comment: {} to enable automatic comment creation on PRs instead of standalone issues

  2. Removed explicit permissions: The compiler now automatically handles permissions for the comment creation job, providing appropriate issues: write and pull-requests: write only to the comment job

  3. Updated reporting instructions: Modified the natural language prompt to focus on commenting when there are failures or notable issues, rather than always creating comprehensive reports

  4. Conditional execution: Comments are only created when the agent produces output and the workflow runs in a PR context

Benefits

  • Contextual feedback: Test results now appear as comments on the relevant PR where the changes are being reviewed
  • Reduced noise: No more standalone issues cluttering the repository
  • Conditional reporting: Comments are only created when there's meaningful output to share
  • Proper permissions: The main workflow job no longer needs write permissions, improving security

The compiled workflow now generates a create_issue_comment job that runs conditionally after the main test job, providing feedback directly where it's most useful.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build3766680747/b278/cli.test -test.testlogfile=/tmp/go-build3766680747/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build3299413574/b278/cli.test -test.testlogfile=/tmp/go-build3299413574/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Update the test-proxy.md to not create an GitHub issue every time it runs. It should comment if it failed to run. Once test-proxy.md is updated, run make recompile and git add the updated GitHub Action yaml file and commit Fix test-proxy.md to use PR comments instead of creating GitHub issues Aug 22, 2025
@Copilot Copilot AI requested a review from Mossaka August 22, 2025 23:11
Copilot finished work on behalf of Mossaka August 22, 2025 23:11
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
@Mossaka Mossaka marked this pull request as ready for review August 22, 2025 23:16
@pelikhan
Copy link
Contributor

create_comment tool is not needed.

@@ -21,7 +21,6 @@ tools:

github:
allowed:
- "create_issue"
- "create_comment"
Copy link
Contributor

Choose a reason for hiding this comment

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

remove since the output does this

Copy link
Contributor

Choose a reason for hiding this comment

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

issue: read permission

@pelikhan
Copy link
Contributor

You could win a turn by also inline the pr number in the template ${{ github.content.pull_request.number }}

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