ensure-pipelines-host: ship Platform Host getOrCreate as Phase 4.0 - #145
Merged
T-Nid (tyaginidhi) merged 1 commit intoMay 7, 2026
Conversation
Promotes the BAP getOrCreate Platform-Host fast-path from "deferred / future iteration" to a shipped first-position option in the NoHost menu. For first-time tenants this is the lowest-friction path — no admin role required, idempotent, ~3-5 min — replacing the prior workaround of sending the user to make.powerapps.com to trigger PE provisioning. Phase 3.C menu restructured: 1. Provision a Platform Host (recommended) — NEW, calls getOrCreate 2. Set up a Custom Host — sub-prompt: existing env / create-new / Back 3. Open PPAC manually 4. Cancel New helper provision-platform-host.js mirrors provision-custom-host.js but targets /getOrCreate with a Platform/D365_1stPartyAdminApps body. Returns alreadyExisted=true on the 200 idempotent path (existing PE returned) or alreadyExisted=false on the 202 + Location-poll path. Wrong-tenant safety: Phase 1.4 tenant-identity gate now resolves and echoes the tenant display name (via Microsoft Graph) alongside the tenant GUID, and Phase 4.0 echoes them again in a non-skippable pre-call confirmation gate before invoking getOrCreate. PE is tenant-singleton + admin-non-deletable; idempotency + the two gates are the principal mitigations. plan-alm Q4 NoHost menu mirrors the new shape with a WILL_PROVISION_PLATFORM aux flag threaded through hostResolution.willProvisionPlatform so ensure-pipelines-host skips its 3.C re-prompt at execution time. Also drops --allow-no-subscriptions from getAuthToken's az invocation (get-access-token rejects it on recent CLI versions; the flag is only valid on az login / az account show), updates AGENTS.md guidance, and fixes the same flag misuse on az account show in activate-site/SKILL.md. Plugin bumped 1.3.0 -> 1.4.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
T-Nid (tyaginidhi)
merged commit May 7, 2026
5fff6d7
into
users/nityagi/PowerPagesALM
1 check passed
Merged
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes the BAP
getOrCreatePlatform-Host fast-path from "deferred / future iteration" to a shipped first-position option in theNoHostmenu ofensure-pipelines-hostPhase 3.C. For first-time tenants this is the lowest-friction path — no admin role required, idempotent, ~3–5 min — replacing the prior workaround of sending the user tomake.powerapps.comto trigger PE provisioning manually and re-run the skill.Phase 3.C menu — before vs after
Before (4 flat options):
After (Platform Host promoted to first position; the two Custom Host paths collapsed under one entry with a sub-prompt):
getOrCreate, idempotent, no admin roleWrong-tenant safety
PE is tenant-singleton and admin-non-deletable, so wrong-tenant provisioning is the highest-blast-radius action this skill takes. Mitigations:
/v1.0/organization) and echoes it alongside the tenant GUID + dev env URL.getOrCreatecall.getOrCreatereturns the existing PE (200 +alreadyExisted=true) on a tenant that already has one, rather than creating a duplicate.plan-alm parity
plan-alm Phase 2 Q4 NoHost menu mirrors the new top-level shape and Custom Host sub-prompt. New
WILL_PROVISION_PLATFORMaux flag is threaded throughhostResolution.willProvisionPlatformin.last-pipeline.jsonsoensure-pipelines-hostskips its 3.C re-prompt at execution time.render-alm-plan.jsadds a host-card render arm for the new flag.Bonus fixes (separate from the feature)
--allow-no-subscriptionsfromgetAuthToken'saz account get-access-tokencall — recent CLI versions reject the flag as an unrecognized argument on this subcommand, which was causingverify-alm-prerequisites.jsto silently return null tokens. AGENTS.md guidance updated; same flag misuse fixed onaz account showinactivate-site/SKILL.md. (Note: PR Stop passing --allow-no-subscriptions to non-login az commands #143 shipped the same fix onmainyesterday — this PR re-applies it on the PowerPagesALM branch since main hasn't been merged in yet.)Test plan
node --test plugins/power-pages/scripts/tests/provision-platform-host.test.js— 20 new tests covering 200/202/403/401/400/timeout/transport-error/5xx-transient paths and URL/body/template invariantsnode --test plugins/power-pages/scripts/tests/refresh-alm-plan-data.test.js— assertions for newwillProvisionPlatformflag in post-run resetnode --test plugins/power-pages/scripts/tests/render-alm-plan.test.js— new fixture covering thewillProvisionPlatform === truehost-card render branchnode --test plugins/power-pages/scripts/tests/validation-helpers.test.js— assertion inverted (helper must NOT pass--allow-no-subscriptions)render-alm-plantests unrelated to this work (verified viagit stash— same 5 fail at HEAD)alreadyExisted: truealreadyExisted: falsehostResolution.willProvisionPlatform = truelands in.alm-plan-data.jsonand the rendered host cardFiles changed (13)
plugins/power-pages/scripts/lib/provision-platform-host.jsplugins/power-pages/scripts/tests/provision-platform-host.test.jsplugins/power-pages/skills/ensure-pipelines-host/SKILL.mdplugins/power-pages/skills/plan-alm/SKILL.mdplugins/power-pages/skills/plan-alm/scripts/render-alm-plan.jswillProvisionPlatformrender armplugins/power-pages/scripts/lib/refresh-alm-plan-data.jsplugins/power-pages/scripts/tests/refresh-alm-plan-data.test.jsplugins/power-pages/scripts/tests/render-alm-plan.test.jsplugins/power-pages/scripts/lib/validation-helpers.js--allow-no-subscriptionsfromgetAuthTokenplugins/power-pages/scripts/tests/validation-helpers.test.jsplugins/power-pages/skills/activate-site/SKILL.mdaz account showplugins/power-pages/AGENTS.mdplugins/power-pages/.claude-plugin/plugin.json🤖 Generated with Claude Code