Skip to content

fix(cli): drop cache:purge --prefix, let --port beat PORT, and note the 24h server-log limit - #304

Open
SakshiKoli-CS wants to merge 5 commits into
v2-devfrom
CL-8965
Open

SakshiKoli-CS wants to merge 5 commits into
v2-devfrom
CL-8965

Conversation

@SakshiKoli-CS

Copy link
Copy Markdown
Contributor

Ticket: CL-8965

What

Brings three commands' help in line with the public V2 command reference.

  • launch:cache:purge: --prefix removed. It only worked alongside --path. Ending the path with /* already sends the same request ({ path: "/blog", isPrefix: true }), so that is now the only way to ask for a prefix match. --prefix is refused as an unknown flag (exit 2) before any request is sent. The interactive "Purge everything under this path?" question stays, because it is a prompt, not a flag. The --path help no longer offers /* for the whole site; the docs point to --hosts for that. onlyWithFlag had no other caller, so it is removed too.
  • launch:functions:serve: an explicit --port now beats PORT. Before, process.env.PORT || flags.port let a PORT left in the shell silently override the port you typed, and --help never mentioned it. The flag now declares env: 'PORT', so oclif applies the usual order (flag, then PORT, then 3000), and --help shows [default: 3000, env: PORT]. An empty PORT falls back to 3000. A whitespace or out-of-range PORT is still refused. This restores af781e3, which bf9a139 reverted to match V1.
  • launch:logs:get: --since help mentions the 24-hour server-log limit, and the listed formats drop 2d, since a two-day window can never return two days of logs. 2d still parses.
  • README: regenerated for these three commands only. The rest of the README has drifted from the generated output and is left for a separate change.

Release notes

  • launch:cache:purge --prefix was removed. Use --path "/blog/*" instead.
  • launch:functions:serve: --port now takes priority over the PORT environment variable. V1 did the opposite.

Tests

  • Unit and integration tests were updated for each change:
    • --prefix is rejected with exit 2 and no request is sent.
    • Port precedence: flag beats PORT, PORT is used when no flag is given, an empty PORT falls back to 3000, and invalid PORT values are rejected.
    • The new --since help text.
  • npm test: 201 suites, 4091 tests, all passing.
  • npm run lint: clean.
  • tsc --noEmit: clean.
  • Every commit went through the pre-commit hook (lint-staged, Talisman, TruffleHog, Snyk).

#claude_code#
🤖 Generated with Claude Code

SakshiKoli-CS and others added 5 commits November 25, 2026 07:24
…prefix form

--prefix only worked alongside --path, a flag-under-a-flag that the
reference had to explain twice. Ending the path with /* already sends the
same request, { path: "/blog", isPrefix: true }, in one call, so --prefix
is removed and is now refused as an unknown flag, exit 2, before any
request. The interactive "Purge everything under this path?" question
stays: it is a prompt, not a flag.

The --path help no longer offers /* for the whole site; whole-site purges
are documented through --hosts. onlyWithFlag had no other caller and goes
with it.

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

Co-Authored-By: Claude <noreply@anthropic.com>
serve read process.env.PORT || flags.port, so a PORT left in the shell
silently overrode the port the user typed, and --help never mentioned PORT.
The flag now declares env: 'PORT', so oclif applies the order every other
flag has - the flag, then PORT, then 3000 - and --help shows
"[default: 3000, env: PORT]". An empty PORT falls through to 3000; a
whitespace or out-of-range PORT is still refused with the invalid-port
message. This restores af781e3, which bf9a139 reverted to match V1; the
change from V1 goes in the V2 release notes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
The 24-hour lookback only surfaced at run time, as the clamp warning.
--since now says so up front, and the window formats list drops 2d, which
can never return two days of server logs. 2d still parses.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Only the three command sections this change touches; the rest of the
generated README drift is left for its own change.

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

Co-Authored-By: Claude <noreply@anthropic.com>
rules.ts, rules.test.ts, logs.inputs.test.ts and README.md already carry
entries; editing them changed their checksums, so Talisman re-flagged the
existing "key"-word false positives (keys.map(...), oneOfMessage(keys, ...)).
No new pattern is allowed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@SakshiKoli-CS
SakshiKoli-CS requested review from a team as code owners November 25, 2026 02:28
@snyk-io

snyk-io Bot commented Nov 25, 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 0 2 25 ✅ Passed
🟡 Medium Severity 0 1 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: 2
  • Medium without fixes: 1
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

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