Skip to content

Phase 3.2: migrate the results tab to azure-devops-extension-sdk#21

Merged
jochen-testingbot merged 1 commit into
phase4-ci-publishingfrom
phase5-sdk-migration
Jul 18, 2026
Merged

Phase 3.2: migrate the results tab to azure-devops-extension-sdk#21
jochen-testingbot merged 1 commit into
phase4-ci-publishingfrom
phase5-sdk-migration

Conversation

@jochen-testingbot

@jochen-testingbot jochen-testingbot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Stacked on #20 (Phase 4). Base is phase4-ci-publishing; it retargets to master automatically once #20 merges.

The one large item deferred from Phase 3: port the build-results tab off the deprecated vss-web-extension-sdk (VSS.SDK.js + AMD loader) to the supported azure-devops-extension-sdk v4 + azure-devops-extension-api v5. TypeScript, plain DOM, self-contained bundle. No React (you picked the minimal swap). The /mini viewer and behaviour are preserved.

What changed

  • info.ts / dialog.ts (were .js): SDK.init/ready; build context via BuildPageDataService.getBuildPageData(); attachments via BuildRestClient.getAttachments + download from _links.self.href with SDK.getAccessToken(); TestingBot API via ServiceEndpointRestClient.executeServiceEndpointRequest; embed dialog via IHostPageLayoutService.openCustomDialog (URL passed as { url }, read by the dialog through SDK.getConfiguration()).
  • Dropped jQuery for plain document.createElement, and Buffer for btoa; the 180-line inline MD5 is now the blueimp-md5 package. Kept the Phase 3 pagination + error-state fixes.
  • HTML loads the webpack bundle directly (<script src="scripts/info.js">); VSS.SDK.js and the AMD loader are gone.
  • webpack bundles the SDK/API/md5 in (no AMD externals, no buffer polyfill); @babel/preset-typescript compiles the tab. Since babel only strips types, npm run typecheck type-checks the tab and is wired into npm run package + the CI build workflow.
  • Manifest: embed-dialog uri drops ?url={{url}}; the lib/ (VSS.SDK.js) files entry is removed.

Verified statically

npm run typecheck (tab) clean · npm run lint clean · npm test 8 passing · npm run package builds a vsix whose tab bundle is self-contained (66 KB, no define(/AMD, no VSS.SDK.js).

⚠️ Runtime validation required (I cannot test browser tab code outside a live org)

Please smoke-test the tab in a real Azure DevOps org before release. The three things that behave differently from the old SDK and need a live check:

  1. Attachment download via attachment._links.self.href + SDK.getAccessToken() (the modern getAttachments doesn't return timelineId/recordId, so I fetch the self link).
  2. getBuildPageData() replaces the old onBuildChanged — it's a one-shot read on tab load (fine for opening a build; it won't re-fetch if the user navigates between builds without a reload).
  3. openCustomDialog rendering embedDialog.html and receiving { url } via SDK.getConfiguration().

If any of those need adjusting after a live test, it's a contained follow-up.

Summary by CodeRabbit

  • New Features

    • Added a TypeScript-based build information experience with paginated test results, pass/fail status, browser and operating system details, and links to session views.
    • Added secure embedded session dialogs that only load approved TestingBot URLs and display an error for invalid links.
  • Improvements

    • Simplified extension loading and packaging for more reliable browser-based operation.
    • Added automated TypeScript validation to the build process.
  • Documentation

    • Updated technical documentation to reflect the modernized build and runtime process.

Ports the build-results tab off the deprecated vss-web-extension-sdk (VSS.SDK.js
+ AMD module loader) to the supported azure-devops-extension-sdk v4 +
azure-devops-extension-api v5. TypeScript, plain DOM, self-contained bundle. No
React (not needed). The /mini viewer and behaviour are preserved.

- info.ts / dialog.ts (was info.js / dialog.js): SDK.init/ready; build context
  via BuildPageDataService.getBuildPageData(); attachment listing via
  BuildRestClient.getAttachments + download from the attachment _links.self.href
  with SDK.getAccessToken(); TestingBot API via ServiceEndpointRestClient
  .executeServiceEndpointRequest; embed dialog via
  IHostPageLayoutService.openCustomDialog (config passed as { url }, read by the
  dialog through SDK.getConfiguration()).
- Drop jQuery for plain document.createElement, and Buffer for btoa; the 180-line
  inline MD5 is replaced by the blueimp-md5 package. Keeps the Phase 3 pagination
  (stable page size, count=0 guard) and error-state fixes.
- HTML now loads the webpack bundle directly (<script src="scripts/info.js">);
  VSS.SDK.js and the AMD loader are gone.
- webpack bundles the SDK/API/md5 in (no AMD externals, no buffer polyfill);
  @babel/preset-typescript compiles the tab. babel only strips types, so
  `npm run typecheck` (tb-build-info/tsconfig.json) type-checks it; wired into
  `npm run package` and the CI build workflow.
- Manifest: embed-dialog uri drops ?url={{url}} (config now via the dialog API);
  the lib/ (VSS.SDK.js) entry is removed from files.
- eslint: tab files are now .ts (browser globals, typescript-eslint).

Verified statically: npm run typecheck (tab) clean, npm run lint clean,
npm test 8 passing, npm run package builds a vsix whose tab bundle is
self-contained (66KB, no AMD/define, no VSS.SDK.js).

RUNTIME VALIDATION REQUIRED (cannot be exercised outside a live Azure DevOps org):
attachment download via _links.self.href + access token; getBuildPageData()
replacing the old onBuildChanged (one-shot read on load); openCustomDialog
rendering embedDialog.html and passing { url }. Smoke-test the tab in a real org
before release.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a21ffa77-9524-497b-9057-1cb3de513cd8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tb-build-info/scripts/info.ts`:
- Around line 7-12: Update the build attachment contract represented by
BuildInformation to remove TB_KEY and TB_SECRET, retaining only non-secret build
metadata such as TB_BUILD_NAME and CONNECTED_SERVICE_NAME. Adjust the attachment
generation and consumers so browser-readable TestingBotBuildResult data no
longer carries credentials, and move Basic authentication and /mini signing to
the server-side flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9a4c9fdb-0e16-49aa-bf7b-d2e1f9d845bd

📥 Commits

Reviewing files that changed from the base of the PR and between 7797849 and e96a2c4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • .github/workflows/build.yml
  • CLAUDE.md
  • MODERNIZATION.md
  • eslint.config.mjs
  • package.json
  • tb-build-info/embedDialog.html
  • tb-build-info/infoTab.html
  • tb-build-info/scripts/dialog.js
  • tb-build-info/scripts/dialog.ts
  • tb-build-info/scripts/info.js
  • tb-build-info/scripts/info.ts
  • tb-build-info/tsconfig.json
  • vss-extension.json
  • webpack.config.js
💤 Files with no reviewable changes (2)
  • tb-build-info/scripts/dialog.js
  • tb-build-info/scripts/info.js

Comment on lines +7 to +12
interface BuildInformation {
TB_KEY: string;
TB_SECRET: string;
TB_BUILD_NAME: string;
CONNECTED_SERVICE_NAME: string;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline tb-main --items all --type function
rg -n -C 4 'addattachment|TestingBotBuildResult|TB_(KEY|SECRET)|CONNECTED_SERVICE_NAME' \
  tb-main tb-build-info

Repository: testingbot/vso-testingbot-plugin

Length of output: 7944


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,140p' tb-build-info/scripts/info.ts
printf '\n---\n'
sed -n '140,230p' tb-main/index.ts

Repository: testingbot/vso-testingbot-plugin

Length of output: 6607


Remove TB_KEY and TB_SECRET from the TestingBotBuildResult attachment contract.
The build tab consumes this browser-readable payload and uses those values for Basic auth and /mini signing; keep only non-secret build metadata in the attachment and move signing server-side.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tb-build-info/scripts/info.ts` around lines 7 - 12, Update the build
attachment contract represented by BuildInformation to remove TB_KEY and
TB_SECRET, retaining only non-secret build metadata such as TB_BUILD_NAME and
CONNECTED_SERVICE_NAME. Adjust the attachment generation and consumers so
browser-readable TestingBotBuildResult data no longer carries credentials, and
move Basic authentication and /mini signing to the server-side flow.

Source: Learnings

@jochen-testingbot
jochen-testingbot merged commit 9315ed0 into phase4-ci-publishing Jul 18, 2026
1 check passed
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.

1 participant