Skip to content

[nexus] add BlueprintZoneDisposition::Expunged, make disposition a column in bp_omicron_zone#5438

Merged
sunshowers merged 5 commits into
mainfrom
sunshowers/spr/nexus-db-model-make-disposition-a-column-in-bp_omicron_zone
Apr 6, 2024
Merged

[nexus] add BlueprintZoneDisposition::Expunged, make disposition a column in bp_omicron_zone#5438
sunshowers merged 5 commits into
mainfrom
sunshowers/spr/nexus-db-model-make-disposition-a-column-in-bp_omicron_zone

Conversation

@sunshowers

@sunshowers sunshowers commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

This PR (finally) adds a BlueprintZoneDisposition::Expunged enum, along with database support for it by making the disposition a column.

We also drop the bp_omicron_zones_not_in_service table -- we don't bother to check for its contents because we aren't ever setting any zones as quiesced on customer sites currently.

I've also included a Diesel extension to allow easily filtering against BlueprintZoneDispositions, along with an example query for it.

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Comment thread schema/crdb/blueprint-disposition-column/up2.sql
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the base branch from sunshowers/spr/main.nexus-db-model-make-disposition-a-column-in-bp_omicron_zone to main April 5, 2024 22:27
@sunshowers sunshowers changed the title [nexus-db-model] make disposition a column in bp_omicron_zone [nexus] add BlueprintZoneDisposition::Expunged, make disposition a column in bp_omicron_zone Apr 5, 2024
@sunshowers sunshowers marked this pull request as ready for review April 5, 2024 22:32
Created using spr 1.3.6-beta.1

@andrewjstone andrewjstone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff @sunshowers

let row_blueprint = DbBlueprint::from(blueprint);
let blueprint_id = row_blueprint.id;

// `Blueprint` stores the policy for each zone next to the zone itself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty awesome how you can get rid of all this code without any additions now that the disposition is just a column on bp_omicron_zone :)

@sunshowers sunshowers enabled auto-merge (squash) April 6, 2024 02:46
@sunshowers sunshowers merged commit 88f327d into main Apr 6, 2024
@sunshowers sunshowers deleted the sunshowers/spr/nexus-db-model-make-disposition-a-column-in-bp_omicron_zone branch April 6, 2024 02:53
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