-
Notifications
You must be signed in to change notification settings - Fork 0
Phase 4: CI, lint and publishing automation #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Install | ||
| run: npm ci | ||
|
|
||
| - name: Lint | ||
| run: npm run lint | ||
|
|
||
| - name: Test | ||
| run: npm test | ||
|
|
||
| - name: Package | ||
| run: npm run package | ||
|
|
||
| - name: Upload VSIX | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: vsix | ||
| path: Packages/*.vsix | ||
| if-no-files-found: error |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Publishes the extension to the Visual Studio Marketplace when a v* tag is | ||
| # pushed. Requires a one-time setup by a maintainer: | ||
| # 1. Bump "version" in package.json (the Marketplace rejects a version that | ||
| # already exists), commit, then tag: git tag v0.3.0 && git push --tags | ||
| # 2. Add a repository secret AZURE_DEVOPS_MARKETPLACE_PAT — a Marketplace | ||
| # "Manage" Personal Access Token for the `testingbot` publisher. | ||
| # | ||
| # NOTE: all-organization PATs are being retired on 2026-12-01. The longer-term | ||
| # path is federated Entra/OIDC auth (e.g. the jessehouwing/azdo-marketplace | ||
| # action); switch to that before then. | ||
| name: Publish | ||
|
|
||
| on: | ||
| push: | ||
| tags: [ 'v*' ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| environment: marketplace | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Install | ||
| run: npm ci | ||
|
|
||
| - name: Package | ||
| run: npm run package | ||
|
|
||
| - name: Publish to the Marketplace | ||
| run: npx tfx extension publish --vsix Packages/*.vsix --token "$AZURE_DEVOPS_MARKETPLACE_PAT" | ||
| env: | ||
| AZURE_DEVOPS_MARKETPLACE_PAT: ${{ secrets.AZURE_DEVOPS_MARKETPLACE_PAT }} | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,12 @@ _Date: 2026-07-17. Applies to repo `vso-testingbot-plugin` (marketplace: `testin | |||||
| > browser until TestingBot adds such an endpoint; (b) the `vss-web-extension-sdk` | ||||||
| > → `azure-devops-extension-sdk` / React port (large, and the old SDK keeps | ||||||
| > working, so deferred to its own PR). | ||||||
| > - **Phase 4 — PENDING:** CI/CD, lint, publishing. | ||||||
| > - **Phase 4 — MOSTLY DONE (PR #20):** GitHub Actions build workflow (lint + | ||||||
| > tests + package on every PR), ESLint flat config wired up (`npm run lint`), | ||||||
| > CodeQL workflow fixed (v3 actions), dead Jenkinsfile removed, README usage | ||||||
| > quick-start. A tag-triggered publish workflow is included but needs a | ||||||
| > maintainer to add the `AZURE_DEVOPS_MARKETPLACE_PAT` secret (and, before | ||||||
| > 2026-12-01, to move to Entra/OIDC auth). | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||
| > | ||||||
| > Items marked "PENDING" below are the genuinely outstanding work. | ||||||
| > | ||||||
|
|
@@ -40,7 +45,7 @@ This extension is a 2016-era fork of Sauce Labs' now-unpublished `vso-sauce-onde | |||||
| 2. **Migrate both tasks to the `Node20_1` handler + `azure-pipelines-task-lib` 5.x** — the bare `"Node"` (Node 6) handler is removed from new agents in November 2026; the extension breaks on schedule without this. _(DONE — Phase 1/2.)_ | ||||||
| 3. **Replace the broken gulp 3 / webpack 1 / babel 6 toolchain** with TypeScript + webpack 5 + npm scripts (per `microsoft/azure-devops-extension-sample`) so a `.vsix` can be built at all. _(DONE — Phase 1 build, Phase 2 TypeScript.)_ | ||||||
| 4. **Stop bundling the 2019 tunnel jar** (`tb-main/tunnel/2.30.jar`, internally v2.9, vulnerable Jetty 9.4.12) — use `testingbot-tunnel-launcher` (npm, v1.1.18) to download/cache the current tunnel (v4.8) at runtime. _(DONE — Phase 2.)_ | ||||||
| 5. **Add real CI/CD** — GitHub Actions building the `.vsix` on every PR and publishing to the Marketplace on tag (tfx-cli 0.23.x, Entra/OIDC auth), replacing dead Travis/Jenkins/CodeQL v1 configs. _(PENDING — Phase 4.)_ | ||||||
| 5. **Add real CI/CD** — GitHub Actions building the `.vsix` on every PR and publishing to the Marketplace on tag (tfx-cli 0.23.x, Entra/OIDC auth), replacing dead Travis/Jenkins/CodeQL v1 configs. _(DONE — Phase 4; the build/CodeQL/lint workflows run, the tag publish workflow just needs the maintainer's Marketplace secret.)_ | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Document the implemented PAT authentication accurately. The publish workflow currently passes Proposed fix-5. **Add real CI/CD** — GitHub Actions building the `.vsix` on every PR and publishing to the Marketplace on tag (tfx-cli 0.23.x, Entra/OIDC auth), replacing dead Travis/Jenkins/CodeQL v1 configs.
+5. **Add real CI/CD** — GitHub Actions building the `.vsix` on every PR and publishing to the Marketplace on tag (tfx-cli 0.23.x, PAT auth for now; Entra/OIDC migration pending), replacing dead Travis/Jenkins/CodeQL v1 configs.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| ## 2. Critical bugs & security issues (verified findings) | ||||||
|
|
||||||
|
|
@@ -119,7 +124,7 @@ Goal: a results tab with no secrets in the browser, no CDN scripts, and a suppor | |||||
| | 4.2 GitHub Actions build workflow | **S** | On PR/push: Node 20, `npm ci`, lint, tests, build, `tfx extension create`, upload `.vsix` artifact. This single workflow would have caught the Dependabot gulp4/webpack5 breakage that shipped unnoticed. | | ||||||
| | 4.3 Marketplace publishing on tag | **M** | `jessehouwing/azdo-marketplace@v6` (successor of Azure DevOps Extension Tasks; runs on GitHub Actions): `query-version` (version-source: marketplace, action: Patch) → `publish` with `extension-version` override — no version-commit-back needed. Prefer `auth-type: oidc` (federated Entra) over PATs: all-org PATs are retired **Dec 1, 2026**. Publish a private `-dev` manifest variant to a TestingBot test org before public release (pattern from both the Sauce fork's beta channel and the Microsoft sample). | | ||||||
| | 4.4 Fix CodeQL workflow | **S** | `github/codeql-action/*@v3`, `actions/checkout@v4` (v1 disabled Jan 2023; the repo's only automated check produces no signal today). | | ||||||
| | 4.5 ESLint / formatting refresh | **S** | Replace `babel-eslint` config with `@typescript-eslint` once Phase 2 lands. | | ||||||
| | 4.5 ESLint / formatting refresh | **S** | _(DONE — Phase 4.)_ Replaced the `babel-eslint` `.eslintrc` with an ESLint 9 flat config (`eslint.config.mjs`) using `typescript-eslint`; wired `npm run lint`. | | ||||||
| | 4.6 Docs | **S** | Rewrite README (current build instructions are all broken); add a YAML quick-start (secret variables + script steps) mirroring what Sauce/BrowserStack docs do, for users who cannot install marketplace extensions. | | ||||||
|
|
||||||
| **Sequencing note:** Phase 1 + steps 2.3/2.4/3.1 are the minimum credible release (fixes the credential leak and the November 2026 handler deadline). Phase 3.2 (SDK port) is the largest single item and can ship in a later minor version. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import js from '@eslint/js'; | ||
| import tseslint from 'typescript-eslint'; | ||
| import globals from 'globals'; | ||
|
|
||
| export default tseslint.config( | ||
| { | ||
| ignores: [ | ||
| 'node_modules/**', | ||
| '**/node_modules/**', | ||
| 'dist/**', | ||
| 'Packages/**', | ||
| // Compiled TypeScript output (emitted next to the sources). | ||
| 'tb-*/index.js', | ||
| 'tb-*/index.js.map', | ||
| 'tb-*/tests/**/*.js', | ||
| '**/*.js.map', | ||
| // Third-party runtime, not ours to lint. | ||
| 'lib/**' | ||
| ] | ||
| }, | ||
|
|
||
| // TypeScript task sources + their tests. | ||
| { | ||
| files: ['tb-*/**/*.ts'], | ||
| extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
| languageOptions: { | ||
| globals: { ...globals.node, ...globals.mocha } | ||
| }, | ||
| rules: { | ||
| // azure-pipelines-task-lib and testingbot-tunnel-launcher use `export =`, | ||
| // for which `import x = require(...)` is the idiomatic TypeScript form. | ||
| '@typescript-eslint/no-require-imports': 'off' | ||
| } | ||
| }, | ||
|
|
||
| // Node build scripts. | ||
| { | ||
| files: ['scripts/**/*.js', 'webpack.config.js'], | ||
| extends: [js.configs.recommended], | ||
| languageOptions: { | ||
| globals: globals.node, | ||
| sourceType: 'commonjs' | ||
| } | ||
| }, | ||
|
|
||
| // Legacy browser tab scripts (slated for the SDK rewrite). Lint for real | ||
| // errors only; the vendored MD5 implementation trips a lot of style rules. | ||
| { | ||
| files: ['tb-build-info/scripts/**/*.js'], | ||
| extends: [js.configs.recommended], | ||
| languageOptions: { | ||
| sourceType: 'commonjs', | ||
| globals: { | ||
| ...globals.browser, | ||
| VSS: 'readonly', | ||
| $: 'readonly', | ||
| jQuery: 'readonly', | ||
| Buffer: 'readonly' | ||
| } | ||
| }, | ||
| rules: { | ||
| 'no-unused-vars': 'off', | ||
| 'no-redeclare': 'off', | ||
| 'no-inner-declarations': 'off', | ||
| 'no-empty': 'off', | ||
| 'no-func-assign': 'off' | ||
| } | ||
| } | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Set
persist-credentials: falseon all checkout steps.actions/checkout@v4persists theGITHUB_TOKENin.git/configby default. None of these workflows need git credentials after checkout, and leaving the token persisted expands the attack surface if a later step is compromised..github/workflows/publish.yml#L26: Addpersist-credentials: false— most critical since this workflow handles a Marketplace PAT..github/workflows/build.yml#L16: Addpersist-credentials: false..github/workflows/codeql-analysis.yml#L27: Addpersist-credentials: false.🧰 Tools
🪛 zizmor (1.26.1)
[warning] 26-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 26-26: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
📍 Affects 3 files
.github/workflows/publish.yml#L26-L26(this comment).github/workflows/build.yml#L16-L16.github/workflows/codeql-analysis.yml#L27-L27🤖 Prompt for AI Agents