Add support for breakglass for immutable folders - #6774
andrewnester wants to merge 4 commits into
Conversation
Approval status: pending
|
Integration test reportCommit: f1b06de
Top 5 slowest tests (at least 2 minutes):
|
| return 0, nil | ||
| } | ||
|
|
||
| entry, ok := b.DeploymentBundle.StateDB.GetResourceEntry(resources.SnapshotKey) |
There was a problem hiding this comment.
This reads state and makes a determination. Shouldn't that live in a DoRead of the snapshot?
I.e. seeing a different generation, or a "broken_glass: true" on DoRead can trigger recreation.
There was a problem hiding this comment.
There are a couple of blockers why it is not in DoRead, mainly the --force flag, which is not available at the resource level
It's also conceptually similar to existing CheckDashboardsModifiedRemotely check we have
| // ContentSubdir is the fixed subfolder the snapshot API appends to a caller-supplied | ||
| // relative_path to form the immutable content path (e.g. "<root>/<relative_path>/snapshot"). | ||
| // The content path is what the create API echoes back and what InspectSnapshot inspects. | ||
| const ContentSubdir = "snapshot" |
There was a problem hiding this comment.
I think it's related to the fact that when we upload zip, we create 2 folders: one snapshot which can be broken glass and one is .internal which is not and contains a break glass marker and some other metadata
| ServicePrincipalName: p.ServicePrincipalName, | ||
| }) | ||
| } | ||
| return canManage |
There was a problem hiding this comment.
I ran a test and found the API rejects an empty list.
We could always include the current user, I think?
| } | ||
|
|
||
| var resp inspectSnapshotResponse | ||
| err = c.client.Do(ctx, http.MethodGet, inspectSnapshotPath, headers, nil, nil, &resp, withJSONBody(payload)) |
There was a problem hiding this comment.
This seems to do a GET with a request payload. It should use a query param.
Changes
Add support for breakglass for immutable folders
Why
Immutable folders can be "break-glassed" in an emergency. In this case, CLI should prevent a normal deploy if the previously used snapshot was broken. With --force, it should allow to deploy to a new suffixed path and the deployments after should continue as normal
Note: there is no REST API endpoint to check the status of folder yet so we use GraphQL one for now
Tests
Added an acceptance test