Skip to content

Add smart support for resuming projects with Copilot on Rails#1443

Merged
MicroFish91 merged 11 commits into
mainfrom
mwf/support-brownfield
May 13, 2026
Merged

Add smart support for resuming projects with Copilot on Rails#1443
MicroFish91 merged 11 commits into
mainfrom
mwf/support-brownfield

Conversation

@MicroFish91
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 13, 2026 18:22
@MicroFish91 MicroFish91 requested a review from a team as a code owner May 13, 2026 18:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the “Copilot on Rails” project-creation workflow by detecting existing plan files in the workspace and offering a resume path (continue with local development or deployment) instead of always starting from scratch.

Changes:

  • Add resume logic to createProjectWithCopilot by detecting prior scaffold/local-dev completion via plan markdown files.
  • Ensure a fresh Copilot Chat session is created when launching the scaffold agent from the “Create with Copilot” webview.
  • Expose “Create Project with Copilot…” as an item in the Workspace tree; align deploy hand-off prompts; update dependency manifest/lockfile accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts Detects previous plan phases and offers resume actions; otherwise opens the create-project webview.
src/webviews/copilotOnRails/extension/controllers/CreateProjectViewController.ts Opens a new chat before launching the scaffold agent mode.
src/tree/workspace/WorkspaceResourceTreeDataProvider.ts Adds a Workspace tree item to start “Create Project with Copilot…”.
src/commands/registerCommands.ts Updates default deployment hand-off prompt wording.
resources/agents/azure-local-debug.agent.md Keeps the hand-off command args aligned with updated deploy prompt wording.
package.json Removes direct dependency on @microsoft/applicationinsights-common.
package-lock.json Reflects updated dependency graph (notably @vscode/extension-telemetry and transitive AppInsights packages).
Comments suppressed due to low confidence (1)

src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts:67

  • hasCompletedPhase reads the detected plan file without any error handling. If the file exists but can’t be read (permissions, transient FS error), the whole command will reject and prevent users from starting/resuming project creation. Consider wrapping the read/parse in a try/catch and treating failures as “phase not completed” (or showing a targeted message).
async function hasCompletedPhase(filePath: string, expectedStatus: string): Promise<boolean> {
    const files = await vscode.workspace.findFiles(filePath);
    if (!files.length) {
        return false;
    }

    const content = Buffer.from(await vscode.workspace.fs.readFile(files[0])).toString('utf-8');
    return new RegExp(`status.*:.*${expectedStatus}`, 'i').test(content);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts Outdated
alexweininger
alexweininger previously approved these changes May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

Comments suppressed due to low confidence (1)

src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts:67

  • hasCompletedPhase takes the first URI returned by vscode.workspace.findFiles(...) and ignores the rest. In workspaces with multiple matching plan files (e.g., multiple apps or stale plans), this can select an arbitrary file and resume the wrong phase. Iterate all matches and return true if any matching file has the expected status (or disambiguate via quick pick / preference order).
async function hasCompletedPhase(filePath: string, expectedStatus: string): Promise<boolean> {
    const files = await vscode.workspace.findFiles(filePath);
    if (!files.length) {
        return false;
    }

    const content = Buffer.from(await vscode.workspace.fs.readFile(files[0])).toString('utf-8');
    return new RegExp(`status.*:\\s*${expectedStatus}`, 'i').test(content);
  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment thread src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts Outdated
Comment thread src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts Outdated
@MicroFish91 MicroFish91 disabled auto-merge May 13, 2026 19:21
Comment thread src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts Outdated
Comment thread src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts Outdated
@MicroFish91 MicroFish91 enabled auto-merge (squash) May 13, 2026 19:29
@MicroFish91 MicroFish91 merged commit aed1163 into main May 13, 2026
3 checks passed
@MicroFish91 MicroFish91 deleted the mwf/support-brownfield branch May 13, 2026 19:29
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.

5 participants