Repository navigation
Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
|
Hello @deiga, could you please have a look? As stated in the desc, this is the continuation of a work you have already reviewed |
846d795 to
53a10c8
Compare
|
Hi @stevehipwell, acceptance tests pass against a throwaway org on my side. CI is waiting on workflow approval, would you mind approving the runs? Happy to adjust anything once you have a moment to look. Thanks! |
53a10c8 to
6b48287
Compare
|
Hello @deiga, @stevehipwell, could a maintainer have a look at this PR? Thank you! |
Lets Terraform manage organization private registries (for example an npm or Maven registry that Dependabot uses) and read them back through a data source. Builds on integrations#3424, then follows provider conventions and addresses its review: no Read after Create or Update, auth_type forces a new resource, registry_type is not sent on update, and out-of-band secret changes are detected and repaired. Co-authored-by: Lasse Gaardsholt <lasse.gaardsholt@bestseller.com> Signed-off-by: Erwan Queffélec <e.queffelec@go-electra.com>
ea5c41b to
a2b8ebf
Compare
|
@deiga @stevehipwell I rebased this PR on current The CI and CodeQL runs on this PR are waiting on workflow approval, so they have not run yet. Could one of you approve them and review when you have a moment? Thanks! |
|
@deiga @stevehipwell I ran the CI checks locally on the current head, a2b8ebf, in a clean container (golangci-lint v2.15.0, Go 1.27.2). Everything passes:
The |
Continuation of #3424 by @Gaardsholt, who handed it over in that thread. The PR is a single commit on current
main: the original work, with @Gaardsholt credited as co-author, plus the changes that address the review and align the resource withARCHITECTURE.md.Resolves #2720
Resolves #3339
Before the change?
After the change?
New
github_organization_private_registryresource and data source.Changes on top of feat: add github_organization_private_registry resource and data source #3424, from the review threads and the contribution guides:
errors.AsType,http.StatusNotFoundandtflog.auth_typeisForceNew: the API rejects changing it after creation.registry_typeis no longer sent on update.selected_repository_idsdeclaresSet: schema.HashInt. The GET endpoint never returns this list (only the POST 201 body does), so Read keeps the configured value and the description says import cannot recover it.remote_updated_atlets the shareddiffSecretdetect an out-of-band secret change and re-send the secret on the next apply. It runs only fortokenandusername_password.value/value_encryptedon OIDC registries, treats an unknown-at-planvalueas present, and checksselected_repository_idsagainstvisibilityat create time.key_idis written to state only after the API call succeeds.value_encryptedrequireskey_id.usernamesends an empty string so the PATCH clears it instead of being dropped byomitempty.hex_organizationandhex_repositoryadded to the registry type list, per the current REST schema.t.Runsubtests withConfigStateChecks, an import step, a plan check on update, aForceNewplan check, ausernameclearing step, and randomized URLs so parallel runs do not collide.Not covered, out of scope for go-github v92: the newer
oidc_cloudsmithandoidc_gcpauth types and their fields.Pull request checklist
Schema migrations have been created if needed- not needed, new resourceDoes this introduce a breaking change?
Acceptance tests ran green against a throwaway organization (
GH_TEST_AUTH_MODE=organization):TestAccGithubOrganizationPrivateRegistrywith its four subtests (create then import then update, selected repositories,ForceNewonregistry_type, clearingusername) andTestAccGithubDataSourceOrganizationPrivateRegistry. The organization was left with no registries and no repositories afterwards.