Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 22, 2025

Problem

The test-proxy.md workflow was incorrectly configured to manually handle GitHub comment creation, which is unnecessary when using the output: issue_comment: {} mechanism. This resulted in:

  • Redundant create_comment tool permissions that weren't needed
  • Manual permission configuration instead of leveraging automatic handling
  • Missing inline PR number reference in reporting instructions

Solution

Updated the workflow to properly use the automatic comment creation mechanism:

Before:

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

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

After:

output:
  issue_comment: {}

tools:
  github:
    allowed:
      - "get_issue"

Key Changes

  1. Removed redundant create_comment tool: The output: issue_comment: {} mechanism automatically handles comment creation, making the manual tool unnecessary

  2. Automatic permission handling: Replaced manual permissions: issues: write with the output mechanism that automatically provides appropriate issues: write and pull-requests: write permissions only to the comment job

  3. Added inline PR number: Included ${{ github.event.pull_request.number }} in the reporting instructions for better context

  4. Cleaner architecture: The main workflow job no longer needs write permissions, improving security by following the principle of least privilege

Benefits

  • Simplified configuration: No need to manually configure GitHub API tools for commenting
  • Better security: Main job runs with minimal permissions; only the auto-generated comment job gets write access
  • Consistent behavior: Uses the same comment creation pattern as other workflows in the repository
  • Enhanced context: PR number is now included in the reporting template

The compiled workflow now generates a properly isolated create_issue_comment job that runs conditionally when there's output to share.


💡 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.

@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
@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.

@pelikhan
Copy link
Contributor

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

@Mossaka
Copy link
Collaborator

Mossaka commented Aug 26, 2025

@copilot can you resolve the comments above?

Copy link
Contributor Author

Copilot AI commented Aug 26, 2025

create_comment tool is not needed.

Removed create_comment from the allowed tools list. The output mechanism now handles comment creation automatically. Changes committed in 43102c4.

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

Added the inline PR number template ${{ github.event.pull_request.number }} in the reporting instructions as suggested. Changes committed in 43102c4.

@copilot can you resolve the comments above?

All comments have been addressed:

  1. Removed create_comment tool (no longer needed)
  2. Switched back to output: issue_comment: {} for automatic permission handling
  3. Added inline PR number template as suggested

The workflow now uses the output mechanism for automatic comment creation with proper permissions. Changes committed in 43102c4.

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-build38776856/b278/cli.test -test.testlogfile=/tmp/go-build38776856/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:

@Copilot Copilot AI changed the title Fix test-proxy.md to use PR comments instead of creating GitHub issues Fix test-proxy.md to use automatic comment creation instead of manual GitHub tools Aug 26, 2025
Copilot finished work on behalf of Mossaka August 26, 2025 15:37
Copilot AI and others added 3 commits August 27, 2025 12:00
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
…eview comments

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
@Mossaka Mossaka force-pushed the copilot/fix-e812dea1-4b76-47c2-bdc5-055f9d5a4d61 branch from 43102c4 to 6e0a957 Compare August 27, 2025 19:00
@Mossaka Mossaka requested a review from pelikhan August 27, 2025 19:01
@Mossaka Mossaka merged commit 551a025 into main Aug 27, 2025
11 checks passed
@Mossaka Mossaka deleted the copilot/fix-e812dea1-4b76-47c2-bdc5-055f9d5a4d61 branch August 27, 2025 19:09
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.

4 participants