Skip to content

fix: Remove invalid update of create_default_maintainer from import github_team_members#2126

Merged
kfcampbell merged 2 commits intointegrations:v6from
richjyoung:bugfix-team-members-import
Feb 13, 2024
Merged

fix: Remove invalid update of create_default_maintainer from import github_team_members#2126
kfcampbell merged 2 commits intointegrations:v6from
richjyoung:bugfix-team-members-import

Conversation

@richjyoung
Copy link
Copy Markdown
Contributor

Fixes bug where it is not possible to run terraform import against github_team_members resources in v6.0.0-beta.

Resolves #2124


Before the change?

  • github_team_members import reused the schema.ResourceImporter definition in resourceGithubTeamImport, which also defaults create_default_maintainer to false. create_default_maintainer is not part of the github_team_members schema so this fails the command with an error.

After the change?

  • Separated the import definitions and added a new function for github_team_members as resourceGithubTeamMembersImport, with the same getTeamID... based mapping.

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)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

…t_maintainers is not defined for members resource
@kfcampbell
Copy link
Copy Markdown
Contributor

@richjyoung this should be targeted at the v6 branch instead of main, right?

@richjyoung richjyoung changed the base branch from main to v6 February 6, 2024 09:43
@richjyoung
Copy link
Copy Markdown
Contributor Author

Sorry yes, have updated. It does look like the behaviour is unchanged from 5.45.0 though. This PR is the change I had to make to get the import to work properly in my local state so I can't say why this now causes the linked issue.

@nickfloyd nickfloyd requested a review from kfcampbell February 13, 2024 21:34
@nickfloyd nickfloyd added the Type: Bug Something isn't working as documented label Feb 13, 2024
@kfcampbell kfcampbell merged commit 194dc80 into integrations:v6 Feb 13, 2024
kfcampbell added a commit that referenced this pull request Feb 16, 2024
* Add retryable transport for errors (#1704)

* Add retryable transport for errors

In order to address the issue #210
I have added 3 new parameters to the provider

- retry_delay_ms
- max_retries
- retryable_errors

In case max_retries is > 0 (defaults to zero)
it will retry the request in case it is an error
the retryable_errors defaults to [500, 502, 503, 504]

It retries after the ms specified in retry_delay_ms (defaults to 1000)

* Update documentation with new parameters for retry

* Change default of max_retries to 3

* Fix typo in naming

* Update github/transport_test.go

* Add error check for data seek

* Consolidate the default retriable errors on a function

* Fix typo on the comments

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

* Update vendor

* Fix merging conflicts

* Update documentation with new parameters for retry

* Change default of max_retries to 3

* Fix typo in naming

* Add error check for data seek

* Update github/transport_test.go

* Consolidate the default retriable errors on a function

* Fix typo on the comments

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

* Don't run go mod tidy on release (#1788)

* Don't run go mod tidy on release

* Be more specific about releases

* Fix lint with APIMeta deprecation

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>

* fix: remove repository topic from state if it doesnt exist in GitHub anymore (#1918)

* remove repository topic if they cannot be found in GitHub anymore

* Fix build error by bumping package version in offending file

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

* Bump version to v6 (#2106)

* Upgrade to Terraform Plugin SDK v2 (#1780)

* go mod tidy -go=1.16 && go mod tidy -go=1.17

* Run go mod vendor

* Attempt v2 upgrade

* Plugin compiling

* Fix some provider test errors

* Fix test compilation error

* ValidateFunc --> ValidateDiagFunc

* Fix casing

* Sprinkle toDiagFunc everywhere

* More fixes for validation functions

* State --> StateContext

* %s --> %v when printing diags

* ConfigureFunc --> ConfigureContextFunc

* Checking results of d.Set, round one

* Continue checking d.Set results

* Check results of d.Set, round three

* Checking d.Set results, round four

* d.Set round five

* In tests, export GITHUB_TEST_ORGANIZATION

* Remove unnecessary MaxItems on computed value

* Go build now works

* Resolve linting errors

* Apply diag.FromErr twice more

* Pass key names into toDiagFunc helper

* Construct cty.Path from strings

* Tests now working

* Update terraform-plugin-sdk version

* Remove commented attribute setting in resource_github_team.go

* Fix restrict pushes on github_branch_protection. Fix branch protection tests (#2045)

* Update restrict pushes. Fix branch protection tests

Change blocks_creations default to true. Fix broken build.

* add state migration

* rename push_restrictions to push_allowances

* correct state migration issue

* add docs clarification

* update migration func args

* fix test args

* cleanup tests

* Pass context.Background() in test

* fix timestamp fields

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

* Set group_id correctly (#2133)

* Run go get -u github.com/golangci/golangci-lint

* Separate github_team_members import from github_team as create_default_maintainers is not defined for members resource (#2126)

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

* Add missing variable definition for test case

---------

Co-authored-by: Daniel França <github.t6297kgphp.dv@koderama.com>
Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
Co-authored-by: Felix Luthman <34520175+felixlut@users.noreply.github.com>
Co-authored-by: georgekaz <1391828+georgekaz@users.noreply.github.com>
Co-authored-by: Rich Young <richjyoung@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Error: Invalid address to set: []string{"create_default_maintainer"} trying to import github_team_members

3 participants