Skip to content

fix(variables): add --no-vars to the create commands and scope the stack picker to the organization (+Claude) - #252

Merged
Harshi-Shah-CS merged 1 commit into
v2-devfrom
cl-7169
Oct 26, 2026
Merged

Harshi-Shah-CS merged 1 commit into
v2-devfrom
cl-7169

Conversation

@Harshi-Shah-CS

Copy link
Copy Markdown
Contributor

What

Follow-up to the post-merge review of #245 (CL-7169). Two fixes:

  • --no-vars on projects:create and env:create. With no variable source given, these commands always showed the "Add environment variables" checklist on a terminal, so a create with every other value passed as a flag still stopped at a checklist. --no-vars is the flag form of the checklist's "Skip adding environment variables" choice (TRD §4.9.3: nothing is reachable through only one path). It sends an empty list without asking. Combined with --var, --dotenv or --from-stack it is a usage error (exit 2) from the new noVarsAlone rule. I didn't use oclif's exclusive, because --help would then show the three sources as excluding each other.
  • --from-stack lists only the organization's stacks. fetchStacks passed organization_uid to query(), where the SDK sends it as a plain query parameter. It now calls stack({ organization_uid }), which the SDK sends as the organization_uid header plus an org_uid query filter. StacksApi.list also drops any stack whose org_uid names another organization. V1 made the same call (base-class.ts selectStack), so this isn't a regression from feat(variables): add launch:variables list, set and unset #245.

AGENTS.md and the README (oclif readme) describe both changes. .talismanrc checksums are refreshed for the changed files it flags; projects-create.test.ts moves from per-line allowed_patterns to a checksum entry.

The review's other findings: the PUT race and the double GET were fixed in #247, and the separator split in #249. The upload-before-validation order and --dotenv being relative to the current folder are left as they are; the reasons are in the review threads.

Tests

  • New unit tests cover --no-vars parsing and noVarsAlone, variablesForCreate asking and reading nothing with --no-vars, the stack handle carrying the organization, and stacks from another organization being dropped.
  • New integration tests: a fully flagged create on a terminal with --no-vars asks nothing and sends environmentVariables: [] (projects and env), and --no-vars --var exits 2 before any request. The stack-picker mocks now expect the organization_uid header.
  • npm test: 139 suites, 2419 tests pass. Lint, tsc and build pass.
  • npm run test:coverage: every changed file is at 100%. The global branch threshold reports 99.96%, because of one uncovered branch in src/core/failure.ts:66 (handleStandaloneFailure, from fix(environments): one error line per failure, an org check on the project, and FileUpload-aware env output #248). This PR doesn't touch that file.
  • Not verified against the live API: --from-stack on an account in several organizations.

#claude_code#
🤖 Generated with Claude Code

…ack picker to the organization

Follow-up to the post-merge review of #245.

projects:create and env:create on a terminal always showed the "Add
environment variables" checklist when no variable source was given, so a
fully flagged create could not finish without someone picking Skip.
--no-vars is the flag form of that Skip choice: it sends an empty list
without asking. Combined with --var, --dotenv or --from-stack it is a
usage error from the new noVarsAlone rule; oclif's exclusive was not
used because --help would then show the three sources excluding each
other.

fetchStacks passed organization_uid to query(), where the SDK sends it as
a plain query parameter. It now scopes the stack handle with
stack({ organization_uid }), which the SDK sends as the organization_uid
header and an org_uid query filter, as the CMA documents for listing an
organization's stacks. StacksApi.list also drops any stack whose org_uid
names another organization. V1 made the same call, so this is not a
regression of #245.

AGENTS.md and the README describe --no-vars and the organization scope.

The .talismanrc checksums are refreshed for every changed file it flags
(flag names, fixture stack keys and the words error/token in prose, no
secret); projects-create.test.ts moves from per-line allowed_patterns to a
checksum entry.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Sakshi Koli <sakshi.koli@contentstack.com>
@Harshi-Shah-CS
Harshi-Shah-CS requested review from a team as code owners October 26, 2026 10:43
@snyk-io

snyk-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 1 9 25 ✅ Passed
🟡 Medium Severity 0 4 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 9
  • Medium without fixes: 4
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@Harshi-Shah-CS
Harshi-Shah-CS merged commit 697680d into v2-dev Oct 26, 2026
7 checks passed
@Harshi-Shah-CS
Harshi-Shah-CS deleted the cl-7169 branch October 26, 2026 11:23
SakshiKoli-CS added a commit that referenced this pull request Oct 26, 2026
Brings in #252 (--no-vars on the create commands, the stack picker scoped to the organization).
The only conflict was the AGENTS.md checksum in .talismanrc: both branches edited AGENTS.md in
different sections, so the merged file gets a fresh checksum rather than either side's.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Co-Authored-By: Claude <noreply@anthropic.com>
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.

3 participants