Skip to content

Fix as never test casts and add --page-name whitespace normalization - #4

Merged
jfallaire merged 2 commits into
codex/phase-4-cli-adapterfrom
copilot/sub-pr-3
Mar 4, 2026
Merged

jfallaire merged 2 commits into
codex/phase-4-cli-adapterfrom
copilot/sub-pr-3

Conversation

Copilot AI commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Three issues flagged in code review on the org:commerce:troubleshoot:deploy command:

  • Test config stubs used as never, defeating TypeScript's structural checks on mock Configuration objects.
  • --page-name was forwarded raw to the deployer without trimming, allowing whitespace-only values through despite the flag being required.

Changes

  • Tests: Import Configuration type and replace as never with as Configuration on both config stub callsites — compiler now catches mock/shape drift.
  • Command: Run flags.pageName through readString() (trims + returns undefined for blank) and add a this.error() guard, consistent with how organizationId and accessToken are already validated:
const hostedPageName = readString(flags.pageName);

if (!hostedPageName) {
  this.error('Missing page name. Provide a non-empty value for --page-name.');
}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.com>
Copilot AI changed the title [WIP] Add commerce troubleshoot deploy command Fix as never test casts and add --page-name whitespace normalization Mar 4, 2026
@jfallaire
jfallaire marked this pull request as ready for review March 4, 2026 21:51
@jfallaire
jfallaire merged commit 58be633 into codex/phase-4-cli-adapter Mar 4, 2026
1 of 14 checks passed
@jfallaire
jfallaire deleted the copilot/sub-pr-3 branch March 4, 2026 21:52
jfallaire added a commit that referenced this pull request Mar 4, 2026
* Add troubleshoot deploy docs

* Align release workflow with trusted‌

* Fix `as never` test casts and add `--page-name` whitespace normalization (#4)

* Initial plan

* Fix as never casts in tests and normalize pageName flag

Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.com>
jfallaire added a commit that referenced this pull request Mar 4, 2026
…ws (#5)

* Add troubleshoot deploy docs

* Align release workflow with trusted‌

* Fix `as never` test casts and add `--page-name` whitespace normalization (#4)

* Initial plan

* Fix as never casts in tests and normalize pageName flag

Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.com>

* chore: bump plugin version to 0.7.0

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jfallaire <7849359+jfallaire@users.noreply.github.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.

2 participants