Skip to content

Test Fix: TestAccEventGridEventSubscription_userIdentity #621

Test Fix: TestAccEventGridEventSubscription_userIdentity

Test Fix: TestAccEventGridEventSubscription_userIdentity #621

---
name: Combined PR Checks
# All PR checks are combined into this single workflow as jobs, sharing one
# paths-filter so each only runs when relevant files change. A check lives here
# unless it *can't*: needing a special runner, OIDC auth, or its own trigger
# moves it to a standalone pr-check-* workflow instead.
# Display name is matched by the workflow_run list in pr-waiting-response-on-ci-fail.yaml.
# The check jobs are mirrored in main-checks.yaml (which re-runs them on pushes
# to main) — keep the two in sync when adding or changing a check.
permissions:
contents: read
pull-requests: write
issues: write
on:
pull_request:
types: ['opened', 'synchronize', 'reopened']
concurrency:
group: 'pr-checks-combined-${{ github.event.pull_request.number || github.run_id }}'
cancel-in-progress: true
jobs:
# ==========================================
# PATH FILTERING LOGIC
# ==========================================
# We use dorny/paths-filter to only run heavy checks when relevant files change.
#
# How to add a new Phase 1 job:
# 1. Add a new filter to the `paths-filter` job below.
# 2. In your job, add `needs: paths-filter` and `if: needs.paths-filter.outputs.<your-filter> == 'true'`.
#
# How to add a new Phase 2/3 job:
# 1. It must depend on paths-filter and ALL Phase 1 jobs it needs.
# 2. Because GitHub Actions skips downstream jobs if any `needs` dependency is skipped,
# you MUST use the following boilerplate `if` condition to ensure it runs correctly:
# if: |
# always() &&
# needs.paths-filter.outputs.<your-filter> == 'true' &&
# (needs.depscheck.result == 'success' || needs.depscheck.result == 'skipped') && ...
# ==========================================
paths-filter:
runs-on: ubuntu-latest
outputs:
website: ${{ steps.filter.outputs.website }}
go: ${{ steps.filter.outputs.go }}
scripts: ${{ steps.filter.outputs.scripts }}
examples: ${{ steps.filter.outputs.examples }}
vendor: ${{ steps.filter.outputs.vendor }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3
id: filter
with:
filters: |
website:
- 'website/**'
go:
- '**/*.go'
- 'go.mod'
- 'go.sum'
scripts:
- 'scripts/**'
- '**/*.sh'
examples:
- 'examples/**'
vendor:
- 'vendor/**'
- 'go.mod'
- 'go.sum'
# ==========================================
# Phase 1: Fail-Fast
# ==========================================
depscheck:
needs: paths-filter
if: needs.paths-filter.outputs.vendor == 'true' || needs.paths-filter.outputs.go == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ./.go-version
- run: make depscheck
- name: Guidance on failure
if: failure()
run: |
echo "::error::Vendor Dependencies Check failed."
echo ""
echo "Do not modify files in the vendor/ directory directly."
echo "Instead, update dependencies in go.mod and run 'go mod tidy && go mod vendor' to sync the vendor directory."
echo "Then run 'make depscheck' locally to verify before pushing."
depscheck-save-artifacts:
needs: depscheck
if: always() && needs.depscheck.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
depscheck-on-fail:
needs: depscheck
if: always() && needs.depscheck.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "Vendor Dependencies Check"
depscheck-on-success:
needs: depscheck
if: success() && needs.depscheck.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "Vendor Dependencies Check"
# ------------------------------------------
quick-checks:
needs: paths-filter
if: needs.paths-filter.outputs.go == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ./.go-version
- name: Install tooling
run: |
# golangci-lint version is sourced from scripts/.custom-gcl.yml - the single source of truth
GOLANGCI_LINT_VERSION="$(sed -n 's/^version: *//p' scripts/.custom-gcl.yml)"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b "$(go env GOPATH)/bin" "$GOLANGCI_LINT_VERSION"
go install github.com/katbyte/terrafmt@latest
- run: make quick-checks
- name: Guidance on failure
if: failure()
run: |
echo "::error::Quick CI Checks failed."
echo ""
echo "Run 'make quick-checks' locally to run the quick checks: formatting (gofmt/gofumpt)"
echo "and acceptance test terraform block formatting (terrafmt)."
echo "For formatting issues, 'make lint-fix' will fix them automatically."
quick-checks-save-artifacts:
needs: quick-checks
if: always() && needs.quick-checks.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
quick-checks-on-fail:
needs: quick-checks
if: always() && needs.quick-checks.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "Quick CI Checks"
quick-checks-on-success:
needs: quick-checks
if: success() && needs.quick-checks.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "Quick CI Checks"
# ------------------------------------------
shellcheck:
needs: paths-filter
if: needs.paths-filter.outputs.scripts == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- name: Run ShellCheck
run: make shellcheck
- name: Guidance on failure
if: failure()
run: |
echo "::error::ShellCheck failed."
echo ""
echo "Run 'make shellcheck' locally to check shell scripts for issues."
echo "ShellCheck identifies common shell scripting pitfalls and bugs."
echo "See https://www.shellcheck.net/wiki/ for explanations of each warning code."
shellcheck-save-artifacts:
needs: shellcheck
if: always() && needs.shellcheck.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
shellcheck-on-fail:
needs: shellcheck
if: always() && needs.shellcheck.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "ShellCheck Scripts"
shellcheck-on-success:
needs: shellcheck
if: success() && needs.shellcheck.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "ShellCheck Scripts"
# ------------------------------------------
website-lint:
needs: paths-filter
if: needs.paths-filter.outputs.website == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ./.go-version
- run: make tools
- run: make website-lint
- name: Guidance on failure
if: failure()
run: |
echo "::error::Website Linting failed."
echo ""
echo "Run 'make website-lint' locally."
echo "Check your documentation files under website/ for formatting or validation issues."
echo "Common issues include: missing required frontmatter fields, incorrect markdown formatting,"
echo "or mismatched resource documentation with the schema definition."
website-lint-save-artifacts:
needs: website-lint
if: always() && needs.website-lint.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
website-lint-on-fail:
needs: website-lint
if: always() && needs.website-lint.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "Website Linting"
website-lint-on-success:
needs: website-lint
if: success() && needs.website-lint.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "Website Linting"
# ------------------------------------------
document-validate:
runs-on: custom-linux-large
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: ./.go-version
- run: make document-validate
- name: Guidance on failure
if: failure()
run: |
echo "::error::Document Validation failed."
echo ""
echo "Run 'make document-validate' locally."
echo "Check your documentation files under website/ for formatting or validation issues against the resource schema."
document-validate-save-artifacts:
needs: document-validate
if: always() && needs.document-validate.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
document-validate-on-fail:
needs: document-validate
if: always() && needs.document-validate.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "Document Validation"
document-validate-on-success:
needs: document-validate
if: success()
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "Document Validation"
# ==========================================
# Phase 2 & 3: Heavy Checks
# ==========================================
build:
needs: [paths-filter, depscheck, quick-checks, shellcheck, website-lint, document-validate]
if: |
always() &&
needs.paths-filter.outputs.go == 'true' &&
(needs.depscheck.result == 'success' || needs.depscheck.result == 'skipped') &&
(needs.quick-checks.result == 'success' || needs.quick-checks.result == 'skipped') &&
(needs.shellcheck.result == 'success' || needs.shellcheck.result == 'skipped') &&
(needs.website-lint.result == 'success' || needs.website-lint.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ./.go-version
- name: Build Provider
run: go build -v -o /dev/null main.go
- name: Guidance on failure
if: failure()
run: |
echo "::error::GoLang Compilation failed."
echo ""
echo "Run 'go build' or 'make build' locally to identify compilation errors."
build-save-artifacts:
needs: build
if: always() && needs.build.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
build-on-fail:
needs: build
if: always() && needs.build.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "GoLang Compilation"
build-on-success:
needs: build
if: success() && needs.build.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "GoLang Compilation"
# ------------------------------------------
golangci-lint:
needs: [paths-filter, depscheck, quick-checks, shellcheck, website-lint, document-validate]
if: |
always() &&
needs.paths-filter.outputs.go == 'true' &&
(needs.depscheck.result == 'success' || needs.depscheck.result == 'skipped') &&
(needs.quick-checks.result == 'success' || needs.quick-checks.result == 'skipped') &&
(needs.shellcheck.result == 'success' || needs.shellcheck.result == 'skipped') &&
(needs.website-lint.result == 'success' || needs.website-lint.result == 'skipped')
runs-on: custom-linux-large
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ./.go-version
# The azproviderlint/tfproviderlint module plugins require a custom-built golangci-lint
# binary (see scripts/.custom-gcl.yml); cache it so it is only rebuilt when the plugin
# config (which pins the golangci-lint version) changes. The make target rebuilds the
# binary when it is missing or its version is stale.
- uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: scripts/golangci-with-modules
key: golangci-with-modules-${{ hashFiles('scripts/.custom-gcl.yml') }}
- name: Build golangci-lint with plugins
run: make golangci-with-modules
- name: Run golangci-lint
run: ./scripts/golangci-with-modules run -v ./...
- name: Guidance on failure
if: failure()
run: |
echo "::error::GoLangCI Linting failed."
echo ""
echo "Run the Go linter locally: make lint (builds ./scripts/golangci-with-modules with the azproviderlint/tfproviderlint plugins)"
echo "Fix any reported issues before pushing. Common issues include:"
echo " - Unused variables or imports"
echo " - Error return values not checked"
echo " - Formatting issues (run 'gofmt -w .')"
golangci-lint-save-artifacts:
needs: golangci-lint
if: always() && needs.golangci-lint.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
golangci-lint-on-fail:
needs: golangci-lint
if: always() && needs.golangci-lint.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "GoLangCI Linting"
golangci-lint-on-success:
needs: golangci-lint
if: success() && needs.golangci-lint.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "GoLangCI Linting"
# ------------------------------------------
gencheck:
needs: [paths-filter, depscheck, quick-checks, shellcheck, website-lint, document-validate]
if: |
always() &&
needs.paths-filter.outputs.go == 'true' &&
(needs.depscheck.result == 'success' || needs.depscheck.result == 'skipped') &&
(needs.quick-checks.result == 'success' || needs.quick-checks.result == 'skipped') &&
(needs.shellcheck.result == 'success' || needs.shellcheck.result == 'skipped') &&
(needs.website-lint.result == 'success' || needs.website-lint.result == 'skipped')
runs-on: custom-linux-large
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ./.go-version
- run: make gencheck
- name: Guidance on failure
if: failure()
run: |
echo "::error::Generation Check failed."
echo ""
echo "Run 'make generate' locally to regenerate auto-generated code, then commit the changes."
echo "This check ensures that generated files are up to date with their source definitions."
gencheck-save-artifacts:
needs: gencheck
if: always() && needs.gencheck.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
gencheck-on-fail:
needs: gencheck
if: always() && needs.gencheck.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "Generation Check"
gencheck-on-success:
needs: gencheck
if: success() && needs.gencheck.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "Generation Check"
# ------------------------------------------
unit-tests:
needs: [paths-filter, depscheck, quick-checks, shellcheck, website-lint, document-validate]
if: |
always() &&
needs.paths-filter.outputs.go == 'true' &&
(needs.depscheck.result == 'success' || needs.depscheck.result == 'skipped') &&
(needs.quick-checks.result == 'success' || needs.quick-checks.result == 'skipped') &&
(needs.shellcheck.result == 'success' || needs.shellcheck.result == 'skipped') &&
(needs.website-lint.result == 'success' || needs.website-lint.result == 'skipped')
runs-on: custom-linux-xl
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
cache-dependency-path: go.mod
go-version-file: ./.go-version
- name: '[Diagnostic] Report Go module cache and build cache disk usage'
run: 'du -h -d 0 $(go env GOMODCACHE) $(go env GOCACHE) || true'
- name: Install gotestsum
run: go install gotest.tools/gotestsum@v1.13.0
- name: Run tests
run: |
gotestsum \
--format pkgname-and-test-fails \
--format-hide-empty-pkg -- \
-timeout=30s \
-parallel=32 \
-run='^Test[^A]|^TestA[^c]|^TestAc[^c]' \
./...
- name: Guidance on failure
if: failure()
run: |
echo "::error::Unit Tests failed."
echo ""
echo "Run 'make test' locally to reproduce and fix the failing tests."
echo "If you have added a new resource or data source, ensure you have added"
echo "the corresponding unit tests. Check the test output above for details"
echo "on which tests failed and why."
unit-tests-save-artifacts:
needs: unit-tests
if: always() && needs.unit-tests.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
unit-tests-on-fail:
needs: unit-tests
if: always() && needs.unit-tests.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "Unit Tests"
unit-tests-on-success:
needs: unit-tests
if: success() && needs.unit-tests.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "Unit Tests"
# ------------------------------------------
validate-examples:
needs: [paths-filter, depscheck, quick-checks, shellcheck, website-lint, document-validate]
if: |
always() &&
needs.paths-filter.outputs.examples == 'true' &&
(needs.depscheck.result == 'success' || needs.depscheck.result == 'skipped') &&
(needs.quick-checks.result == 'success' || needs.quick-checks.result == 'skipped') &&
(needs.shellcheck.result == 'success' || needs.shellcheck.result == 'skipped') &&
(needs.website-lint.result == 'success' || needs.website-lint.result == 'skipped')
runs-on: custom-linux-small
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ./.go-version
- run: make tools
- run: make validate-examples
- name: Guidance on failure
if: failure()
run: |
echo "::error::Example Validation failed."
echo ""
echo "Run 'make validate-examples' locally to check that your example"
echo "Terraform configurations under examples/ are valid."
echo "Ensure all examples use valid HCL syntax and reference existing resources."
validate-examples-save-artifacts:
needs: validate-examples
if: always() && needs.validate-examples.result == 'failure'
uses: ./.github/workflows/pr-save-artifacts.yaml
validate-examples-on-fail:
needs: validate-examples
if: always() && needs.validate-examples.result == 'failure'
uses: ./.github/workflows/pr-comment-failure.yaml
with:
check_name: "Validate Examples"
validate-examples-on-success:
needs: validate-examples
if: success() && needs.validate-examples.result == 'success'
uses: ./.github/workflows/pr-comment-failure-outdated.yaml
with:
check_name: "Validate Examples"