Skip to content

feat: add pr-auto-review.yml workflow (compliance automation Phase 2) - #355

Merged
don-petry merged 52 commits into
mainfrom
feat/add-pr-auto-review
Jun 1, 2026
Merged

feat: add pr-auto-review.yml workflow (compliance automation Phase 2)#355
don-petry merged 52 commits into
mainfrom
feat/add-pr-auto-review

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Deploy pr-auto-review.yml to enable automatic PR review triggering when CI completes.

Copilot AI review requested due to automatic review settings June 1, 2026 03:51
@don-petry
don-petry requested a review from a team as a code owner June 1, 2026 03:51
@don-petry
don-petry enabled auto-merge (squash) June 1, 2026 03:51
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 31 minutes and 13 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 148860ba-033c-42ef-b396-57f506634d89

📥 Commits

Reviewing files that changed from the base of the PR and between 3b06040 and 4dc298a.

📒 Files selected for processing (2)
  • .github/workflows/pr-auto-review.yml
  • .gitignore
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-pr-auto-review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b3cf03210

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/pr-auto-review.yml Outdated
Comment thread .github/workflows/pr-auto-review.yml
Comment thread .github/workflows/pr-auto-review.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitHub Actions workflow stub to trigger the org-level PR auto-review “readiness check” reusable workflow when CI and other relevant PR events complete.

Changes:

  • Introduces .github/workflows/pr-auto-review.yml as a thin caller to petry-projects/.github/.github/workflows/pr-auto-review-reusable.yml@v2.
  • Configures triggers for workflow_run, check_suite, pull_request_review, and pull_request events.
  • Sets minimal workflow/job permissions and passes the GH_PAT_WORKFLOWS secret through to the reusable workflow.

Comment thread .github/workflows/pr-auto-review.yml Outdated
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Lint/style

SonarCloud performs static analysis and enforces a Quality Gate on new code introduced in the PR. The diff adds .github/workflows/pr-auto-review.yml and appends a duplicate .dev-lead/ line to .gitignore (that entry already appears three times). SonarCloud likely flagged the duplicated .gitignore lines as a code smell and/or detected quality gate violations in the new YAML file (e.g. the unresolved TODO comment on line 38).

Suggested fix: Remove the three duplicate .dev-lead/ lines from .gitignore so only one entry remains, and replace the # TODO: replace "CI" inline comment with the actual workflow name for this repo before merging.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Lint/style

SonarCloud flagged the PR changes during static analysis. The diff introduces a new .github/workflows/pr-auto-review.yml file and duplicate .dev-lead/ entries in .gitignore. SonarCloud commonly fails when new files contain code smells, unresolved TODO comments, or when a quality gate threshold (e.g. maintainability rating, duplications) is breached — the TODO left in the workflow (# TODO: replace "CI" with your repository's CI workflow name(s).) is a likely trigger.

Suggested fix: Replace the placeholder workflows: ['CI'] in .github/workflows/pr-auto-review.yml with the actual CI workflow name used in this repo, and remove the duplicate .dev-lead/ lines from .gitignore to eliminate the redundancy finding.

View run logs

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Config error

The PR introduces two configuration issues that SonarCloud likely flagged. First, the .gitignore file now contains five duplicate .dev-lead/ entries (three pre-existing plus two new ones added in this diff), which SonarCloud treats as a code smell. Second, the new pr-auto-review.yml workflow file contains a hardcoded placeholder (workflows: ['CI']) with an inline TODO comment instructing callers to replace it — SonarCloud may flag the unresolved TODO or the placeholder value if it does not match any real workflow in the repository.

Suggested fix: Remove the four duplicate .dev-lead/ entries from .gitignore so only one remains, and replace the 'CI' placeholder in pr-auto-review.yml with the actual CI workflow name(s) used in this repository (e.g., 'SonarCloud Code Analysis' or whichever workflow triggers the readiness gate).

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Lint/style

SonarCloud flagged code quality issues introduced in this PR. The most visible problem is that .gitignore now contains six duplicate .dev-lead/ entries (three pre-existing plus three added by this PR), which SonarCloud treats as a code smell. Additionally, new files may have pushed the project below the configured quality gate thresholds (coverage, reliability, or maintainability rating) even if no direct bugs were introduced.

Suggested fix: Remove the duplicate .dev-lead/ lines from .gitignore so only one entry remains, then verify the SonarCloud dashboard for any additional gate failures (e.g. insufficient test coverage on the new workflow file) and address those before re-pushing.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Code Analysis (external quality gate)
Root cause: Lint/style

The .gitignore file has .dev-lead/ duplicated four additional times (lines 55–58), even though the entry already existed at line 54. SonarCloud flags repeated identical lines as a code smell/duplication issue, which causes the quality gate to fail. The new pr-auto-review.yml workflow file itself appears structurally sound.

Suggested fix: Remove the four duplicate .dev-lead/ lines added to .gitignore, leaving only the single pre-existing entry.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Code Analysis (external quality gate)
Root cause: Config error

SonarCloud has no GitHub Actions run ID to inspect — it operates as an external quality gate. The PR diff reveals two changes: (1) a new .github/workflows/pr-auto-review.yml calling a reusable workflow, and (2) five duplicate .dev-lead/ entries appended to .gitignore (the entry already existed three times). SonarCloud flags code duplication across the repository as part of its quality gate, and the accumulation of repeated lines in .gitignore likely tipped the gate over its configured duplication threshold.

Suggested fix: Remove the duplicate .dev-lead/ lines from .gitignore, leaving only a single occurrence, then re-push to re-trigger the SonarCloud analysis.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Config error

SonarCloud ran against this PR but no source-code changes were introduced — only a new GitHub Actions workflow YAML and duplicate .dev-lead/ entries appended to .gitignore (the line is repeated 10 times, likely from a repeated echo or merge artifact). Because SonarCloud has no meaningful delta to analyze and/or the project properties are not aligned with the repo, the quality gate cannot resolve cleanly. The duplicate .gitignore entries also indicate the commit may have been assembled incorrectly, which can confuse the SonarCloud branch-diff analysis.

Suggested fix: Remove the duplicate .dev-lead/ lines from .gitignore so only one entry remains, and verify that a valid sonar-project.properties (or equivalent sonar.projectKey configuration) exists at the repo root so SonarCloud can correctly resolve the project on each PR scan.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Lint/style

SonarCloud runs a quality gate against all new code introduced by the PR. The diff adds .github/workflows/pr-auto-review.yml and cleans up duplicate .dev-lead/ entries in .gitignore. SonarCloud may be flagging the new workflow file or associated source changes for quality-gate violations (e.g. code smells, duplications, or insufficient test coverage on new lines), causing the gate to fail.

Suggested fix: Visit the SonarCloud dashboard for this PR, identify the specific quality-gate condition that failed (coverage, duplications, or code smells), and address the flagged issues in the affected files before re-pushing.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Config error

The PR introduces a new GitHub Actions workflow YAML (.github/workflows/pr-auto-review.yml) but no application source code or test coverage. SonarCloud likely failed its Quality Gate because the project-level conditions (e.g. coverage, reliability rating, or security hotspot thresholds) were not met — either due to pre-existing issues now surfaced against the new analysis baseline, or because the reusable workflow file triggered a misconfigured project binding in SonarCloud.

Suggested fix: Check the SonarCloud project dashboard for petry-projects/google-app-scripts to identify which Quality Gate condition failed (coverage, bugs, vulnerabilities, or hotspots), then address the specific failing condition or exclude the YAML file from SonarCloud analysis via sonar.exclusions in sonar-project.properties.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Config error

SonarCloud ran analysis against this PR but the Quality Gate did not pass. Since the diff contains only a new GitHub Actions workflow YAML (.github/workflows/pr-auto-review.yml) and a .gitignore cleanup — no application source code — the failure is not caused by newly introduced bugs or coverage regressions. This typically means the SonarCloud project Quality Gate is either misconfigured (e.g., overly strict conditions that trigger on any PR) or the project has pre-existing gate violations that block every scan.

Suggested fix: Open the SonarCloud project dashboard, navigate to Administration → Quality Gate, and verify the gate conditions are scoped to "new code" only (not overall code) so that PRs touching only config/infra files are not blocked by pre-existing violations in application code.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Config error

SonarCloud ran analysis on this PR but the quality gate failed. The diff contains only a new GitHub Actions workflow YAML (.github/workflows/pr-auto-review.yml) and removal of duplicate .dev-lead/ lines from .gitignore — no application source code was changed. SonarCloud likely failed because the analysis found no qualifying source files to analyze (or a pre-existing quality gate condition such as coverage threshold was triggered), causing the gate to report a failure rather than a pass.

Suggested fix: Open the SonarCloud project dashboard, navigate to the quality gate configuration, and either ensure the gate allows PRs with no analyzable source changes to pass (e.g. add a "new code has no issues" bypass for config-only PRs), or verify the sonar-project.properties file includes correct sonar.sources and sonar.exclusions settings so YAML-only changes do not block the gate.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Env issue

SonarCloud Code Analysis is an external quality gate that requires a SONAR_TOKEN secret to authenticate and push analysis results. This PR introduces no JavaScript/TypeScript source code changes (only a new workflow YAML and .gitignore cleanup), so the most likely reason the check failed is that the SONAR_TOKEN secret is not configured for this repository or is expired/invalid — causing the analysis to fail before even reaching the quality gate evaluation.

Suggested fix: Verify that the SONAR_TOKEN secret is set in the repository settings under Settings → Secrets and variables → Actions, and that it matches a valid token from the SonarCloud project for petry-projects/google-app-scripts.

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Config error

SonarCloud triggered a full analysis scan on this PR and the quality gate failed. The PR introduces a new GitHub Actions workflow file (.github/workflows/pr-auto-review.yml) and cleans up duplicate .dev-lead/ entries from .gitignore. SonarCloud likely flagged pre-existing code quality issues, security hotspots, or coverage regressions surfaced by this scan — since the PR itself adds only YAML/config changes, the gate failure is most likely tied to project-level quality metrics falling below the configured threshold (e.g. coverage, duplication, or reliability rating).

Suggested fix: Visit the SonarCloud project dashboard for this repository, check the "Quality Gate" tab on the PR analysis, and address the specific issues listed (e.g. resolve any flagged security hotspots or bring code coverage back above the required threshold).

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: SonarCloud Quality Gate
Root cause: Config error

SonarCloud is an external quality gate that runs independently of GitHub Actions, so no workflow logs were available — analysis is based on the PR diff. The PR adds .github/workflows/pr-auto-review.yml (a new reusable-workflow caller) and removes ~34 duplicate .dev-lead/ entries from .gitignore. SonarCloud quality gates commonly fail when new code causes reliability, security, or maintainability ratings to breach a configured threshold — even for YAML/config-only changes if the project scans them.

Suggested fix: Open the SonarCloud project dashboard, navigate to the Activity → Quality Gate tab for this PR branch, and address the specific rule violation(s) listed there (or, if the gate is misconfigured for non-source files, exclude .github/ from the SonarCloud analysis scope in sonar-project.properties).

View run logs

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: Quality Gate
Root cause: Lint/style

SonarCloud flagged 1 Security Hotspot introduced by this PR. The new .github/workflows/pr-auto-review.yml file passes secrets.GH_PAT_WORKFLOWS (a Personal Access Token) directly to a reusable workflow via the secrets: block — SonarCloud flags PAT forwarding patterns as security hotspots because a compromised or overly-scoped token can allow privilege escalation across the org. This is a static analysis finding, not a runtime error.

Suggested fix: Open the SonarCloud Security Hotspots tab for this PR, review the flagged hotspot, and either mark it as "Acknowledged" (if the PAT usage is intentional and scoped correctly) or replace GH_PAT_WORKFLOWS with a fine-grained token that has only the minimum required permissions.

View analysis details on SonarQube Cloud

@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dc298acf2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to +54
if: >
(github.event_name != 'pull_request' && github.event_name != 'pull_request_review') ||
github.event.pull_request.head.repo.fork == false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip Dependabot PR events before using secrets

For pull_request events opened or synchronized by Dependabot, this fork-only guard still lets same-repo Dependabot PRs call the reusable workflow, but GitHub treats Dependabot-triggered pull_request workflows like forked PRs and withholds normal Actions secrets (see GitHub's Dependabot on Actions docs). In that scenario GH_PAT_WORKFLOWS is empty, so the reusable's API calls fail instead of cleanly waiting for a privileged trigger; either skip github.actor == 'dependabot[bot]' here or provide an identically named Dependabot secret.

Useful? React with 👍 / 👎.

@don-petry
don-petry merged commit ed75ad5 into main Jun 1, 2026
28 of 31 checks passed
@don-petry
don-petry deleted the feat/add-pr-auto-review branch June 1, 2026 12:18
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

CI Failure: SonarCloud Code Analysis

Step: Quality Gate
Root cause: Lint/style

SonarCloud flagged 21 new Security Hotspots introduced by this PR, causing the Quality Gate to fail. Security Hotspots are code patterns that require a manual security review — they are not confirmed vulnerabilities but areas where insecure usage is possible (e.g. hardcoded credentials, unsafe regex, unvalidated inputs, or permissive GitHub Actions workflow permissions). The newly added .github/workflows/pr-auto-review.yml workflow file is a likely contributor, as SonarCloud actively analyzes workflow files for overly broad permissions: blocks and other CI-specific security patterns.

Suggested fix: Open the SonarCloud Security Hotspots dashboard for this branch, review each of the 21 hotspots, and either mark them as "Safe" with a justification or remediate the flagged patterns (e.g. tighten permissions: scopes in the new workflow to least-privilege).

View analysis details on SonarQube Cloud

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