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

Package reorganization #927

Merged
merged 7 commits into from
Feb 7, 2023
Merged

Package reorganization #927

merged 7 commits into from
Feb 7, 2023

Conversation

andrewsomething
Copy link
Member

This pull request reorganizes the structure of this project to use multiple packages. As the provider has grown, it has become a bit unwieldy to work with as the majority of files were all in the same directory. By breaking this up into subpackages, it should be easier to quickly find the files you need. It should also simplify acceptance testing by being able to run the tests for a subpackage with out needing to craft regexps. For example, to only run the acceptance tests for the account package use:

make testacc PKG_NAME=digitalocean/account

When PKG_NAME is excluded, all acceptance tests are run.

One place where this does add a bit of complexity is with the test sweepers. In order to collect sweepers across the packages, we need to use "blank" imports which can be easy to forget. See: digitalocean/sweep/sweep_test.go In a future iteration, we could potentially generate that. The AWS provider has some prior art that could provide some inspiration.

While this is a huge PR, most of the changes are file renames and moving code to break import cycles.

@andrewsomething andrewsomething temporarily deployed to Acceptance Tests February 3, 2023 23:01 — with GitHub Actions Inactive
Copy link
Member

@danaelhe danaelhe left a comment

Choose a reason for hiding this comment

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

Huge progress from what we have 👍

Copy link
Contributor

@scotchneat scotchneat left a comment

Choose a reason for hiding this comment

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

Looks great!

@andrewsomething andrewsomething merged commit 95da01c into main Feb 7, 2023
@andrewsomething andrewsomething deleted the asb/reorg branch February 7, 2023 19:37
andrewsomething added a commit to andrewsomething/terraform-provider-digitalocean that referenced this pull request Feb 7, 2023
* Initial reorganization.

* Update Makefile for running accepance tests under new organization.

* Update sweepers for new organization.

* Remove unused functions from util package.

* godo.PtrTo replaces the boolPtr and intPtr helpers.

* Clean up util package.

* Reorg helpers in acceptance package.
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.

None yet

3 participants