Skip to content

Fix deployment action fallback from partial Service Principal inputs - #27

Closed
ergonza93 wants to merge 1 commit into
mainfrom
ergonza93-cmr-deployment-identity-fix
Closed

ergonza93 wants to merge 1 commit into
mainfrom
ergonza93-cmr-deployment-identity-fix

Conversation

@ergonza93

Copy link
Copy Markdown
Contributor

Summary

  • Fail ms-app-deploy before launching the CLI when only some of app-id, client-secret, and tenant-id are supplied. Errors contain input names, not credential values; whitespace-only inputs count as missing through the Actions SDK's existing trimming behavior.
  • Keep complete SP inputs authoritative: override inherited SP credentials and disable higher-priority HTTP-forward/no-op providers in the deploy subprocess only. Preserve the action's own environment and existing no-input identity selection.
  • Document the boundary, regenerate the committed deployment bundle, and prepare GitHub Actions 1.0.2 with matching lockfile/changelog updates.

Validation

  • Inspected current deployment callers and CLI launch path at 1cbe5b72dc12b9f258f1ebc596d6cc69feb6d612 rather than assuming the previously inspected source was current.
  • Added 38 deterministic tests against the actual bundled action in isolated Node processes. A preload fixture intercepts child_process.spawn, records arguments/environment, and substitutes a synthetic CLI response; no real CLI, sign-in, or deployment is performed.
  • Original bundle: 8 passed / 30 failed in the expanded matrix. In the initial partial-input matrix, all 18 invalid cases actually spawned deployment.
  • Fixed bundle: 38 passed / 0 failed with cd github-actions && npm test (includes strict TypeScript compilation and rebuilding all action bundles). git diff --check passes.
  • Covers all six partial combinations in clean/cached environments, blank/whitespace inputs, complete credential overrides, no-input inheritance, deploy modes, credential-free diagnostics, and HTTP-forward/no-op truthy aliases (true, 1, yes, on, mixed case/whitespace). Verifies inherited parent environment is unchanged.

Scope and CLI boundary

This PR fixes the public CMR deployment action. It does not change ms-app-pack (local packing), global CLI/account configuration, or CLI source. The coordinated CLI change must reject incomplete inherited SP configuration and selected-SP authentication failures without cached-identity fallback. Three absent/empty secrets remain indistinguishable from intentionally omitted inputs; no-input workflows continue to delegate identity selection to the CLI. This action fix can ship independently of the CLI change; the CLI fix is required for direct CLI and inherited-environment enforcement.

Reject partial Service Principal action inputs before starting deployment and enforce explicit SP selection in the child environment. Add isolated bundled-action regression coverage and prepare GitHub Actions v1.0.2.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ergonza93
ergonza93 requested a review from a team as a code owner November 13, 2026 19:29
@ergonza93 ergonza93 closed this Nov 13, 2026
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