ROX-33816: deployment datastore support for soft deletes#20015
Draft
stehessel wants to merge 12 commits intoROX-33816/soft-deletes-db-migrationfrom
Draft
ROX-33816: deployment datastore support for soft deletes#20015stehessel wants to merge 12 commits intoROX-33816/soft-deletes-db-migrationfrom
stehessel wants to merge 12 commits intoROX-33816/soft-deletes-db-migrationfrom
Conversation
|
Skipping CI for Draft Pull Request. |
522ccb8 to
90048bc
Compare
02f70ba to
011f0e7
Compare
Contributor
🚀 Build Images ReadyImages are ready for commit bb40042. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-680-gbb40042bed |
90048bc to
4c83dd0
Compare
23ecb01 to
8f8fba3
Compare
4c83dd0 to
d702474
Compare
8f8fba3 to
f7af9d5
Compare
d986287 to
8e552f2
Compare
3b04417 to
4cac521
Compare
d29d52b to
9e736fa
Compare
4cac521 to
b468d8a
Compare
9e736fa to
20dcd65
Compare
fce7186 to
238cbf5
Compare
20dcd65 to
8992b27
Compare
d4a6876 to
dd8ec2d
Compare
8992b27 to
b357241
Compare
Replace incorrect `Deployment_STATE_*` with correct `DeploymentState_STATE_*` in files that were not caught during the interactive rebase. Affected files: - central/deployment/datastore/datastore.go - central/deployment/datastore/datastore_impl.go - pkg/protoconv/resources/resources_test.go Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When a deployment is soft-deleted, it should be immediately removed from all ranking systems to ensure ranking data reflects only active deployments. Changes: - Remove deployment from deploymentRanker when soft-deleted - Update namespace ranker by subtracting the deployment's risk score - Update cluster ranker by subtracting the deployment's risk score This ensures consistency with query filtering (which excludes deleted deployments) and prevents ranking data from including stale deployments. User request: "should soft deleted deployments be immediately removed from the deploymentranker?" Why: Namespace and cluster rankers were not being updated when deployments were soft-deleted, leading to incorrect aggregate risk scores that included deleted deployments. The deployment ranker also retained entries for soft-deleted deployments despite them being filtered from all queries. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed the GraphQL deployment loader's CountAll method to count deployments across all states (active and soft-deleted) instead of only active deployments. Rationale: The name "CountAll" semantically implies counting everything, while CountFromQuery is available for filtered counts. This makes the API more intuitive: - CountAll() → all deployments regardless of state - CountFromQuery(query) → filtered deployments (can include active filter) Note: CountAll is currently unused in the codebase but is part of the common loader interface pattern. If it's ever used in the future, it will now return the total count across all states as the name implies. User request: "let CountAll actually count all deployments of all states - including soft deleted ones." Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
dd8ec2d to
a78082d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Mark removed deployments as soft deleted and set the state. Query for active deployments where deleted deployments should be ignored.
User-facing documentation
Testing and quality
Automated testing
How I validated my change
change me!