diff --git a/api/generated_model_ref_protections_branches.go b/api/generated_model_ref_protections_branches.go index 2e02efc..91b0b81 100644 --- a/api/generated_model_ref_protections_branches.go +++ b/api/generated_model_ref_protections_branches.go @@ -13,16 +13,16 @@ package openapi // RefProtectionsBranches struct for RefProtectionsBranches type RefProtectionsBranches struct { - // Forces creating a PR to update the proteced refs. + // Forces creating a PR to update the protected refs. RequirePR []ProtectedRef `yaml:"requirePR,omitempty" json:"requirePR,omitempty"` - // Prevents all changes of the proteced refs. + // Prevents all changes of the protected refs. PreventAllChanges []ProtectedRef `yaml:"preventAllChanges,omitempty" json:"preventAllChanges,omitempty"` - // Prevents creation of the proteced refs. Results in preventAllChanges for BitBucket. + // Prevents creation of the protected refs. Results in preventAllChanges for BitBucket. PreventCreation []ProtectedRef `yaml:"preventCreation,omitempty" json:"preventCreation,omitempty"` - // Prevents deletion of the proteced refs. + // Prevents deletion of the protected refs. PreventDeletion []ProtectedRef `yaml:"preventDeletion,omitempty" json:"preventDeletion,omitempty"` - // Prevents pushes to the proteced refs. Results in preventAllChanges for BitBucket. + // Prevents pushes to the protected refs. Results in preventAllChanges for BitBucket. PreventPush []ProtectedRef `yaml:"preventPush,omitempty" json:"preventPush,omitempty"` - // Prevents force pushes to the proteced refs for users with push permission. + // Prevents force pushes to the protected refs for users with push permission. PreventForcePush []ProtectedRef `yaml:"preventForcePush,omitempty" json:"preventForcePush,omitempty"` } diff --git a/api/generated_model_ref_protections_tags.go b/api/generated_model_ref_protections_tags.go index 4ebef48..2a78ec9 100644 --- a/api/generated_model_ref_protections_tags.go +++ b/api/generated_model_ref_protections_tags.go @@ -13,12 +13,12 @@ package openapi // RefProtectionsTags struct for RefProtectionsTags type RefProtectionsTags struct { - // Prevents all changes of the proteced refs. + // Prevents all changes of the protected refs. PreventAllChanges []ProtectedRef `yaml:"preventAllChanges,omitempty" json:"preventAllChanges,omitempty"` - // Prevents creation of the proteced refs. Results in preventAllChanges for BitBucket. + // Prevents creation of the protected refs. Results in preventAllChanges for BitBucket. PreventCreation []ProtectedRef `yaml:"preventCreation,omitempty" json:"preventCreation,omitempty"` - // Prevents deletion of the proteced refs. + // Prevents deletion of the protected refs. PreventDeletion []ProtectedRef `yaml:"preventDeletion,omitempty" json:"preventDeletion,omitempty"` - // Prevents force pushes to the proteced refs for users with push permission. + // Prevents force pushes to the protected refs for users with push permission. PreventForcePush []ProtectedRef `yaml:"preventForcePush,omitempty" json:"preventForcePush,omitempty"` } diff --git a/api/generated_model_repository_configuration_dto.go b/api/generated_model_repository_configuration_dto.go index a73e53e..c3dbb96 100644 --- a/api/generated_model_repository_configuration_dto.go +++ b/api/generated_model_repository_configuration_dto.go @@ -32,10 +32,7 @@ type RepositoryConfigurationDto struct { // Map of string (group name e.g. some-owner) of strings (list of approvers), one approval for each group is required. Approvers map[string][]string `yaml:"approvers,omitempty" json:"approvers,omitempty"` // List of strings (list of watchers, either usernames or group identifier), which are added as reviewers but require no approval. - Watchers []string `yaml:"watchers,omitempty" json:"watchers,omitempty"` - DefaultReviewers []string `yaml:"defaultReviewers,omitempty" json:"defaultReviewers,omitempty"` - // List of users, who can sign a pull request. - SignedApprovers []string `yaml:"signedApprovers,omitempty" json:"signedApprovers,omitempty"` + Watchers []string `yaml:"watchers,omitempty" json:"watchers,omitempty"` // Moves the repository into the archive. Archived *bool `yaml:"archived,omitempty" json:"archived,omitempty"` // Repository will not be configured, also not archived. diff --git a/api/generated_model_repository_configuration_patch_dto.go b/api/generated_model_repository_configuration_patch_dto.go index 3ad03e7..217fa24 100644 --- a/api/generated_model_repository_configuration_patch_dto.go +++ b/api/generated_model_repository_configuration_patch_dto.go @@ -32,10 +32,7 @@ type RepositoryConfigurationPatchDto struct { // Map of string (group name e.g. some-owner) of strings (list of approvers), one approval for each group is required. Approvers map[string][]string `yaml:"approvers,omitempty" json:"approvers,omitempty"` // List of strings (list of watchers, either usernames or group identifier), which are added as reviewers but require no approval. - Watchers []string `yaml:"watchers,omitempty" json:"watchers,omitempty"` - DefaultReviewers []string `yaml:"defaultReviewers,omitempty" json:"defaultReviewers,omitempty"` - // List of users, who can sign a pull request. - SignedApprovers []string `yaml:"signedApprovers,omitempty" json:"signedApprovers,omitempty"` + Watchers []string `yaml:"watchers,omitempty" json:"watchers,omitempty"` // Moves the repository into the archive. Archived *bool `yaml:"archived,omitempty" json:"archived,omitempty"` // Repository will not be configured, also not archived. diff --git a/api/openapi-v3-spec.yaml b/api/openapi-v3-spec.yaml index 57656da..b7cf051 100644 --- a/api/openapi-v3-spec.yaml +++ b/api/openapi-v3-spec.yaml @@ -1930,8 +1930,6 @@ components: testing: - user-one - user-two - defaultReviewers: [] - signedApprovers: [] timeStamp: '2022-04-18T14:22:38Z' unicorn-finder-service.implementation: url: 'ssh://git@bitbucket.some-organisation.com:7999/UNICORNS/unicorn-finder-service.git' @@ -2016,15 +2014,6 @@ components: - - someUser - anotherUser - '@owner.users' - defaultReviewers: - type: array - items: - type: string - signedApprovers: - description: 'List of users, who can sign a pull request.' - type: array - items: - type: string archived: description: Moves the repository into the archive. type: boolean @@ -2103,15 +2092,6 @@ components: - - someUser - anotherUser - '@owner.users' - defaultReviewers: - type: array - items: - type: string - signedApprovers: - description: 'List of users, who can sign a pull request.' - type: array - items: - type: string archived: description: Moves the repository into the archive. type: boolean diff --git a/internal/service/repositories/repositories.go b/internal/service/repositories/repositories.go index 4f26bca..d9864c0 100644 --- a/internal/service/repositories/repositories.go +++ b/internal/service/repositories/repositories.go @@ -3,6 +3,9 @@ package repositories import ( "context" "fmt" + "net/url" + "strings" + "github.com/Interhyp/metadata-service/api" "github.com/Interhyp/metadata-service/internal/acorn/config" "github.com/Interhyp/metadata-service/internal/acorn/repository" @@ -11,8 +14,6 @@ import ( auzerolog "github.com/StephanHCB/go-autumn-logging-zerolog" librepo "github.com/StephanHCB/go-backend-service-common/acorns/repository" "github.com/StephanHCB/go-backend-service-common/api/apierrors" - "net/url" - "strings" ) type Impl struct { @@ -460,8 +461,6 @@ func patchConfiguration(patch *openapi.RepositoryConfigurationPatchDto, original Webhooks: patchWebhooks(patch.Webhooks, original.Webhooks), Approvers: patchApprovers(patch.Approvers, original.Approvers), Watchers: patchStringSlice(patch.Watchers, original.Watchers), - DefaultReviewers: patchStringSlice(patch.DefaultReviewers, original.DefaultReviewers), - SignedApprovers: patchStringSlice(patch.SignedApprovers, original.SignedApprovers), Archived: patchPtr[bool](patch.Archived, original.Archived), // fields not allowed for patching carry over from original RequireIssue: original.RequireIssue,