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

@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

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

@uturunku1 uturunku1 left a comment

Choose a reason for hiding this comment

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

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!

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@daniel-laszlo
Copy link

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?

@joekarl joekarl force-pushed the kirch/provider_apis branch from 546d408 to a26c40e Compare March 25, 2022 20:13
@sebasslash
Copy link
Contributor

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 force-pushed the kirch/provider_apis branch from 285f853 to 09ff03f Compare April 22, 2022 15:31
@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 19:57
@annawinkler annawinkler force-pushed the kirch/provider_apis branch from e2dd192 to a723a6b Compare May 4, 2022 18:32
@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 from ec7f2f3 to 40a3165 Compare May 5, 2022 17:52
@annawinkler annawinkler force-pushed the kirch/provider_apis branch 4 times, most recently from 2ff8259 to 005dfbf Compare May 15, 2022 02:01
@annawinkler annawinkler marked this pull request as ready for review May 15, 2022 02:10
@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

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

Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

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

Copy link
Contributor

@sebasslash sebasslash left a comment

Choose a reason for hiding this comment

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

Looking great! Almost there across the finish line 🐎

@annawinkler annawinkler force-pushed the kirch/provider_apis branch from e98b091 to bf28899 Compare June 1, 2022 21:24
@annawinkler annawinkler force-pushed the kirch/provider_apis branch from ad5d732 to 4a9b53b Compare June 2, 2022 16:27
Copy link
Collaborator

@uturunku1 uturunku1 left a comment

Choose a reason for hiding this comment

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

@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 annawinkler force-pushed the kirch/provider_apis branch from 4a9b53b to 42b8284 Compare June 3, 2022 17:31
@annawinkler
Copy link
Contributor

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

@annawinkler
Copy link
Contributor

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.

@annawinkler annawinkler force-pushed the kirch/provider_apis branch from 5bd53d4 to 913d0e3 Compare June 6, 2022 21:03
brandonc
brandonc previously approved these changes Jun 6, 2022
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Very nice

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

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
Collaborator

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

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

Choose a reason for hiding this comment

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

Woohooo @annawinkler and @joekarl !!! :celebration_dance

@annawinkler annawinkler force-pushed the kirch/provider_apis branch from 3b146b7 to 7392512 Compare June 7, 2022 19:27
@annawinkler annawinkler merged commit f920ad3 into main Jun 8, 2022
@annawinkler annawinkler deleted the kirch/provider_apis branch June 8, 2022 16:18
@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.

7 participants