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

tf-provider: fix bool option on gitlab token #40283

Merged
merged 7 commits into from
May 10, 2024
Merged

Conversation

hugoShaka
Copy link
Contributor

@hugoShaka hugoShaka commented Apr 5, 2024

Fixes the broken bool options on the provisioning token in allow rules.

This cannot be made on every resource yet because this is a breaking change for some roles.

This is a temporary fix, the proper way to fix it is doing a v16 breaking change. We need to do this hack today to unblock a large customer.

changelog: fix a bug in the Terraform provider causing the Provision Token boolean options to default to false instead of empty.

@hugoShaka hugoShaka requested a review from strideynet April 5, 2024 18:25
@hugoShaka hugoShaka marked this pull request as draft April 5, 2024 18:25
Copy link

github-actions bot commented Apr 5, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Copy link
Contributor

@strideynet strideynet left a comment

Choose a reason for hiding this comment

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

Generally looks good - I'll hold off reviewing properly until this is undrafted.

@hugoShaka hugoShaka force-pushed the hugo/vendor-terraform-provider branch from 36a28a0 to b1e30bc Compare April 9, 2024 23:30
Base automatically changed from hugo/vendor-terraform-provider to master April 10, 2024 05:32
@hugoShaka hugoShaka force-pushed the hugo/fix-gitlab-token branch from 142085b to edc33fb Compare May 3, 2024 15:41
@hugoShaka hugoShaka requested a review from strideynet May 3, 2024 19:32
@hugoShaka hugoShaka marked this pull request as ready for review May 3, 2024 19:32
Copy link

github-actions bot commented May 3, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Copy link
Contributor

@tigrato tigrato left a comment

Choose a reason for hiding this comment

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

YOLO

Copy link
Contributor

@strideynet strideynet left a comment

Choose a reason for hiding this comment

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

Thank you for sorting this

resource.TestCheckResourceAttr(name, "metadata.name", "gitlab-test-terraform"),
resource.TestCheckResourceAttr(name, "spec.roles.0", "Bot"),
resource.TestCheckResourceAttr(name, "spec.join_method", "gitlab"),
resource.TestCheckNoResourceAttr(name, "spec.gitlab.allow.0.environment_protected"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to make sure that this is working properly for when it is set, could we add:

ref_protected = true

to the fixture, and

resource.TestCheckResourceAttr(name, "spec.gitlab.allow.0.ref_protected", "true")

to the test checks.

@hugoShaka hugoShaka added this pull request to the merge queue May 10, 2024
Merged via the queue into master with commit 46cbb50 May 10, 2024
41 checks passed
@hugoShaka hugoShaka deleted the hugo/fix-gitlab-token branch May 10, 2024 16:10
@public-teleport-github-review-bot

@hugoShaka See the table below for backport results.

Branch Result
branch/v15 Failed

hugoShaka added a commit that referenced this pull request May 10, 2024
* Add BoolOptionNullable type for token

* Address noah's comment

* add more tests to check if we can set then unset the value

* lint

* lint pt.2

* lint pt.3
github-merge-queue bot pushed a commit that referenced this pull request May 13, 2024
* tf-provider: fix bool option on gitlab token (#40283)

* Add BoolOptionNullable type for token

* Address noah's comment

* add more tests to check if we can set then unset the value

* lint

* lint pt.2

* lint pt.3

* lint
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.

4 participants