Skip to content

Commit

Permalink
fix: lock release and deployment creation (#14313)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkoSekulic authored Dec 19, 2024
1 parent 276f5ef commit 06c5ae8
Showing 1 changed file with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ namespace Altinn.Studio.Designer.Middleware.UserRequestSynchronization.Services.
public class EndpointNameSyncEvaluator : IRequestSyncEvaluator
{
private const string RemoveControllerSuffix = "Controller";
private static string TrimmedControllerName(string controllerName) => controllerName.Replace(RemoveControllerSuffix, string.Empty);
private readonly FrozenDictionary<string, FrozenSet<string>> _endpointsWhiteList = new Dictionary<string, FrozenSet<string>>
{
{
nameof(RepositoryController).Replace(RemoveControllerSuffix, string.Empty),
TrimmedControllerName(nameof(RepositoryController)),
GenerateFrozenSet(
nameof(RepositoryController.RepoStatus),
nameof(RepositoryController.RepoDiff),
Expand All @@ -28,7 +29,7 @@ public class EndpointNameSyncEvaluator : IRequestSyncEvaluator
)
},
{
nameof(AppDevelopmentController).Replace(RemoveControllerSuffix, string.Empty),
TrimmedControllerName(nameof(AppDevelopmentController)),
GenerateFrozenSet(
nameof(AppDevelopmentController.SaveFormLayout),
nameof(AppDevelopmentController.UpdateFormLayoutName),
Expand All @@ -42,13 +43,13 @@ public class EndpointNameSyncEvaluator : IRequestSyncEvaluator
)
},
{
nameof(ApplicationMetadataController).Replace(RemoveControllerSuffix, string.Empty),
TrimmedControllerName(nameof(ApplicationMetadataController)),
GenerateFrozenSet(
nameof(ApplicationMetadataController.DeleteMetadataForAttachment)
)
},
{
nameof(ProcessModelingController).Replace(RemoveControllerSuffix, string.Empty),
TrimmedControllerName( nameof(ProcessModelingController)),
GenerateFrozenSet(
nameof(ProcessModelingController.AddDataTypeToApplicationMetadata),
nameof(ProcessModelingController.DeleteDataTypeFromApplicationMetadata),
Expand All @@ -57,10 +58,22 @@ public class EndpointNameSyncEvaluator : IRequestSyncEvaluator
)
},
{
nameof(ResourceAdminController).Replace(RemoveControllerSuffix, string.Empty),
TrimmedControllerName( nameof(ResourceAdminController)),
GenerateFrozenSet(
nameof(ResourceAdminController.UpdateResource)
)
},
{
TrimmedControllerName(nameof(ReleasesController)),
GenerateFrozenSet(
nameof(ReleasesController.Create)
)
},
{
TrimmedControllerName(nameof(DeploymentsController)),
GenerateFrozenSet(
nameof(DeploymentsController.Create)
)
}
}.ToFrozenDictionary();

Expand Down

0 comments on commit 06c5ae8

Please sign in to comment.