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

Improve github team resource #1722

Merged
merged 2 commits into from
Jun 20, 2023
Merged

Conversation

bpaquet
Copy link
Contributor

@bpaquet bpaquet commented Jun 12, 2023

Fix various issue with the github_team resource

  • During import, set create_default_maintainer to false to avoid a diff in the resource. This parameter is not used outside of the Create method
  • Improve the handling of parent_team_id. This parameter is complicated to manage because it can be an ID or a slug, and the current behaviour is not correct (no cast from Int to String when the parameter is Set in the Read function). A cleaner way to do things is to have two parameters parent_team_id and parent_team_slug for example. But I do not want to introduce compatibility issues, so that's why this PR
    • Cast the ID to string when the Read function set it
    • Create two new computed params, which store the slug name and the ID in two different parameters
    • Ignore diff on parent_team_id if this paremeter match one of the two low level params.

With these modifications, I'm able to import a team, with a parent id, and having no diff in a following plan.

Integration tests are still green.

Copy link
Member

@kfcampbell kfcampbell 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 @bpaquet! Confirming all integration tests are passing for me as well.

@kfcampbell kfcampbell merged commit f5c8a7a into integrations:main Jun 20, 2023
doonga referenced this pull request in doonga/greyrock-ops Jun 23, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github](https://registry.terraform.io/providers/integrations/github)
([source](https://togithub.com/integrations/terraform-provider-github))
| required_provider | patch | `5.28.0` -> `5.28.1` |

---

### Release Notes

<details>
<summary>integrations/terraform-provider-github (github)</summary>

###
[`v5.28.1`](https://togithub.com/integrations/terraform-provider-github/releases/tag/v5.28.1)

[Compare
Source](https://togithub.com/integrations/terraform-provider-github/compare/v5.28.0...v5.28.1)

#### What's Changed

- build(deps): bump github.com/google/go-github/v53 from 53.0.0 to
53.1.0 by [@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/integrations/terraform-provider-github/pull/1740](https://togithub.com/integrations/terraform-provider-github/pull/1740)
- build(deps): bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/integrations/terraform-provider-github/pull/1739](https://togithub.com/integrations/terraform-provider-github/pull/1739)
- Improve github team resource by
[@&#8203;bpaquet](https://togithub.com/bpaquet) in
[https://github.com/integrations/terraform-provider-github/pull/1722](https://togithub.com/integrations/terraform-provider-github/pull/1722)
- Handle deployment branch policies for repositories: resources and
datasource by [@&#8203;bpaquet](https://togithub.com/bpaquet) in
[https://github.com/integrations/terraform-provider-github/pull/1715](https://togithub.com/integrations/terraform-provider-github/pull/1715)
- Bump google/go-github to v53.2.0 by
[@&#8203;kfcampbell](https://togithub.com/kfcampbell) in
[https://github.com/integrations/terraform-provider-github/pull/1744](https://togithub.com/integrations/terraform-provider-github/pull/1744)
- Fix
[#&#8203;1555](https://togithub.com/integrations/terraform-provider-github/issues/1555):
Avoid duplication of pull request bypasser by
[@&#8203;bpaquet](https://togithub.com/bpaquet) in
[https://github.com/integrations/terraform-provider-github/pull/1711](https://togithub.com/integrations/terraform-provider-github/pull/1711)
- fix: Repo Creation fails with enabled Pages by
[@&#8203;0x46616c6b](https://togithub.com/0x46616c6b) in
[https://github.com/integrations/terraform-provider-github/pull/1748](https://togithub.com/integrations/terraform-provider-github/pull/1748)

**Full Changelog**:
integrations/terraform-provider-github@v5.28.0...v5.29.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDAuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0MC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: greyrock-bot <1583719+greyrock-bot[bot]@users.noreply.github.com>
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
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.

2 participants