From f638a7e164ace4ca0d086154ffcc664408460bb4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 05:29:50 +0000 Subject: [PATCH 1/5] Initial plan From 9cf7e2df3c30f0714b6a9e2e9f54ea1e0ea71189 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 05:32:18 +0000 Subject: [PATCH 2/5] Add automated deployment workflow and documentation Co-authored-by: asperpharma <252395498+asperpharma@users.noreply.github.com> --- .github/workflows/deploy.yml | 59 ++++++++++++++++++++++++++ README.md | 2 +- docs/deployment-flow.md | 80 ++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..178bdf1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,59 @@ +name: Deploy to Production + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Install vsce + run: npm install -g @vscode/vsce + + - name: Get version from package.json + id: package + run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT + + - name: Package extension + run: vsce package + + - name: Publish to VS Code Marketplace + if: github.event_name == 'push' + run: vsce publish -p ${{ secrets.VSCE_PAT }} + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} + + - name: Create GitHub Release + if: github.event_name == 'push' + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.package.outputs.version }} + name: Release v${{ steps.package.outputs.version }} + body: | + Automated release from main branch + + See [CHANGELOG.md](CHANGELOG.md) for details. + files: | + *.vsix + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 3184ab4..b483c42 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ from module.name import ( ## Documentation -- [Deployment Flow](docs/deployment-flow.md) - Guide for building, testing, and publishing the extension +- [Deployment Flow](docs/deployment-flow.md) - Guide for building, testing, and publishing the extension (includes automated deployment via GitHub Actions) - [Health Check](docs/health-check.md) - Monitoring and verification procedures for extension health ## Miscellaneous diff --git a/docs/deployment-flow.md b/docs/deployment-flow.md index 66ffb60..35f311b 100644 --- a/docs/deployment-flow.md +++ b/docs/deployment-flow.md @@ -6,6 +6,49 @@ This document describes the deployment process for the Python Path VS Code exten The Python Path extension is published to the Visual Studio Code Marketplace. The deployment flow involves building, testing, packaging, and publishing the extension. +## The Launch Trigger: Deploy to Production + +Your code is ready. You just need to push the "Start" button. + +### Automated Deployment + +The repository is configured with GitHub Actions to automatically deploy the extension to production when changes are merged to the main branch. + +**Action:** Merge your changes to the main branch on GitHub. + +**Methods:** +- Click "Merge Pull Request" in the GitHub UI +- Or use the command line: + ```bash + git checkout main + git merge your-feature-branch + git push origin main + ``` + +**Result:** This signals GitHub Actions to automatically: +1. Run all tests to ensure code quality +2. Build and package the extension +3. Publish the new version to the VS Code Marketplace +4. Create a GitHub release with the packaged `.vsix` file + +**Prerequisites for Automated Deployment:** +- The `VSCE_PAT` secret must be configured in the repository settings +- All tests must pass +- The version in `package.json` must be higher than the currently published version + +**Monitoring the Deployment:** +- Navigate to the "Actions" tab in the GitHub repository +- Find the workflow run triggered by your merge +- Monitor the deployment progress and check for any errors +- Once complete, verify the new version on the VS Code Marketplace + +**Manual Override:** +If you need to trigger the deployment workflow manually without merging to main, you can use the "workflow_dispatch" event: +- Go to Actions tab in GitHub +- Select "Deploy to Production" workflow +- Click "Run workflow" +- Choose the branch and click "Run workflow" + ## Prerequisites Before deploying, ensure you have: @@ -159,6 +202,43 @@ For automated deployments: vsce publish -p $VSCE_PAT ``` +### GitHub Actions Automated Deployment + +The repository includes a GitHub Actions workflow (`.github/workflows/deploy.yml`) that automatically deploys the extension when changes are merged to the main branch. + +**Setup Steps:** + +1. **Configure the VSCE_PAT secret:** + - Generate a Personal Access Token (PAT) from Azure DevOps with Marketplace publishing permissions + - Go to your GitHub repository > Settings > Secrets and variables > Actions + - Click "New repository secret" + - Name: `VSCE_PAT` + - Value: Your Personal Access Token + - Click "Add secret" + +2. **Workflow Triggers:** + - **Automatic:** Triggers on push to `main` branch + - **Manual:** Can be triggered manually via the Actions tab using workflow_dispatch + +3. **Workflow Steps:** + - Checks out the code + - Sets up Node.js environment + - Installs dependencies + - Runs tests + - Packages the extension + - Publishes to VS Code Marketplace + - Creates a GitHub release with the packaged `.vsix` file + +4. **Monitoring:** + - View workflow runs in the Actions tab + - Check for green checkmarks (success) or red X's (failure) + - Review logs for any errors or issues + +**Important Notes:** +- Ensure the version in `package.json` is incremented before merging to main +- All tests must pass for deployment to succeed +- The workflow will only publish if the push event occurs (not on manual workflow_dispatch without the publish step enabled) + ## Version Management ### Pre-release Versions From da9ca7da9cb228fa2a542259af24f62c67f061d9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 05:32:40 +0000 Subject: [PATCH 3/5] Fix trailing spaces in workflow file Co-authored-by: asperpharma <252395498+asperpharma@users.noreply.github.com> --- .github/workflows/deploy.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 178bdf1..bef0ec1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,39 +10,39 @@ jobs: deploy: runs-on: ubuntu-latest if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' - + - name: Install dependencies run: npm ci - + - name: Run tests run: npm test - + - name: Install vsce run: npm install -g @vscode/vsce - + - name: Get version from package.json id: package run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT - + - name: Package extension run: vsce package - + - name: Publish to VS Code Marketplace if: github.event_name == 'push' run: vsce publish -p ${{ secrets.VSCE_PAT }} env: VSCE_PAT: ${{ secrets.VSCE_PAT }} - + - name: Create GitHub Release if: github.event_name == 'push' uses: softprops/action-gh-release@v1 @@ -51,7 +51,7 @@ jobs: name: Release v${{ steps.package.outputs.version }} body: | Automated release from main branch - + See [CHANGELOG.md](CHANGELOG.md) for details. files: | *.vsix From e17c435d7abb619fd45b6d412c38740781c0694f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 05:33:40 +0000 Subject: [PATCH 4/5] Address code review feedback: remove redundant conditions and env vars Co-authored-by: asperpharma <252395498+asperpharma@users.noreply.github.com> --- .github/workflows/deploy.yml | 3 --- package-lock.json | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bef0ec1..9ffdba3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,6 @@ on: jobs: deploy: runs-on: ubuntu-latest - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' steps: - name: Checkout code @@ -40,8 +39,6 @@ jobs: - name: Publish to VS Code Marketplace if: github.event_name == 'push' run: vsce publish -p ${{ secrets.VSCE_PAT }} - env: - VSCE_PAT: ${{ secrets.VSCE_PAT }} - name: Create GitHub Release if: github.event_name == 'push' diff --git a/package-lock.json b/package-lock.json index bae1b09..da065c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -113,6 +113,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", "dev": true, + "peer": true, "dependencies": { "co": "^4.6.0", "fast-deep-equal": "^1.0.0", @@ -1795,6 +1796,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", "dev": true, + "peer": true, "requires": { "co": "^4.6.0", "fast-deep-equal": "^1.0.0", From 0a2f6490879a06579b9fac28f4284d9ba4164d98 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 05:34:20 +0000 Subject: [PATCH 5/5] Add explicit permissions block to workflow for security Co-authored-by: asperpharma <252395498+asperpharma@users.noreply.github.com> --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9ffdba3..c4826ca 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,9 @@ on: jobs: deploy: runs-on: ubuntu-latest + permissions: + contents: write + packages: read steps: - name: Checkout code