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

refactor(API): refactor secret creation and update functionality #26751

Merged
merged 3 commits into from
Aug 28, 2023

Conversation

appleboy
Copy link
Member

According to the GitHub API Spec: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret

Merge the Create and Update secret into a single API.

  • Remove the CreateSecretOption struct and replace it with CreateOrUpdateSecretOption in modules/structs/secret.go
  • Update the CreateOrUpdateOrgSecret function in routers/api/v1/org/action.go to use CreateOrUpdateSecretOption instead of UpdateSecretOption
  • Remove the CreateOrgSecret function in routers/api/v1/org/action.go and replace it with CreateOrUpdateOrgSecret
  • Update the Swagger documentation in routers/api/v1/swagger/options.go and templates/swagger/v1_json.tmpl to reflect the changes in the struct names and function names

- Remove the `CreateSecretOption` struct and replace it with `CreateOrUpdateSecretOption` in `modules/structs/secret.go`
- Update the `CreateOrUpdateOrgSecret` function in `routers/api/v1/org/action.go` to use `CreateOrUpdateSecretOption` instead of `UpdateSecretOption`
- Remove the `CreateOrgSecret` function in `routers/api/v1/org/action.go` and replace it with `CreateOrUpdateOrgSecret`
- Update the Swagger documentation in `routers/api/v1/swagger/options.go` and `templates/swagger/v1_json.tmpl` to reflect the changes in the struct names and function names

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 27, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 27, 2023
@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Aug 28, 2023
@lunny lunny added this to the 1.21.0 milestone Aug 28, 2023
@lunny lunny added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Aug 28, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 28, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 28, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 28, 2023
@lunny lunny merged commit 8cd4602 into go-gitea:main Aug 28, 2023
24 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 28, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Aug 29, 2023
* giteaofficial/main:
  Add fix incorrect can_create_org_repo for org owner team (go-gitea#26683)
  [skip ci] Updated translations via Crowdin
  Improve modal dialog UI (go-gitea#26764)
  Improve the "bug report" template and "support options" document (go-gitea#26753)
  Unify `border-radius` behavior (go-gitea#26770)
  Reduce some allocations in type conversion (go-gitea#26772)
  Refactor some CSS styles and simplify code (go-gitea#26771)
  Add auth-required to config.json for Cargo http registry (go-gitea#26729)
  refactor(API): refactor secret creation and update functionality (go-gitea#26751)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants