Skip to content

Fix deployment plan selection for the active session - #1999

Open
Nathan (nturinski) wants to merge 4 commits into
mainfrom
nturinski-fix-1894-active-deployment-plan
Open

Nathan (nturinski) wants to merge 4 commits into
mainfrom
nturinski-fix-1894-active-deployment-plan

Conversation

@nturinski

Copy link
Copy Markdown
Member

Summary

Fix #1894

  • Select prepare-plan.json from the active-session pointer, with a session-identity-verified root fallback. Use deterministic mtime recovery only for absent, invalid, or stale pointers; do not substitute another plan while an active session is pending.
  • Validate session path segments and handle multi-root workspaces. Filter inactive watcher events, guard delayed async opens and pointer switches, and close obsolete plans when the selected session is still preparing.
  • Preserve approval state keyed by artifact path and exact content. Include focused resolver/view regression tests, user/security documentation, and an issue-linked changelog entry under Unreleased / Fixed.

This PR is based directly on main and is independent of documentation-only PR #1995. No agent instruction changes are included. Intended release: 0.13.3.

Validation

  • npm run build — passed.
  • npx --no-install eslint --max-warnings 0 src\tree\project\findAppOnboardArtifact.ts src\webviews\copilotOnRails\extension\openDeploymentPlanView.ts src\webviews\copilotOnRails\extension\utils\singletonViewHost.ts test\copilotOnRails\findAppOnboardArtifact.test.ts test\copilotOnRails\deploymentPlanSessionSelection.test.ts — passed.
  • npm test -- --run test\copilotOnRails\findAppOnboardArtifact.test.ts test\copilotOnRails\deploymentPlanSessionSelection.test.ts test\copilotOnRails\parsePreparePlanJson.test.ts test\copilotOnRails\deployPrerequisites.test.ts --reporter dot — 71 passing in VS Code 1.144.0 on Windows.
  • git diff --check and staged whitespace/line-ending checks — passed; changed files use LF.
  • Prior actual Extension Development Host UI verification on Windows reproduced the original wrong-session selection and confirmed the transferred fix selects the active plan, preserves editor focus and the active plan during inactive updates/creates, and updates the open view on pointer switches. Environment: Azure Resources 0.13.2, VS Code 1.144.0, Electron 43.8.3, Node 24.22.1, Playwright 1.64.1, signed-out isolated profiles and synthetic data.

No deployment approval or Azure resource operations were performed. macOS/Linux and signed-in deployments are not claimed verified. Screenshots remain local and are not published in this PR. No screen layout or controls changed; the existing deployment-plan screenshot layout remains applicable.

Resolve the active session before timestamp recovery and prevent inactive plans or delayed opens from replacing the selected plan. Preserve artifact-scoped approvals and document recovery behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 19:07
@nturinski
Nathan (nturinski) requested a review from a team as a code owner October 30, 2026 19:07
@nturinski Nathan (nturinski) added this to the 0.13.3 milestone Oct 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved watcher gaps and refresh races can leave stale plans available for approval or incorrectly close a newly opened valid plan view.

4 open issues
What changed in this PR

Addresses #1894 by making deployment-plan selection follow the active App Onboard session rather than modification time, with recovery when the session pointer is unavailable or stale.

Changes:

  • Adds a shared resolver with session-path validation, verified root fallback, and deterministic recovery.
  • Filters plan events and guards delayed opens, closing obsolete plans while the selected session is preparing.
  • Adds resolver/view regression tests, user and security documentation, and a changelog entry.

Screenshot follow-up: Refresh 10-deployment-plan-view.png to illustrate active-session behavior; layout and controls are unchanged. No screenshot placeholders were added or removed.

File Description
test/​copilotOnRails/​findAppOnboardArtifact.test.ts Tests session selection, recovery, validation, and multiple roots.
test/​copilotOnRails/​deploymentPlanSessionSelection.test.ts Tests watcher behavior, delayed opens, and approval preservation.
src/​webviews/​copilotOnRails/​extension/​utils/​singletonViewHost.ts Adds explicit panel closure.
src/​webviews/​copilotOnRails/​extension/​openDeploymentPlanView.ts Integrates session-aware selection and view refresh handling.
src/​tree/​project/​findAppOnboardArtifact.ts Adds the shared active-session artifact resolver.
docs/​copilot-create-project.md Documents selection, recovery, and pending-session behavior.
docs/​copilot-create-project-security.md Documents session-path and fallback-identity validation.
CHANGELOG.md Adds an issue-linked Unreleased fix entry.

Review effort: Balanced

Nathan (nturinski) and others added 3 commits November 2, 2026 11:15
Watch every workspace root, reject stale selection results, reload reused root plans, and read completed artifacts after region discovery. Add regressions and update the deployment-plan guide.

Co-authored-by: Copilot App <223556219+Copilot@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.

[CoR] Resolve deployment plans from the active session

2 participants