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

[DDO-3776] Allow clearing role requirement #603

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

jack-r-warren
Copy link
Contributor

In developing the UI for configuring Environments and Clusters with a required Role I realized that it wasn't possible to clear out the field once it was set. Hello Go.

This fix manually clears out the field when an edit request is made with it set to an empty string. This is what the UI will already do so there's no changes to that (upcoming) PR.

Testing

Unit test for both Environments and Clusters

Risk

Low

@jack-r-warren jack-r-warren requested a review from a team as a code owner July 11, 2024 16:36
Copy link

Copy link

What's Changed


GET /api/clusters/v3
Parameters:

Changed: requiredRole in query

If present, requires membership in the given role for mutations. Set to an empty string to clear.

Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

POST /api/clusters/v3
Request:

Changed content type : application/json

  • Changed property requiredRole (string)

    If present, requires membership in the given role for mutations. Set to an empty string to clear.

Return Type:

Changed response : 201 Created

Created

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/clusters/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

DELETE /api/clusters/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

PATCH /api/clusters/v3/{selector}
Request:

Changed content type : application/json

  • Changed property requiredRole (string)

    If present, requires membership in the given role for mutations. Set to an empty string to clear.

Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/environments/v3
Parameters:

Changed: requiredRole in query

If present, requires membership in the given role for mutations. Set to an empty string to clear.

Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property defaultClusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

POST /api/environments/v3
Request:

Changed content type : application/json

  • Changed property requiredRole (string)

    If present, requires membership in the given role for mutations. Set to an empty string to clear.

Return Type:

Changed response : 201 Created

Created

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property defaultClusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/environments/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property defaultClusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

DELETE /api/environments/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property defaultClusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

PATCH /api/environments/v3/{selector}
Request:

Changed content type : application/json

  • Changed property requiredRole (string)

    If present, requires membership in the given role for mutations. Set to an empty string to clear.

Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property requiredRole (string)

      If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property defaultClusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

POST /api/changesets/procedures/v3/apply
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/changesets/procedures/v3/chart-release-history/{chart-release}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

POST /api/changesets/procedures/v3/plan
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

Changed response : 201 Created

Created

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

POST /api/changesets/procedures/v3/plan-and-apply
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

Changed response : 201 Created

Created

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/changesets/procedures/v3/version-history/{version-type}/{chart}/{version}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/changesets/v3
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/changesets/v3/{id}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/chart-releases/v3
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property environmentInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property clusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

POST /api/chart-releases/v3
Return Type:

Changed response : 201 Created

Created

  • Changed content type : application/json

    • Changed property environmentInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property clusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/chart-releases/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property environmentInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property clusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

DELETE /api/chart-releases/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property environmentInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property clusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

PATCH /api/chart-releases/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property environmentInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

    • Changed property clusterInfo (object)

      • Changed property requiredRole (string)

        If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/database-instances/v3
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    Changed items (object):

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

PUT /api/database-instances/v3
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

Changed response : 201 Created

Created

  • Changed content type : application/json

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

POST /api/database-instances/v3
Return Type:

Changed response : 201 Created

Created

  • Changed content type : application/json

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

GET /api/database-instances/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

DELETE /api/database-instances/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

PATCH /api/database-instances/v3/{selector}
Return Type:

Changed response : 200 OK

OK

  • Changed content type : application/json

    • Changed property chartReleaseInfo (object)

      • Changed property environmentInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

      • Changed property clusterInfo (object)

        • Changed property requiredRole (string)

          If present, requires membership in the given role for mutations. Set to an empty string to clear.

Copy link

Published image from 6f79ffc (merge dc8a4c5):

us-central1-docker.pkg.dev/dsp-artifact-registry/sherlock/sherlock:v1.5.18-dc8a4c5
us-central1-docker.pkg.dev/dsp-devops-super-prod/sherlock/sherlock:v1.5.18-dc8a4c5

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 76.24%. Comparing base (fb14072) to head (6f79ffc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #603      +/-   ##
==========================================
- Coverage   76.27%   76.24%   -0.04%     
==========================================
  Files         211      211              
  Lines       10010    10022      +12     
==========================================
+ Hits         7635     7641       +6     
- Misses       1700     1704       +4     
- Partials      675      677       +2     
Files Coverage Δ
sherlock/internal/api/sherlock/clusters_v3.go 75.51% <ø> (ø)
sherlock/internal/api/sherlock/environments_v3.go 91.91% <ø> (ø)
sherlock/internal/api/sherlock/clusters_v3_edit.go 73.33% <50.00%> (-5.84%) ⬇️
...lock/internal/api/sherlock/environments_v3_edit.go 83.33% <50.00%> (-8.34%) ⬇️

@jack-r-warren jack-r-warren merged commit a675f9f into main Jul 11, 2024
17 checks passed
@jack-r-warren jack-r-warren deleted the DDO-3776-role-checks-clear branch July 11, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants