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

Missing docs for GCP ArtifactRegistry CleanupPolicy #966

Closed
adriangb opened this issue Feb 27, 2024 · 6 comments
Closed

Missing docs for GCP ArtifactRegistry CleanupPolicy #966

adriangb opened this issue Feb 27, 2024 · 6 comments
Assignees
Labels
awaiting-feedback Blocked on input from the author customer/feedback Feedback from customers kind/question Questions about existing features

Comments

@adriangb
Copy link

adriangb commented Feb 27, 2024

It's currently a string (I assume JSON?) but there are zero docs or examples on what the contents are supposed to be. I posted on Slack and have gotten no answers, which is disappointing for a paying customer.

Can anyone give a working example of using cleanupPolicy with ArtifactRegistry on the GCP "native" SDK? It's currently a map of strings to strings and the schema for the string is not specified anywhere. I get that the feature is experimental and using a string avoids breaking changes in the typescript sense but at least some examples or a schema for the string should be provided in these cases. I've tried the same JSON that is accepted by calling Google APIs directly and I've tried the output of console.log for getRepository but neither work.

It was introduced in #935.

@adriangb adriangb added customer/feedback Feedback from customers needs-triage Needs attention from the triage team labels Feb 27, 2024
@cleverguy25 cleverguy25 transferred this issue from pulumi/pulumi-cloud-requests Feb 27, 2024
@iwahbe iwahbe transferred this issue from pulumi/pulumi-gcp Feb 28, 2024
@mjeffryes
Copy link
Contributor

mjeffryes commented Feb 28, 2024

Hi @adriangb; very sorry you didn't get any response in slack; there's a lot of activity there so sometimes questions slip through the cracks!

Documentation for the resources in google-native is generated from the GCP discovery docs and is sometimes incomplete. You can generally try the Google Cloud API docs as a fallback. (Though I see from your example in the thread you probably already looked there.)

It looks like our primary GCP provider, pulumi-gcp has a artifactregistry.Repository resource, which is better documented and fully supported, so I would honestly suggest you try starting there unless you need a parameter that's only available in the google-native version of this resource.

If you do need to stick with google-native for this resource, you can get more detail on the error you're getting from the API by enabling verbose logging, which will usually show you the full request and response.

Again, very sorry that you've run into a roadblock here! We know that these "preview" providers can sometimes be a pitfall and are working to try and clean up naming, docs, etc. to help avoid these frustrations!

@mjeffryes mjeffryes added awaiting-feedback Blocked on input from the author kind/question Questions about existing features and removed needs-triage Needs attention from the triage team labels Feb 28, 2024
@adriangb
Copy link
Author

You can generally try the Google Cloud API docs as a fallback. (Though I see from your example in the thread you probably already looked there.)

Yeah it seems like it's not the same schema / payload because what works with gcloud does not work with pulumi.

It looks like our primary GCP provider, pulumi-gcp has a artifactregistry.Repository resource, which is better documented and fully supported, so I would honestly suggest you try starting there unless you need a parameter that's only available in the google-native version of this resource.

That would require destroying and re-creating my artifact registry sadly.

If you do need to stick with google-native for this resource, you can get more detail on the error you're getting from the API by enabling verbose logging, which will usually show you the full request and response.

I'll give it a shot 👍🏻

We know that these "preview" providers can sometimes be a pitfall and are working to try and clean up naming, docs, etc. to help avoid these frustrations!

Is the Google Native provider still considered preview?

@adriangb
Copy link
Author

Verbose logs were unfortunately not very helpful. All I see is:

error: error sending request: googleapi: Error 400: Invalid value at 'repository.cleanup_policies[0].value' (type.googleapis.com/google.devtools.artifactregistry.v1.CleanupPolicy), "{"action":"DELETE","condition":{"olderThan":"432000s","tagPrefixes":["pr-"]}}"
    Details:
    [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Invalid value at 'repository.cleanup_policies[0].value' (type.googleapis.com/google.devtools.artifactregistry.v1.CleanupPolicy), \"{\"action\":\"DELETE\",\"condition\":{\"olderThan\":\"432000s\",\"tagPrefixes\":[\"pr-\"]}}\"",
            "field": "repository.cleanup_policies[0].value"
          }
        ]
      }
    ]: "https://artifactregistry.googleapis.com/v1/projects/pydantic-platform/locations/us/repositories/docker" map[cleanupPolicies:map[deleteOldPrImages:{"action":"DELETE","condition":{"olderThan":"432000s","tagPrefixes":["pr-"]}}] format:DOCKER mode:STANDARD_REPOSITORY name:<redacted>]

Is there an example, a test, anything I can go off of?

@mjeffryes
Copy link
Contributor

Is the Google Native provider still considered preview?

yes, this provider has never graduated to GA and active development is paused at this time.

Verbose logs were unfortunately not very helpful.

Yes looks like Google returns roughly no information about what specifically is wrong with the input. :/

Is there an example, a test, anything I can go off of?

Not that I am aware of; there might be examples of raw API requests somewhere you could try to work off of, but I doubt there are any examples of setting CleanupPolicy with this provider

That would require destroying and re-creating my artifact registry sadly.

You should be able to import the state of the artifact from GCP with a program written against the pulumi-gcp provider: https://www.pulumi.com/docs/concepts/options/import/

@adriangb
Copy link
Author

adriangb commented Mar 1, 2024

yes, this provider has never graduated to GA and active development is paused at this time

Oh I didn’t know this. I thought this provider was the future. Do you recommend switching completely over to the other provider?

@mjeffryes
Copy link
Contributor

yes, apologies that this is sometimes unclear in the docs, but for now we would encourage you to move completely to the pulumi-gcp provider for most projects (an certainly for any production work). There are some fundamental limitations the API documentation for GCP that we're hoping to work out with google before we can reinvest in the native provider.

@mjeffryes mjeffryes self-assigned this Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback Blocked on input from the author customer/feedback Feedback from customers kind/question Questions about existing features
Projects
None yet
Development

No branches or pull requests

2 participants