Skip to content

[NCX-46] Two-part Config Flag setup for Requiring Orgs During Site Creation#2781

Open
IndigoW0lf wants to merge 3 commits intopantheon-systems:4.xfrom
IndigoW0lf:kai-ncx-46
Open

[NCX-46] Two-part Config Flag setup for Requiring Orgs During Site Creation#2781
IndigoW0lf wants to merge 3 commits intopantheon-systems:4.xfrom
IndigoW0lf:kai-ncx-46

Conversation

@IndigoW0lf
Copy link
Copy Markdown
Member

@IndigoW0lf IndigoW0lf commented Feb 11, 2026

Summary

Adds two feature flags to support the gradual rollout of requiring --org for site creation. This helps customers migrate away from personal workspace site creation before it's fully deprecated platform-wide.

Background

Personal workspaces are being deprecated. When that happens, all site creation will require an organization. These flags let us warn customers first, then enforce the requirement when the platform is ready.

How It Works

Flag 1: TERMINUS_SITE_CREATE_WARN_ORG (the gentle nudge)

  • Shows a deprecation warning when someone runs site:create without --org
  • Site creation still works
  • Gives customers time to update their scripts and automation

Flag 2: TERMINUS_SITE_CREATE_REQUIRE_ORG (the enforcement)

  • Blocks site creation when --org is missing in non-interactive mode
  • In interactive mode, prompts user to select an organization (removes 'None' option via Interacter)
  • Returns a clear error message for automation/scripts
  • Turns on when we're ready to enforce platform-wide

Why Two Flags?

Having separate flags means we can roll this out in phases instead of breaking everyone's scripts at once. We can turn on warnings early while customers update their automation, then flip the enforcement flag later when the API is ready to reject orgless sites.

Implementation

Rollout Plan

  1. Turn on warnings with coordinated customer communication
  2. Give customers time to update scripts and CI pipelines
  3. Turn on enforcement when API is ready to block orgless creation globally
  4. API enforcement will catch all Terminus versions (old and new)

Important Notes

  • No breaking changes to command signature (still using options, not positional params)
  • Customers with automation need to add --org to their scripts before enforcement
  • Interactive users will get an org selection prompt during Phase 2 (no 'None' option)
  • API-level enforcement will handle customers on older Terminus versions
  • Coordinated with PDE for customer communications

Tests

  • testSiteCreateWarnsWhenOrgMissingAndWarnFlagEnabled: Warning shows up correctly
  • testSiteCreateRequiresOrgWhenRequireFlagEnabled: Blocking works as expected

References

IndigoW0lf and others added 3 commits February 9, 2026 16:26
- Introduced the `TERMINUS_SITE_CREATE_REQUIRE_ORG` flag in `constants.yml` to control the requirement of an organization during site creation.
- Updated `CreateCommand` to warn users when the organization parameter is missing if the feature flag is enabled.
- Modified `Interacter` to enforce organization selection based on the new feature flag.
- Added a functional test to verify the warning behavior when the organization is not provided and the flag is enabled.
- Updated feature flags in `constants.yml` to introduce `TERMINUS_SITE_CREATE_WARN_ORG` for deprecation warnings and retain `TERMINUS_SITE_CREATE_REQUIRE_ORG` for future enforcement.
- Modified `CreateCommand` to implement phased organization requirement checks, providing warnings and exceptions based on the respective flags.
- Added a new test to verify the enforcement of organization requirement when the corresponding flag is enabled.
@IndigoW0lf IndigoW0lf self-assigned this Feb 11, 2026
@IndigoW0lf IndigoW0lf requested a review from a team as a code owner February 11, 2026 00:02
// Phase 1: Warn about org requirement when feature flag is enabled.
if ($this->config->get('site_create_warn_org') && empty($options['org'])) {
$this->log()->warning(
'Creating sites without an organization will be deprecated. ' .
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.

Deprecated == strongly discouraged. Use "removed" or "disabled" or "disallowed" when talking about future status. In the present, creating sites without an organization should be described as deprecated right now, because we want to start training people towards the new model.

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.

2 participants