-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: Add support for private registries endpoints #3785
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
base: master
Are you sure you want to change the base?
feat: Add support for private registries endpoints #3785
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the linter is going to catch some things, but here is some early feedback.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3785 +/- ##
==========================================
+ Coverage 91.50% 91.54% +0.04%
==========================================
Files 190 191 +1
Lines 17007 17088 +81
==========================================
+ Hits 15562 15643 +81
Misses 1257 1257
Partials 188 188 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @acouvreur!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29
github/private_registries.go
Outdated
TotalCount *int `json:"total_count,omitempty"` | ||
Configurations []*PrivateRegistry `json:"configurations,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TotalCount *int `json:"total_count,omitempty"` | |
Configurations []*PrivateRegistry `json:"configurations,omitempty"` | |
TotalCount int `json:"total_count"` | |
Configurations []*PrivateRegistry `json:"configurations"` |
total_count
and configurations
are required according to the schema:
{
"type": "object",
"required": [
"total_count",
"configurations"
],
"properties": {
"total_count": {
"type": "integer"
},
"configurations": {
"type": "array",
"items": {
"title": "Organization private registry",
"description": "Private registry configuration for an organization",
"type": "object",
"properties": {
"name": {
"description": "The name of the private registry configuration.",
"type": "string",
"examples": [
"MAVEN_REPOSITORY_SECRET"
]
},
"registry_type": {
"description": "The registry type.",
"enum": [
"maven_repository",
"nuget_feed",
"goproxy_server",
"npm_registry",
"rubygems_server",
"cargo_registry",
"composer_repository",
"docker_registry",
"git_source",
"helm_registry",
"hex_organization",
"hex_repository",
"pub_repository",
"python_index",
"terraform_registry"
],
"type": "string"
},
"username": {
"description": "The username to use when authenticating with the private registry.",
"type": [
"string",
"null"
],
"examples": [
"monalisa"
]
},
"visibility": {
"description": "Which type of organization repositories have access to the private registry.",
"enum": [
"all",
"private",
"selected"
],
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"name",
"registry_type",
"visibility",
"created_at",
"updated_at"
]
}
}
}
}
github/private_registries.go
Outdated
Name *string `json:"name,omitempty"` | ||
RegistryType *string `json:"registry_type,omitempty"` | ||
Username *string `json:"username,omitempty"` | ||
CreatedAt *Timestamp `json:"created_at,omitempty"` | ||
UpdatedAt *Timestamp `json:"updated_at,omitempty"` | ||
Visibility *string `json:"visibility,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name *string `json:"name,omitempty"` | |
RegistryType *string `json:"registry_type,omitempty"` | |
Username *string `json:"username,omitempty"` | |
CreatedAt *Timestamp `json:"created_at,omitempty"` | |
UpdatedAt *Timestamp `json:"updated_at,omitempty"` | |
Visibility *string `json:"visibility,omitempty"` | |
Name string `json:"name"` | |
RegistryType string `json:"registry_type"` | |
Username *string `json:"username,omitempty"` | |
CreatedAt Timestamp `json:"created_at"` | |
UpdatedAt Timestamp `json:"updated_at"` | |
Visibility string `json:"visibility"` |
name, registry_type, visibility, created_at, updated_at
are required according to the schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered all response struct members as pointers to avoid issues if something changed on the API side while using this version of the library.
Should I follow instead the schema and avoid marking all response struct members as optional ?
Adds support for private registries endpoints.
See https://docs.github.com/rest/private-registries for more details.
script/generate.sh
,script/fmt.sh
andscript/lint.sh
have been run without issue.Closes #3784