Skip to content

[MAINT]: Add a CI workflow that runs terraform configuration validation on a generic config to ensure no regressions happen #2856

Description

@nickfloyd

Describe the need

In light of both #2843 and #2855 and the v6.7.x releases we need a way to continually validate that fundamental things such as secret destroy on drift workflows and other fundamental mechanisms of how the provider initializes don't regress.

ex.

 # Build validation
      - name: Build Provider
        run: |
          go build -o terraform-provider-github

      # Terraform validation with actual binary
      - name: Terraform Init and Validate
        run: |
          # Create test configuration
          cat > test.tf << 'EOF'
          terraform {
            required_providers {
              github = {
                source = "integrations/github"
              }
            }
          }
          
          provider "github" {
            token = "fake_token_for_validation"
          }
          
          # Test both resources with different configurations
          resource "github_actions_secret" "test" {
            repository       = "test_repo"
            secret_name      = "test_secret"
            plaintext_value  = "test_value"
            destroy_on_drift = true
          }
          
          resource "github_actions_organization_secret" "test" {
            secret_name     = "org_secret"
            encrypted_value = "dGVzdA=="
            visibility      = "private"
            destroy_on_drift = false
          }
          EOF
          
          # Setup dev overrides
          mkdir -p ~/.terraformrc
          cat > ~/.terraformrc << 'EOF'
          provider_installation {
            dev_overrides {
              "integrations/github" = "$(pwd)"
            }
            direct {}
          }
          EOF
          
          # Test with terraform (this should NOT fail with SDK validation errors)
          terraform init || echo "Init failed - expected for dev overrides"
          terraform validate
          
          # Clean up
          rm -f test.tf ~/.terraformrc terraform-provider-github

SDK Version

No response

API Version

No response

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Status: Triage
    on Nov 1, 2025
  2. added theissue type on Nov 1, 2025
  3. added
    Type: Maintenance
    on Nov 1, 2025
  4. ViacheslavKudinov commented on Nov 1, 2025

    @ViacheslavKudinov
    Contributor

    Hi @nickfloyd
    Do you mean something like https://github.com/vk-or/terraform-provider-github/pull/16/files ?
    Result of run https://github.com/vk-or/terraform-provider-github/actions/runs/19000886267 (just 2 copies of the same stack to test dynamic generation of matrix when we extend tests)

    Just POC, can be tuned according to the needs.

    Please, let me know if it is what is needed i will create PR.

    PS Im new to Go and Terraform provider SDK. Started to learn as hope can contribute to it.

  5. moved this from Backlog to In Progress in Terraform Provideron Nov 12, 2025
  6. ViacheslavKudinov commented on Nov 12, 2025

    @ViacheslavKudinov
    Contributor

    Hi,
    i've created PR #2887 to address it

  7. moved this from In Progress to Done in Terraform Provideron Nov 12, 2025
  8. ViacheslavKudinov commented on Nov 15, 2025

    @ViacheslavKudinov
    Contributor

    Hi @nickfloyd
    i suggest we run some validation on release workflow as well. As pre-job before release happens.

    It can be just definition of provider, without extra resources to not run unecessery tests.
    E.g:

    terraform {
      required_providers {
        github = {
          source = "integrations/github"
        }
      }
    }
    
    provider "github" {
      token = "fake_token_for_validation"
    }
    

    it is probably is enough to detect issue from #2903

    When i switch to the tag v6.8.2 and build and validate provider with test suite for secrets it fails, but build from current main passes the validation.

    Im not sure how it could happen to get this tag, but if we do validation before new release happens it should catch the issues in exactly commit which is tagged.

  9. moved this from Done to In Progress in Terraform Provideron Nov 15, 2025
  10. ViacheslavKudinov commented on Nov 15, 2025

    @ViacheslavKudinov
    Contributor

    I've created PR #2904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageType: Maintenance

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions