You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deploy-pipeline: pin --envUrl from project config + re-refresh plan after activation
Two gaps surfaced in EDM-site deploy testing (both SKILL.md-only — the helpers
already support these paths):
Fix#5 (Phase 1 Step 1): verify-alm-prerequisites.js defaulted to PAC's org
context (`pac env who`), which isn't guaranteed to match the project — and with a
stale/ambiguous context (duplicate active pac auth profiles) it failed with a
misleading "PAC CLI is not authenticated". Now resolve the project's recorded env
URL first (.solution-manifest.json top-level `environmentUrl`, else
powerpages.config.json `environmentUrl`) and pass it as --envUrl so the gate is
deterministic; fall back to the pac-context default only when neither file records
one. (verify-alm-prerequisites already skips getEnvironmentUrl() when --envUrl is
supplied — no code change.) Progress-tracking row updated to match.
Fix#7 (Phase 7.7): the Phase 7.5b plan refresh runs BEFORE activation is resolved,
so the plan's "Activate site in {stage}" step stayed pending even after
last-deploy.json recorded activationStatus. Added a second refresh-alm-plan-data.js
--phase deploy-pipeline call right after the marker is patched; its existing
auto-complete logic flips the activate step to completed when activationStatus ===
"Activated" (a deferred "Pending" correctly leaves it pending). Soft no-op when no
plan exists.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: plugins/power-pages/skills/deploy-pipeline/SKILL.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,11 +121,15 @@ Tasks to create:
121
121
122
122
Steps:
123
123
124
-
1. Run `verify-alm-prerequisites.js` to confirm PAC CLI auth, acquire a token, and verify API access:
124
+
1.**Resolve the project's configured environment URL first, then verify prerequisites against it.**`verify-alm-prerequisites.js` defaults to whatever environment PAC's *org context* is connected to (`pac env who`), which is **not** guaranteed to match the project — and when that context is stale/ambiguous (e.g. duplicate active `pac auth` profiles) it fails with a misleading *"PAC CLI is not authenticated"*. Pin the env explicitly so the gate is deterministic.
125
+
126
+
Read the project's recorded env URL (first match wins): `.solution-manifest.json` → top-level `environmentUrl`, else `powerpages.config.json` → `environmentUrl`. Store as `CONFIGURED_ENV_URL`. (Both fields are top-level `environmentUrl` strings; declarative/EDM sites have no `powerpages.config.json`, so the manifest is the source there.)
Capture output as JSON; extract `.envUrl` (store as `devEnvUrl`) and `.token` (store as `DEV_TOKEN`). If the script exits non-zero, stop and surface the error — it will indicate whether `az login`, `pac auth`, or WhoAmI failed.
131
+
132
+
(If neither file records an env URL, omit `--envUrl` and fall back to the pac-context default — `verify-alm-prerequisites.js` then resolves it via `pac env who`.) Capture output as JSON; extract `.envUrl` (store as `devEnvUrl`) and `.token` (store as `DEV_TOKEN`). If the script exits non-zero, stop and surface the error — it will indicate whether `az login`, `pac auth`, or WhoAmI failed.
129
133
130
134
2. Run `detect-project-context.js` to read project config and solution manifest:
131
135
```bash
@@ -1189,6 +1193,17 @@ Evaluate the result and take action based on the outcome. In all cases, **after
1189
1193
- `"activationStatus": "{ACTIVATION_OUTCOME.status}"` (or keep `null` if `ACTIVATION_OUTCOME` is null)
**Re-refresh the ALM plan so the activation outcome reaches it.** The Phase 7.5b refresh ran *before* activation was resolved, so the plan's "Activate site in {stage}" step is still pending even though `last-deploy.json` now records `activationStatus`. Re-run the refresh now that the marker is patched — the `deploy-pipeline` phase auto-completes the activate step when `activationStatus` is `"Activated"` (a deferred `"Pending"` correctly leaves it pending):
| Verify prerequisites | Verifying prerequisites | Run verify-alm-prerequisites.js (--require-manifest) for PAC/az/WhoAmI; run detect-project-context.js for solutionManifest/siteName; read docs/alm/last-pipeline.json for pipelineId/stages; acquire host env token |
1302
+
| Verify prerequisites | Verifying prerequisites | Run verify-alm-prerequisites.js (--require-manifest --envUrl pinned from project config) for PAC/az/WhoAmI; run detect-project-context.js for solutionManifest/siteName; read docs/alm/last-pipeline.json for pipelineId/stages; acquire host env token |
1288
1303
| Select target stage | Selecting target stage | Show available stages from docs/alm/last-pipeline.json; ask user to select target; warn if last deploy to this stage failed |
1289
1304
| Resolve pipeline info | Resolving pipeline info | Call RetrieveDeploymentPipelineInfo (v9.1) to get SourceDeploymentEnvironmentId and DeployableArtifacts; match solution |
1290
1305
| Validate package | Validating package | **`MULTI_RUN_MODE`**: run Phase 3.6 once (parallel batch) — `validate-stage-runs-batch.js` fans out create-stage-run + ValidatePackageAsync + poll-validation-status for all non-skipped solutions concurrently; halts the deploy on any failure or pending-approval batch; persists per-solution stageRunIds for the serial deploy loop to reuse. **Single-solution / legacy v2**: Phase 4 inline — POST deploymentstageruns (→ 201 or 204+header); POST ValidatePackageAsync top-level action (204); poll stagerunstatus until not 200000006; JSON.parse validationresults twice; fetch aigenerateddeploymentnotes; PATCH artifactversion + deploymentnotes + deploymentsettingsjson (from deployment-settings.json) |
0 commit comments