Skip to content

fix: resolve inconsistent provider reply errors, add waitForEnvironme… - #28

Open
Vladislav Petrov (vkpetrov) wants to merge 1 commit into
nexthink-oss:mainfrom
vkpetrov:resolve-inconsistent-provider-reply-actions-env-variables
Open

fix: resolve inconsistent provider reply errors, add waitForEnvironme…#28
Vladislav Petrov (vkpetrov) wants to merge 1 commit into
nexthink-oss:mainfrom
vkpetrov:resolve-inconsistent-provider-reply-actions-env-variables

Conversation

@vkpetrov

Copy link
Copy Markdown

…ntVariableConsistency function and enhance environment variable creation tests


Before the change?

  • Managing GHA environment variables may result in inconsistent provider reply:
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to github_actions_environment_variable.example_vars["77"], provider "provider[\"registry.terraform.io/nexthink-oss/github\"]" produced an unexpected new value: Root object was present, but now absent.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

After the change?

  • Creating and changing GHA environment variables is stable and works as expected.

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Note: The bugfix is internal consistency handling after create for environment variables, with no schema/argument/import changes, so user-facing resource docs do not need updates.

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

…ntVariableConsistency function and enhance environment variable creation tests
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, we review contributions on a best-effort basis. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@vkpetrov

Copy link
Copy Markdown
Author

Hello Madhurjya Roy (@mroyme), Robin Breathe (@isometry), could you please review this PR? This is similar to #13.

In our organization, we manage a lot of GitHub Actions Environment Variables, and we are seeing the inconsistent reply errors from the provider. This PR addresses this issue.

This is the configuration that I tested with:

terraform {
  required_providers {
    github = {
      source  = "nexthink-oss/github"
      version = "7.0.3"
    }
    random = {
      source  = "hashicorp/random"
      version = "~> 3.6"
    }
  }
}

provider "github" {
  # provider configuration
}

resource "github_repository" "example" {
  name        = "example-repo-with-many-vars"
  description = "Reproduction repository for many actions variables"
  visibility  = "private"
}

resource "github_repository_environment" "example" {
  repository  = github_repository.example.name
  environment = "example-environment"
}

resource "random_string" "env_var_name_suffix" {
  for_each = toset([for i in range(100) : tostring(i)])

  length  = 12
  upper   = true
  lower   = false
  numeric = true
  special = false
}

resource "random_string" "env_var_value" {
  for_each = toset([for i in range(100) : tostring(i)])

  length  = 24
  upper   = true
  lower   = true
  numeric = true
  special = false
}

resource "github_actions_environment_variable" "example_vars" {
  for_each = toset([for i in range(100) : tostring(i)])

  repository    = github_repository.example.name
  environment   = github_repository_environment.example.environment
  variable_name = "VAR_${random_string.env_var_name_suffix[each.key].result}"
  value         = random_string.env_var_value[each.key].result
}

Please note that the issue is transient but is rather frequent. You may need to destroy and re-apply the configuration to reproduce the error.

Please let me know if there are any questions about this PR. Thank you!

@dyudin0821

Copy link
Copy Markdown

HI Madhurjya Roy (@mroyme), Robin Breathe (@isometry)

Could you please take a look at this PR when you have a chance?
This change is important for our workflow and currently blocks further adoption of this provider.

Happy to provide any additional details or make adjustments if needed.

@vkpetrov

Copy link
Copy Markdown
Author

Hello Madhurjya Roy (@mroyme), Robin Breathe (@isometry) - just checking in to see if you’ve had a chance to look at the proposed change. We’re still running into inconsistent behavior with GitHub actions variables, so getting this fix through would really help us out. Thanks!

@mroyme

Madhurjya Roy (mroyme) commented Apr 16, 2026

Copy link
Copy Markdown
Member

Vladislav Petrov (@vkpetrov) The changes themselves look good to me. I can see that it's the same as what you have done with https://github.com/nexthink-oss/terraform-provider-github/pull/13/changes.

That said, I'm no longer the maintainer of this project at Nexthink and my approval won't be enough to merge it.

This fork was created when GitHub had seemingly abandoned work on their official provider https://github.com/integrations/terraform-provider-github, but the situation has changed now and it's active again.

Afaik, we have been slowing down development on this and trying to get our contributions upstream. My recommendation would be to switch to the upstream provider, if possible.

I'm tagging Misha Kushakov (@mkushakov), who is the right person to talk to about the future of this project and to get this change approved and released, in case you can't move to the upstream provider.

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