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

Add private registry provider, provider version, and provider platform APIs #313

Merged
merged 3 commits into from Jun 8, 2022

Conversation

joekarl
Copy link
Contributor

@joekarl joekarl commented Feb 16, 2022

Description

This PR adds support for private registry provider APIs, which includes adding support for the following APIs:

  • Private registry provider
  • Private provider version
  • Private provider platform

Testing plan

To test these changes locally, create a local go project, and in the go.mod include a line similar to the following:

replace github.com/hashicorp/go-tfe => /Users/YOURUSER/go/src/github.com/hashicorp/go-tfe

Then, you can test the following functionality:

  • Registry provider: create, delete, read, list
  • Registry provider version: create, delete, read, list
  • Registry provider platform: create, delete, read, list

External links

Output from tests (HashiCorp employees only)

$ TFE_ADDRESS="https://example" TFE_TOKEN="example" TF_ACC="1" go test ./... -v -tags=integration -run TestFunctionsAffectedByChange

...

Copy link
Contributor

@sebasslash sebasslash left a comment

All in all, everything looks awesome so far 🔥 ! Admittedly, I haven't given it a thorough review but a few 1.0 related things stuck out to me looking over your changes.

One thing I'll add is if you add any include params to a read or list option to make sure the valid relations that can be included live as string enums #294

registry_provider.go Outdated Show resolved Hide resolved
registry_provider.go Outdated Show resolved Hide resolved
registry_provider.go Outdated Show resolved Hide resolved
registry_provider.go Outdated Show resolved Hide resolved
Copy link
Contributor

@uturunku1 uturunku1 left a comment

Hey Karl!
I left two comments for you.
I am happy to see that your PR is following our go-tfe best practices so far.
Once your PR is no longer a draft and you are ready for a final review, I'd like to smoke test your changes. If you can leave in the PR description detailed instructions on how to smoke test for this feature, I'd greatly appreciate it!

registry_provider_platform.go Show resolved Hide resolved
registry_provider_version.go Outdated Show resolved Hide resolved
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@daniel-laszlo
Copy link

daniel-laszlo commented Mar 21, 2022

Hi @joekarl , @sebasslash , @uturunku1

We are very much interested in publishing providers to private registry. Do I understand right that this MR is the missing piece for it?

@sebasslash
Copy link
Contributor

sebasslash commented Apr 5, 2022

Hi @daniel-laszlo ! Yes if your means is to use go-tfe, however in the meantime you can do so directly calling the private registry/provider API.

Once the go-tfe changes are released, we'll subsequently add support to the tfe provider.

@annawinkler annawinkler changed the title Kirch/provider apis Add private registry provider, provider version, provider platform, and GPG keys APIs Apr 25, 2022
@annawinkler annawinkler force-pushed the kirch/provider_apis branch 2 times, most recently from 338ef61 to e2dd192 Compare May 2, 2022
@annawinkler annawinkler changed the title Add private registry provider, provider version, provider platform, and GPG keys APIs Add private registry provider, provider version, provider platform, and GPG keys APIs May 5, 2022
@annawinkler annawinkler force-pushed the kirch/provider_apis branch 4 times, most recently from 2ff8259 to 005dfbf Compare May 15, 2022
@annawinkler annawinkler marked this pull request as ready for review May 15, 2022
@annawinkler annawinkler changed the title Add private registry provider, provider version, provider platform, and GPG keys APIs Add private registry provider, provider version, and provider platform APIs May 15, 2022
@annawinkler
Copy link
Contributor

annawinkler commented May 16, 2022

I've been thinking about breaking this PR up into 3 separate PRs, and I think I'll do that.

helper_test.go Show resolved Hide resolved
registry_provider.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@brandonc brandonc left a comment

Submitting a partial review. I still need to review the tests. Looks great!

registry_provider.go Outdated Show resolved Hide resolved
registry_provider.go Outdated Show resolved Hide resolved
registry_provider_platform.go Outdated Show resolved Hide resolved
Copy link
Contributor

@sebasslash sebasslash left a comment

Looking great! Almost there across the finish line 🐎

registry_provider_platform.go Show resolved Hide resolved
registry_provider_version.go Show resolved Hide resolved
registry_provider_version.go Outdated Show resolved Hide resolved
registry_provider_version.go Outdated Show resolved Hide resolved
registry_provider_version.go Show resolved Hide resolved
registry_provider.go Outdated Show resolved Hide resolved
registry_provider_platform.go Outdated Show resolved Hide resolved
registry_provider_platform.go Outdated Show resolved Hide resolved
Copy link
Contributor

@uturunku1 uturunku1 left a comment

@annawinkler Hey Anna! If you have any questions about my comments, let me know over slack (I occasionally miss pings over GitHub). Great job with all the testing done by the way!

@annawinkler
Copy link
Contributor

annawinkler commented Jun 6, 2022

A question was raised about these methods - should they be exported? I don't think they should be.

@annawinkler
Copy link
Contributor

annawinkler commented Jun 6, 2022

A question was raised about these methods - should they be exported? I don't think they should be.

Actually, we do want to export them. The idea is the workflow would be:

  • Create a registry provider version
  • Get the upload URLs from the newly-created registry provider version and use them to upload the shasums and shasums sig. Alternatively, could check the uploaded boolean values to see if the items have been uploaded, and if not upload them.
  • Then later could use the download URLs to download the shasums and shasums sig.

brandonc
brandonc previously approved these changes Jun 6, 2022
Copy link
Collaborator

@brandonc brandonc left a comment

Very nice

t.Run("with valid options", func(t *testing.T) {
options := RegistryProviderPlatformCreateOptions{
OS: "foo",
Arch: "scrimbles",
Copy link
Collaborator

@brandonc brandonc Jun 6, 2022

Choose a reason for hiding this comment

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

ah, yes, scrimbles64

Copy link
Contributor

@uturunku1 uturunku1 Jun 6, 2022

Choose a reason for hiding this comment

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

Lol, I couldn't find the meaning of "scrimbles" in the dictionary, but this sounds funny 😆

Copy link
Contributor

@annawinkler annawinkler Jun 7, 2022

Choose a reason for hiding this comment

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

It's a made up word from a former coworker from long ago that I still use 🥳

sebasslash
sebasslash previously approved these changes Jun 7, 2022
Copy link
Contributor

@sebasslash sebasslash left a comment

Woohooo @annawinkler and @joekarl !!! :celebration_dance

@annawinkler annawinkler merged commit f920ad3 into main Jun 8, 2022
6 checks passed
@annawinkler annawinkler deleted the kirch/provider_apis branch Jun 8, 2022
@github-actions
Copy link

github-actions bot commented Jun 8, 2022

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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

7 participants