fix: prevent cleanup from deleting shared org - #1295
Merged
Conversation
Multiple PRs deploy into SAP_autoscaler_tests_OSS. Previously, any PR's cleanup step would unconditionally delete the org if it existed, destroying all other running PR deployments. Guard org deletion with a name check: only delete the org when AUTOSCALER_ORG == DEPLOYMENT_NAME (meaning the org was purpose-built for this deployment). When using a shared org, the names differ and cleanup skips the deletion.
asalan316
approved these changes
Jun 25, 2026
asalan316
left a comment
Contributor
There was a problem hiding this comment.
approving but there are some sonar qube finding
bonzofenix
enabled auto-merge (squash)
June 25, 2026 18:12
|
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.



Problem
Multiple PRs deploy into the shared org
SAP_autoscaler_tests_OSS. The cleanup step inscripts/common.shunconditionally deletes whatever orgAUTOSCALER_ORGpoints to — if one PR's cleanup runs, it destroys the shared org and all other running PR deployments lose their space and service broker registrations.Root Cause
Traced via CI logs: the
mainbranch run's Cleanup step (run 28087413541, June 24 09:40–09:46) deleted the previous org. Thensplit/ci-workflowsPR #1268's Deploy step (run 28091226510, 10:15:58) recreated it viafind_or_create_org(). Any subsequent PR cleanup would delete it again.Fix
Guard org deletion with a name check: only delete the org when
AUTOSCALER_ORG == DEPLOYMENT_NAME(meaning the org was purpose-built for this deployment). When using a shared org, the names differ (SAP_autoscaler_tests_OSSvsautoscaler-mta-{PR}) and cleanup skips the deletion.Verification