Skip to content

Conversation

timofurrer
Copy link
Member

At first glance, this change set appears to be quite huge, but actually isn't.

It basically reproduces the best practice provider structure and setup from the terraform-provider-scaffolding project.

The major changes are that:

  • provider code moved from gitlab to internal/provider directory
  • change provider code from gitlab to provider package
  • used scaffolding setup in main.go and provider.go
  • For the test code we don't re-use the Gitlab client from the provider, but I've introduced a testGitlabClient which is separate from the provider Gitlab client.
  • the rest of the changes were all necessary evil

@timofurrer timofurrer changed the title Change provider structure to best practices from terraform-provider-scaffolding project WIP: Change provider structure to best practices from terraform-provider-scaffolding project Jan 28, 2022
Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

Lots of cool sdk v2 improvements!

I just want to acknowledge that moving code to internal is going to break almost all PRs and anyone who might be using this repository as a package (which they shouldn't.) What are the benefits of moving code to internal now in your opinion?

I looked at some other providers. The major first-party ones have largely moved to internal, and the major third-party ones have not yet.

@timofurrer timofurrer force-pushed the feature/align-to-tf-scaffold branch from 4036753 to 3532f95 Compare January 28, 2022 21:46
@timofurrer
Copy link
Member Author

@armsnyder

I just want to acknowledge that moving code to internal is going to break almost all PRs and anyone who might be using this repository as a package (which they shouldn't.) What are the benefits of moving code to internal now in your opinion?

Yes, I actually share the same hesitation towards this change. First of all, I wouldn't want to merge this before 3.9.0 is out. The reason I went for the change anyways (to be merged after 3.9.0) is because I don't foresee that there will be an "ideal" time to make it. Also I think a v4 wouldn't necessarily be it, because the target audience for the "break" is another one.

IMHO: moving it to internal doesn't provide huge benefits other than (1) that it's aligned (as you mentioned) with other popular providers and the scaffolding project and (2) that no one is using it a go dependency.

@timofurrer timofurrer requested a review from armsnyder January 28, 2022 22:16
@timofurrer timofurrer added DX Developer Experience, e.g. contributing, readme, makefile, issue / pr template changes enhancement labels Jan 28, 2022
@timofurrer timofurrer self-assigned this Jan 28, 2022
Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

Also I think a v4 wouldn't necessarily be it

Agree

(2) that no one is using it a go dependency

That's a good reason, in case we modularize more in the future.

@timofurrer timofurrer changed the title WIP: Change provider structure to best practices from terraform-provider-scaffolding project [Wait for 3.9.0]: Change provider structure to best practices from terraform-provider-scaffolding project Jan 28, 2022
@timofurrer timofurrer added the do-not-merge A maintainer has temporarily blocked merging this PR label Feb 1, 2022
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

This pull request has merge conflicts. Please rebase your branch onto master.

@github-actions github-actions bot added the merge-conflict PR cannot be merged due to a merge conflict label Feb 2, 2022
@timofurrer timofurrer force-pushed the feature/align-to-tf-scaffold branch from 9d2f369 to 1ad119a Compare February 2, 2022 06:47
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

Conflicts are resolved. Thank you! 😀

@github-actions github-actions bot added tests size/XL and removed merge-conflict PR cannot be merged due to a merge conflict labels Feb 2, 2022
@armsnyder armsnyder added do-not-merge A maintainer has temporarily blocked merging this PR and removed do-not-merge A maintainer has temporarily blocked merging this PR labels Feb 2, 2022
@timofurrer timofurrer added this to the 4.0.0 milestone Feb 4, 2022
@timofurrer timofurrer force-pushed the feature/align-to-tf-scaffold branch from 1ad119a to da9309f Compare February 4, 2022 14:57
@timofurrer timofurrer removed the do-not-merge A maintainer has temporarily blocked merging this PR label Feb 4, 2022
@timofurrer timofurrer changed the title [Wait for 3.9.0]: Change provider structure to best practices from terraform-provider-scaffolding project Change provider structure to best practices from terraform-provider-scaffolding project Feb 4, 2022
@github-actions github-actions bot added dependencies merge-conflict PR cannot be merged due to a merge conflict labels Feb 4, 2022
@github-actions
Copy link

github-actions bot commented Feb 5, 2022

This pull request has merge conflicts. Please rebase your branch onto master.

@timofurrer
Copy link
Member Author

timofurrer commented Feb 6, 2022

@armsnyder Are you okay if we merge this early next week? ... most open PRs have merge conflicts already, so maybe it doesn't hurt too much.

Awaiting the regression bugfix release, of course ;)

@armsnyder
Copy link
Collaborator

@timofurrer Sounds good, as long as it's after the 3.9.1 patch release. I don't know if you saw my two PRs for this branch, in your fork? It's up to you if you want to include those or not. I thought it might make sense to get the changes in the same PR (this one).

@timofurrer timofurrer added the blocked We are currently blocked to implement this label Feb 6, 2022
@timofurrer
Copy link
Member Author

Yes, I'll wait for 3.9.1 - I've marked it as blocked in the meantime.

I haven't seen your PR 🙈 Let me see :)

@timofurrer
Copy link
Member Author

@armsnyder I've added the changes from our two PRs - look good to me 🎉

@timofurrer timofurrer removed the blocked We are currently blocked to implement this label Feb 7, 2022
@timofurrer timofurrer linked an issue Feb 7, 2022 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Feb 7, 2022

This pull request has merge conflicts. Please rebase your branch onto main.

@github-actions github-actions bot added the merge-conflict PR cannot be merged due to a merge conflict label Feb 7, 2022
@timofurrer timofurrer force-pushed the feature/align-to-tf-scaffold branch from 43f9631 to b1b5e5e Compare February 7, 2022 07:18
@github-actions
Copy link

github-actions bot commented Feb 7, 2022

Conflicts are resolved. Thank you! 😀

@github-actions github-actions bot removed the merge-conflict PR cannot be merged due to a merge conflict label Feb 7, 2022
@timofurrer timofurrer force-pushed the feature/align-to-tf-scaffold branch 3 times, most recently from bf18466 to 16d7259 Compare February 7, 2022 07:31
@timofurrer timofurrer force-pushed the feature/align-to-tf-scaffold branch from 16d7259 to 4c2c4f4 Compare February 7, 2022 08:41
@timofurrer timofurrer merged commit f818824 into gitlabhq:main Feb 7, 2022
@github-actions
Copy link

This functionality has been released in v3.10.0 of the Terraform GitLab Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue. Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DX Developer Experience, e.g. contributing, readme, makefile, issue / pr template changes enhancement provider size/XL tests workflows
Development

Successfully merging this pull request may close these issues.

Changes to reduce likelihood of merge conflicts with new resources
2 participants