add genericdocument compatible serialization of clusters#5095
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Cosmos cluster serialization toward a GenericDocument-compatible shape and adjusts integration test artifacts/comparers to tolerate newly surfaced non-deterministic fields (notably for resolving an etag-related diff issue).
Changes:
- Inline
api.HCPOpenShiftClusterintoHCPClusterPropertiesand populate it duringInternalToCosmosCluster. - Scrub selected operational/UUID-derived fields during cluster-to-cosmos conversion to keep documents deterministic across runs.
- Update integration test comparison helper and many stored Cosmos artifact JSON snapshots to match the new document shape.
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test-integration/utils/databasemutationhelpers/per_resource_comparer.go | Ignores additional variable fields now exposed by inline cluster serialization (e.g., properties.systemData.*, properties.serviceProviderProperties.clusterUID). |
| internal/database/types_hcpcluster.go | Embeds api.HCPOpenShiftCluster into HCPClusterProperties for forward migration toward GenericDocument-like storage. |
| internal/database/convert_cluster.go | Populates the inline cluster content and scrubs some operational fields; adjusts CosmosETag plumbing. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/09-cosmosCompare-confirm-update/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/read-old-data/01-load-old-data/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/NodePool/create-current/06-cosmosCompare-confirm-content/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/18-cosmosCompare-confirm/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/read-new-data/01-load-old-data/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/99-cosmosCompare-confirm-migration/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Migration/migrate-old-data/01-load-old-data/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/09-cosmosCompare-confirm-update/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/read-old-data/01-load-old-data/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/ExternalAuth/create-current/06-cosmosCompare-ending-content/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/read-old-data/09-cosmosCompare-confirm-update/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/read-old-data/01-load-old-data/create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-nodepool-operation/05-cosmosCompare-final-state/cluster-test-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/delete-with-pending-cluster-operation/03-cosmosCompare-final-state/cluster-test-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/create-current/09-cosmosCompare-confirm-update/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/Cluster/create-current/02-cosmosCompare-confirm-content/cluster-create-with-tags.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/FrontendCRUD/AdminCredentials/revoke-provisioning-conflict/01-load-initial-cosmos-state/01-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/12-untypedList-resourcegroup/create-with-tags-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/10-untypedList-resourcegroup/create-with-tags-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/07-untypedListRecursive-resourcegroup-via-child/create-with-tags-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/05-untypedListRecursive-subscription/create-with-tags-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/04-untypedListRecursive-resourcegroup/create-with-tags-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/frontend/artifacts/DatabaseCRUD/UntypedCRUD/basic/01-load-initial/create-with-tags-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/99-cosmosCompare-end-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/remove_orphaned_nodepool_descendents/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/99-cosmosCompare-end-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/nodepool/present_nodepool/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/99-cosmosCompare-end-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/remove_orphaned_externalauth_descendents/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/99-cosmosCompare-end-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/externalauth/present_externalauth/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/controller_under_missing_nodepool_deleted/99-cosmosCompare-end-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/controller_under_missing_nodepool_deleted/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/99-cosmosCompare-end-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/delete_orphaned_cosmos/all_parents_exist/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/99-cosmosCompare-end-state/cluster-safe.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/cluster/remove_orphaned_cluster_descendents/00-load-initial-state/cluster-safe.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/cluster/present_cluster/99-cosmosCompare-end-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/mismatches/artifacts/cluster/present_cluster/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/backend/controllers/do_nothing/artifacts/sync_cluster/00-load-initial-state/cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/admin/artifacts/AdminCRUD/HCP/lowercase-middleware/00-load-initial-cosmos-state/01-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/admin/artifacts/AdminCRUD/HCP/hello-world/00-load-initial-cosmos-state/01-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/admin/artifacts/AdminCRUD/HCP/cosmosdump/00-load-initial-cosmos-state/01-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
| test-integration/admin/artifacts/AdminCRUD/HCP/breakglass/00-load-initial-cosmos-state/01-cluster.json | Updates expected Cosmos document snapshot to include inline cluster fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0428389 to
227822c
Compare
227822c to
44e3c7b
Compare
|
/retest |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, mbarnes The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This stores all the data necessary to switch from custom cluster storage to the generic document storage for clusters.
Part of a multi-step plan