Skip to content

fix: prevent orphan empty-timestamp S3 env folders - #7698

Open
gurevichdmitry wants to merge 1 commit into
mainfrom
fix/orphan-empty-timestamp-s3-env-folders
Open

fix: prevent orphan empty-timestamp S3 env folders#7698
gurevichdmitry wants to merge 1 commit into
mainfrom
fix/orphan-empty-timestamp-s3-env-folders

Conversation

@gurevichdmitry

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve TF_STATE_FOLDER / S3_BUCKET_PATH early in Create Environment (and EA) so uploads never write to DEPLOYMENT_NAME_/ when the timestamp is unset.
  • Gate Upload environment info (if: always()) on S3_BUCKET_PATH being set; reuse the resolved path for elk/CDR/CIS uploads.
  • Run Test E2E Flow destroy when setup succeeded and deploy was not skipped, so failed UI/sanity runs still clean up S3 state folders.

Test plan

  • Workflow YAML review: early Set S3 state folder precedes vault/auth; no remaining ${S3_BASE_BUCKET}/${DEPLOYMENT_NAME}_${TF_STATE_FOLDER} upload paths in create-env workflows
  • Next Test Runner / manual Create Environment: expect a single name_YYYY-MM-DD_HH-MM-SS prefix (no name_ orphan)
  • Confirm destroy still runs after a failed deploy/UI sanity job in Test E2E Flow

Made with Cursor

Resolve the S3 state prefix before auth and gate always() env_config
uploads so failures cannot create DEPLOYMENT_NAME_/ orphans. Also destroy
test-e2e environments when deploy/tests fail so state folders do not pile up.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gurevichdmitry
gurevichdmitry requested a review from a team as a code owner August 9, 2026 15:44
@mergify

mergify Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @gurevichdmitry? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

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.

1 participant