From 6a489bafd2eb814aa137be5c3c19da46b84be98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ab=C3=ADlio=20Costa?= Date: Fri, 2 Oct 2026 07:34:40 +0100 Subject: [PATCH] Use notice messages for quality scale agentic workflow (#183939) --- .github/workflows/quality-scale-reviewer.lock.yml | 11 +++++++---- .github/workflows/quality-scale-reviewer.md | 7 +++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/quality-scale-reviewer.lock.yml b/.github/workflows/quality-scale-reviewer.lock.yml index e493c39ba534..a8dd82c0d7ea 100644 --- a/.github/workflows/quality-scale-reviewer.lock.yml +++ b/.github/workflows/quality-scale-reviewer.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"710af61b6752f476827010bb990199982eafe32c14864b22b2017f1069aad85f","body_hash":"f6010b65a1ac630fd88424981057d7b0472d1cc7d26860ad21d3d5d85cea66b6","compiler_version":"v0.88.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.80"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"8b8a787d22dae1d55df9427f81e36b6982253ff5c4f72d20c1f5c90075be07f3","body_hash":"f6010b65a1ac630fd88424981057d7b0472d1cc7d26860ad21d3d5d85cea66b6","compiler_version":"v0.88.2","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.80"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_DEFAULT_OTLP_HEADERS","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-python","sha":"5fda3b95a4ea91299a34e894583c3862153e4b97","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"9271a1804551c0dc4fb0085a97979950aa2f8489","version":"v0.88.2"}],"skills":[".claude/skills/ha-quality-scale-verify"],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.28.12","digest":"sha256:390051be4ed1847f774fd8980b61d3a3523574c0175d00c3fc7cdf2002a88202","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.28.12@sha256:390051be4ed1847f774fd8980b61d3a3523574c0175d00c3fc7cdf2002a88202"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.28.12","digest":"sha256:d7d533d87c80d87ff91ac0e21e9299055c3beedff1536262b97ed700fb065a32","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.28.12@sha256:d7d533d87c80d87ff91ac0e21e9299055c3beedff1536262b97ed700fb065a32"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.28.12","digest":"sha256:5250629d48eaedfedf2e948785228e8da29eec2a83cbab58ea0751c14a7b021d","pinned_image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.28.12@sha256:5250629d48eaedfedf2e948785228e8da29eec2a83cbab58ea0751c14a7b021d"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.28.12","digest":"sha256:52c34aca98d2a6833c329f1505912a6949c4fda16618c010c979bd59ea99254f","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.28.12@sha256:52c34aca98d2a6833c329f1505912a6949c4fda16618c010c979bd59ea99254f"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.15","digest":"sha256:60cd97533e93d8e7be36b979c0f08a70846189bda6190f28bbd6d427bc0d9b6e","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.15@sha256:60cd97533e93d8e7be36b979c0f08a70846189bda6190f28bbd6d427bc0d9b6e"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:bac2192f6374d6262116399b34fc5e143d576f82719e90a18261cae7480f4d4e","pinned_image":"ghcr.io/github/gh-aw-node@sha256:bac2192f6374d6262116399b34fc5e143d576f82719e90a18261cae7480f4d4e"},{"image":"ghcr.io/github/github-mcp-server:v1.11.0","digest":"sha256:fbec75de11c255213fa08d80fb166abe73d851fff631c51c0079872967720699","pinned_image":"ghcr.io/github/github-mcp-server:v1.11.0@sha256:fbec75de11c255213fa08d80fb166abe73d851fff631c51c0079872967720699"}],"mcp_servers":[{"name":"safeoutputs","tools":["create_pull_request_review_comment","missing_data","missing_tool","noop"]}]} # This file was automatically generated by gh-aw (v0.88.2). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -520,7 +520,7 @@ jobs: HEAD_SHA: ${{ needs.prepare.outputs.head_sha }} PR_NUMBER: ${{ needs.prepare.outputs.pr_number }} name: Check out the pull request head - run: "set -euo pipefail\nBASE_SHA=$(git rev-parse HEAD)\ngit fetch --depth=1 origin \"refs/pull/${PR_NUMBER}/head\"\n# The prepared diff describes HEAD_SHA; a newer push requires its own workflow run to be reviewed.\nif [ \"$(git rev-parse FETCH_HEAD)\" != \"${HEAD_SHA}\" ]; then\n echo \"PR #${PR_NUMBER} head moved since preparation, aborting\"\n exit 1\nfi\ngit checkout --detach \"${HEAD_SHA}\"\n# Agent configuration must come from the trusted default branch, not from the PR.\n# Copilot CLI loads instructions from Markdown files in many locations, so every .md is reset.\ngit diff -z --name-only --no-renames \"${BASE_SHA}\" FETCH_HEAD -- '*.md' \\\n | while IFS= read -r -d '' path; do\n rm -rf \"${path}\"\n git checkout \"${BASE_SHA}\" -- \"${path}\" 2>/dev/null || true\n done\nfor path in .github .agents .claude .codex .gemini .pi; do\n rm -rf \"${path}\"\n git checkout \"${BASE_SHA}\" -- \"${path}\" 2>/dev/null || true\ndone\nrm -f .mcp.json\n# Only the skill from the frontmatter is in scope for the agent.\nfind .claude/skills -mindepth 1 -maxdepth 1 ! -name ha-quality-scale-verify -exec rm -rf {} +" + run: "set -euo pipefail\nBASE_SHA=$(git rev-parse HEAD)\ngit fetch --depth=1 origin \"refs/pull/${PR_NUMBER}/head\"\n# The prepared diff describes HEAD_SHA; a newer push requires its own workflow run to be reviewed.\nif [ \"$(git rev-parse FETCH_HEAD)\" != \"${HEAD_SHA}\" ]; then\n echo \"::error title=Quality scale review aborted::PR #${PR_NUMBER} head moved since preparation, aborting\"\n exit 1\nfi\ngit checkout --detach \"${HEAD_SHA}\"\n# Agent configuration must come from the trusted default branch, not from the PR.\n# Copilot CLI loads instructions from Markdown files in many locations, so every .md is reset.\ngit diff -z --name-only --no-renames \"${BASE_SHA}\" FETCH_HEAD -- '*.md' \\\n | while IFS= read -r -d '' path; do\n rm -rf \"${path}\"\n git checkout \"${BASE_SHA}\" -- \"${path}\" 2>/dev/null || true\n done\nfor path in .github .agents .claude .codex .gemini .pi; do\n rm -rf \"${path}\"\n git checkout \"${BASE_SHA}\" -- \"${path}\" 2>/dev/null || true\ndone\nrm -f .mcp.json\n# Only the skill from the frontmatter is in scope for the agent.\nfind .claude/skills -mindepth 1 -maxdepth 1 ! -name ha-quality-scale-verify -exec rm -rf {} +" - name: Configure Git credentials env: @@ -1779,7 +1779,7 @@ jobs: '[.[] | select(.state == "open" and .base.repo.full_name == $base and .head.sha == $sha and .head.repo.full_name == $repo and .draft == false) | .number]') COUNT=$(jq 'length' <<< "${MATCHES}") if [ "${COUNT}" -ne 1 ]; then - echo "Expected one open, non-draft pull request for ${HEAD_REPO}@${HEAD_SHA}, found ${COUNT}: ${MATCHES}" + echo "::notice title=Quality scale review skipped::Expected one open, non-draft pull request for ${HEAD_REPO}@${HEAD_SHA}, found ${COUNT}: ${MATCHES}" echo "skip=true" >> "${GITHUB_OUTPUT}" exit 0 fi @@ -1824,6 +1824,9 @@ jobs: echo "pr_number=${PR_NUMBER}" echo "head_sha=$(jq -r '.head_sha' "${RESULTS}")" } >> "${GITHUB_OUTPUT}" + if [ "$(jq -r '.skip' "${RESULTS}")" = "true" ]; then + echo "::notice title=Quality scale review skipped::PR #${PR_NUMBER} $(jq -r '.skip_reason' "${RESULTS}")" + fi env: PR_NUMBER: ${{ steps.pr.outputs.pr_number }} PR_SKIP: ${{ steps.pr.outputs.skip }} @@ -1833,7 +1836,7 @@ jobs: set -euo pipefail MARKER='' if gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" --paginate --jq '.[].body' \ - | grep -qF "${MARKER}"; then + | grep -F "${MARKER}" >/dev/null; then echo "Comment already posted on PR #${PR_NUMBER}" exit 0 fi diff --git a/.github/workflows/quality-scale-reviewer.md b/.github/workflows/quality-scale-reviewer.md index 612b3eaf06f4..77de489d4727 100644 --- a/.github/workflows/quality-scale-reviewer.md +++ b/.github/workflows/quality-scale-reviewer.md @@ -107,7 +107,7 @@ jobs: '[.[] | select(.state == "open" and .base.repo.full_name == $base and .head.sha == $sha and .head.repo.full_name == $repo and .draft == false) | .number]') COUNT=$(jq 'length' <<< "${MATCHES}") if [ "${COUNT}" -ne 1 ]; then - echo "Expected one open, non-draft pull request for ${HEAD_REPO}@${HEAD_SHA}, found ${COUNT}: ${MATCHES}" + echo "::notice title=Quality scale review skipped::Expected one open, non-draft pull request for ${HEAD_REPO}@${HEAD_SHA}, found ${COUNT}: ${MATCHES}" echo "skip=true" >> "${GITHUB_OUTPUT}" exit 0 fi @@ -149,6 +149,9 @@ jobs: echo "pr_number=${PR_NUMBER}" echo "head_sha=$(jq -r '.head_sha' "${RESULTS}")" } >> "${GITHUB_OUTPUT}" + if [ "$(jq -r '.skip' "${RESULTS}")" = "true" ]; then + echo "::notice title=Quality scale review skipped::PR #${PR_NUMBER} $(jq -r '.skip_reason' "${RESULTS}")" + fi - name: Comment that the pull request is too long to review if: steps.prepare.outputs.too_long == 'true' env: @@ -195,7 +198,7 @@ steps: git fetch --depth=1 origin "refs/pull/${PR_NUMBER}/head" # The prepared diff describes HEAD_SHA; a newer push requires its own workflow run to be reviewed. if [ "$(git rev-parse FETCH_HEAD)" != "${HEAD_SHA}" ]; then - echo "PR #${PR_NUMBER} head moved since preparation, aborting" + echo "::error title=Quality scale review aborted::PR #${PR_NUMBER} head moved since preparation, aborting" exit 1 fi git checkout --detach "${HEAD_SHA}"