Skip to content

workflow: close PRs with failing CI#31810

Merged
katbyte merged 12 commits intomainfrom
kt/close-failing-ci-prs
Mar 31, 2026
Merged

workflow: close PRs with failing CI#31810
katbyte merged 12 commits intomainfrom
kt/close-failing-ci-prs

Conversation

@katbyte
Copy link
Copy Markdown
Collaborator

@katbyte katbyte commented Feb 24, 2026

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

This PR:

  1. Adding the close-failing-ci-prs workflow and script to automatically manage PRs with persistently failing CI — warning authors after 7 days and closing PRs after 14 days of continuous CI failures.
  2. Adding actionable failure guidance to all CI workflow checks and PR comments so contributors can quickly understand and fix issues.
  3. Fixing deprecated code patterns flagged by the gradually-deprecated check to reduce false positives.

Close Failing CI PRs

  • New close-failing-ci-prs.yaml workflow that runs on a schedule to identify open PRs with failing CI.
  • New [close-failing-ci-prs.sh] script that:
    • Checks the CI status of each open PR's head commit
    • Posts a warning comment after 7 days of continuous CI failure with specific failing check names and guidance on how to fix each one
    • Closes PRs after 14 days of continuous CI failure with a closing comment
    • Applies a ci-failing label to affected PRs
    • Uses jq for safe JSON payload generation to prevent issues with special characters

CI Workflow Guidance

Every CI workflow now includes a Guidance on failure step (if: failure()) that outputs ::error:: annotations with specific instructions on how to reproduce and fix the failure locally. This covers all 13 CI checks:

  • Vendor Dependencies Check, Website Linting, Generation Check, GoLang Linting, Terraform Schema Linting, Unit Tests, ShellCheck Scripts, Validate Examples, 32 Bit Build, Breaking Schema Changes, Static Analysis, Check for new usages of deprecated functionality, Preview API Version Linter

The shared comment-failure.yaml reusable workflow was also updated to include per-check guidance in the PR comment (using github.workflow to identify the caller), so contributors see actionable fix instructions directly on the PR.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them.
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally.

Testing

  • Build passes (go build ./internal/services/...)
  • Verified 0 remaining os.Getenv("ARM_CLIENT_ID"), os.Getenv("ARM_CLIENT_SECRET"), or os.Getenv("ARM_CLIENT_SECRET_ALT") in internal/services/
  • Verified 0 remaining d.SetId(* in internal/services/
  • close-failing-ci-prs.sh script tested against shellcheck

Change Log

  • ci - added close-failing-ci-prs workflow and script to warn and close PRs with persistently failing CI [GH-00000]
  • ci - added failure guidance steps to all CI workflow checks to help contributors fix issues [GH-00000]
  • ci - updated comment-failure.yaml with per-check guidance in PR failure comments [GH-00000]
  • azurerm_app_service_custom_hostname_binding - replaced deprecated d.SetId(*read.ID) with pointer.From [GH-00000]
  • tests - replaced os.Getenv("ARM_CLIENT_*") with data.Client() in 10 test files to avoid gradually-deprecated false positives [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature
  • Enhancement
  • Breaking Change

Related Issue(s)

N/A - Internal improvement

AI Assistance Disclosure

  • AI Assisted - This contribution was made by, or with the assistance of, AI/LLMs

AI assistance was used for code generation and refactoring across the CI workflow files, shell scripts, and test files.

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Changes to Security Controls

No changes to security controls.

Copy link
Copy Markdown
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks @katbyte - Aside from the merge conflict, can you take a look at the few comments below?

katbyte and others added 2 commits March 18, 2026 07:36
Co-authored-by: jackofallops <11830746+jackofallops@users.noreply.github.com>
Copy link
Copy Markdown
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks @katbyte - After the merge conflicts are resolved, I think this is good to go!

@katbyte katbyte merged commit bae77b0 into main Mar 31, 2026
50 checks passed
@katbyte katbyte deleted the kt/close-failing-ci-prs branch March 31, 2026 01:48
@github-actions github-actions bot added this to the v4.67.0 milestone Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants