Skip to content

fix(cli): ignore deleted folders in the preflight folder check - #356

Merged
aghassemlouei merged 1 commit into
google:mainfrom
digitalresistor:fix/cli-preflight-deleted-folders
Oct 26, 2026
Merged

aghassemlouei merged 1 commit into
google:mainfrom
digitalresistor:fix/cli-preflight-deleted-folders

Conversation

@digitalresistor

Copy link
Copy Markdown
Contributor

Description

Stop the naming.folder preflight check from reporting a folder collision for a folder that someone already deleted.

The check searches the organization for the StellarEngine-<prefix> Assured Workloads folder. The search also returned folders in the DELETE_REQUESTED state, which keep their display name for 30 days but do not block a new folder with the same name.

  • A failed Assured Workloads workload creation leaves exactly such a folder behind, because the API creates the consumer folder and then deletes it again.
  • The next preflight run then reported a collision and suggested a different prefix, although Stage 0 could reuse the prefix.
  • The find_folders method in cli/src/stellar_engine/gcp/live.py now adds state=ACTIVE to the folder search query.
  • A new test in cli/tests/test_live.py checks the query.

No GitHub issue exists for this change. The stellar CLI work in #306 found it during a lab run.

The change needs no README update, because the preflight documentation already describes the check as a search for an existing folder.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Deployment & Compliance Impact

  • Applicable Regimes:
    • US Region Restricted (e.g., Access Policy constraint)
    • FedRAMP Moderate
    • FedRAMP High
    • DoD IL4
    • DoD IL5
    • General / All
  • NIST 800-53r5 Controls: None. The change affects only a read-only preflight check.

Checklist

Code Quality & Reusability

  • My code adheres to the Maximize Reusability principle. I have not redefined common elements and have reused existing base configurations and modules where possible.
  • I have checked that no existing module or configuration in modules/ or fast/stages-aw/ can be leveraged for this change.
  • My code follows the established naming conventions outlined in docs/naming-convention.md.

Documentation

  • I have updated the README.md of the modified module or blueprint.
  • I have added/updated documentation for inputs (variables) and outputs.

Security

  • My change adheres to GCP security best practices and the principle of least privilege.
  • I have ensured compliance with the targeted regime (FedRAMP Moderate, FedRAMP High, IL4, IL5, etc.).

Testing

  • I have tested my changes locally.
  • I have included details of my testing in this PR.

Testing Performed

  • uv run pytest in the cli/ project passes 161 tests, including the new query test.
  • ruff format --check, ruff check, and pyright pass for the cli/ project.
  • In a lab organization with three folders in the DELETE_REQUESTED state and no active folder of the same name, the Resource Manager search with state=ACTIVE returns no folder, and the search with state=DELETE_REQUESTED returns all three.
  • Before the change, preflight reported a collision for that prefix.

@github-actions github-actions Bot added the Scope - Fast Related to Fabric FAST deployment stages in the fast directory label Oct 24, 2026
@aghassemlouei aghassemlouei added Bug Something isn't working Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Priority - Medium Standard features and non-blocking bugs; important for the current milestone but not urgent labels Oct 26, 2026

@aghassemlouei aghassemlouei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified locally with pytest, ruff, and pyright. Filtering search_folders to AND state=ACTIVE cleanly prevents 30-day soft-deleted Assured Workloads folders from triggering false-positive preflight collisions while preserving DELETE_REQUESTED project ID checks.

@aghassemlouei
aghassemlouei merged commit 54943ac into google:main Oct 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Level of Effort - Low Quick, well-defined tasks with no unknowns; takes a few hours up to one day to complete Priority - Medium Standard features and non-blocking bugs; important for the current milestone but not urgent Scope - Fast Related to Fabric FAST deployment stages in the fast directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants