Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: github_branch_proctection status checks with matrix values don't work as documented #2417

Open
1 task done
joscha opened this issue Oct 9, 2024 · 0 comments
Open
1 task done
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@joscha
Copy link

joscha commented Oct 9, 2024

Expected Behavior

The documentation:

For workflows that use matrixes, append the matrix name to the value using the following pattern `(<matrix_value>[, <matrix_value>])`. Matrixes should be specified based on the order of matrix properties in the workflow file. See [GitHub Documentation]("https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#using-a-matrix-strategy") for more information.

i.e.:

For workflows that use matrixes, append the matrix name to the value using the following pattern (<matrix_value>[, <matrix_value>])

suggests that for a workflow file looking like this:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        avsc: [5.7.x, 6.0.0-alpha.14]
    steps:

(see actual file here)

something like this:

  required_status_checks {
    strict   = true
    contexts = ["build (5.7.x, 6.0.0-alpha.14)", "npm"]
  }

should produce status checks for each of the matrix items, but it doesn't.

Only specifying it like this:

  required_status_checks {
    strict   = true
    contexts = ["build (5.7.x)", "build (6.0.0-alpha.14)", "npm"]
  }

produces two separate required checks correctly.

I have tried finding the code that supposedly handles the special matrix notation, but couldn't find so in 5809617. Nor can I find it in the history or any other issues or mention of matrix related to it anywhere in the codebase.

If I am holding it wrong, please take my apologies. If you could point me to the code handling this special case, that would be great, too.

Actual Behavior

It produces a required status check that verbatim requires a name with all matrix values, which is never fulfilled.

Terraform Version

Terraform 1.9.7 on Mac OS 14.6.1 (23G93) with terraform-provider-github 6.2.1

Affected Resource(s)

  • github_branch_proctection

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

# github_branch_protection.avsc-zstandard-codec-main will be updated in-place
  ~ resource "github_branch_protection" "avsc-zstandard-codec-main" {
        id                              = "BPR_kwDOMyV5ps4DPyW7"
        # (10 unchanged attributes hidden)

      ~ required_status_checks {
          ~ contexts = [
              - "build (5.7.x)",
              + "build (5.7.x, 6.0.0-alpha.14)",
                # (1 unchanged element hidden)
            ]
            # (1 unchanged attribute hidden)
        }
    }

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@joscha joscha added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Oct 9, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

2 participants