Skip to content

v0.39.2

Choose a tag to compare

@github-actions github-actions released this 04 Nov 09:15

What's changed

Show the commented code above review threads in the Overview feed

A thread in the activity feed showed only a "path, line N" link, so a reader
had to open Files to see what the comment was about. Native ADO and GitHub
both show the commented lines above the thread; now we do too.

The lines come from the first comment's diffHunk, which the feed already
loads: the last four lines up to the commented line, or exactly start..end
for a range comment, with old and new line numbers and the +/- tint our
suggestion diff uses. lib/hunkContext.ts parses the hunk (several @@
headers, LEFT-side comments, ranges starting on the other side, "no newline"
markers, CRLF). The hunk is numbered as the code was when the comment was
written, so it is located by originalLine/originalStartLine, which the
thread query now also selects (with startDiffSide). An outdated thread
therefore still shows the code it was written on, beside its Outdated pill.

Hand-rolled: the snippet is a small table reusing the Advanced Security
snippet's styles. No azure-devops-ui component renders a few diff lines, and
a read-only Monaco per thread is too heavy for a feed. Files threads are
unchanged: the diff is already beside them.

Mock: the outdated thread on #200 now carries the hunk it was written on.
Shots page pr-200-threads.

9fba860

Show Copilot findings' title and severity in review threads

A Copilot review comment's body is only the finding's paragraph. Its title
("Expand and JSON-quote the default reasoning effort") and severity live in
the parent review's body, an overview () listing each
finding with a severity badge and a link to #discussion_r. The
feed already loads review bodies, so no request is added: toFeed reads the
overview of every review by copilot-pull-request-reviewer (only that bot's;
later reviews win) and gives each of its comments the matching title and
severity, keyed by the comment's databaseId.

The thread then shows the severity as the Advanced Security hub's pill
(High red, Medium amber, Low blue; an unknown word as an outlined Pill) and
the title in bold above the body, in the Overview feed and in Files.

copilotFindings (lib/copilotReview.ts) is tested against a trimmed copy of a
real Copilot review body. The review's own overview renders acceptably as it
is: the sanitiser drops , so falls back to its (alttext if it cannot load), and

works.

Mock: #200 gets a Copilot review in the current overview shape, with its
GitHub-rendered HTML, and two Copilot threads on src/retry.ts. Shots page
pr-200-copilot.

0ca67b9

Link Copilot's suggested fix to GitHub from its review comments

GitHub shows a "Suggested changeset" under Copilot's review comments, but no
public API field carries it (not in the REST comment, the GraphQL comment or
the review), so it cannot be shown or applied here. Rather than let it
vanish, each Copilot comment now ends with a quiet line, "Copilot suggested a
fix.", and an "Open on GitHub" link to the comment, in a new tab.

Ordinary ```suggestion blocks are unchanged: they still render with Apply.

0f148ab

Show Copilot and other bots as themselves, with their own hover card

Comment headers showed Copilot's raw login, copilot-pull-request-reviewer,
and hovering Copilot in the reviewers list opened a person card for the bot
account: a big generic avatar, its literal bio ("test") and a link to the
bot's profile.

lib/botIdentity.ts decides, from what we have (the login in its GraphQL,
REST and review-comment spellings, GraphQL __typename or REST user.type,
REST is_copilot_code_review), whether an author is Copilot (name "Copilot",
an "AI" pill, as GitHub labels it), another app (its name without "[bot]",
a "Bot" pill, its https://github.com/apps/{slug} page) or a person.

  • ActorName renders the name and pill: feed and Files thread comment
    headers, review cards and events, reviewers, the PR author on the list,
    page and widget, and edit history.
  • PersonHover gives a bot a card built from that, with no /users lookup:
    Copilot's says "AI code review by GitHub Copilot" and links "About
    Copilot code review" to GitHub's docs; another app's links to its app
    page. A card rather than none, so every avatar behaves the same.
  • Comment and review authors in the feed now have hover cards at all.
  • The feed and PR queries select the author's __typename, so an app whose
    GraphQL login has no "[bot]" suffix is still recognised.
  • reviewerName now goes through the same helper.

Mock: Copilot commented on #200, so it is in the reviewers list. Shots page
hover-copilot. Note: on this machine headless Chrome draws no hover card on
any hover page (hover-person and hover-reviewer included; the card is in the
DOM but placed off-screen), so the cards were checked in the DOM.

6b02048

Give every person a hover card, including commit authors with no GitHub account

Hover cards were keyed on a GitHub login, so a commit whose email is on no
GitHub account (all of tn-local-agents' commits: "Bogdan <BMichon@…>",
author.user null) got no card, on the Files Commits column and the Commits
rows alike; and some places that show a person had no card at all.

lib/identityCard.ts chooses the card from whatever we have:

  • a bot (botIdentity.ts): the Copilot or app card;
  • a GitHub login: the existing profile card (GET /users/{login});
  • no login but a git name and email: look the email up in Azure DevOps'
    own directory, through the host's identity service (the one its identity
    picker uses), and show azure-devops-ui's native IdentityCard when exactly
    that email is someone in the organisation (pickAdoIdentity refuses the
    name matches the search also returns). Otherwise a card in our Callout
    frame: avatar, git name, the email as a mailto link, and "This commit's
    email isn't linked to a GitHub account." Never /users/{login}.
  • the ghost, or nothing to go on: no card.

The native IdentityCard draws its own light-dismiss callout, so HoverCard
gained an unframed mode that hands the anchor and the open/close timing to
the card through context; pointer moves over the card or the anchor keep it
open and moving away closes it after the usual grace period.

Plumbing: the git email is now kept where it was dropped: the commit,
blame, branch, commit detail (author and committer), Files history, PR
commits and feed push queries select author.email; REST commits keep
commit.author.email; Person, CommitInfo and PrCommit carry it with the login.

New hover-card anchors: Files' Commits column, the PR Commits tab, feed
event actors (pushes as the git identity), forks' owners, the Advanced
Security "dismissed by", and the new PR's reviewer and assignee rows.
PersonLine (Commits rows, commit detail, branches, tags, releases, blame,
Actions, environments) now passes the email, so git-only authors there get
the card too. Left out on purpose: the viewer's own avatar beside the
comment boxes, the @mention and reviewer-picker suggestion lists (a card
would fight the dropdown), and the author line inside a PR hover card
(no cards inside cards).

Not verified live: whether the host's identity service answers this
extension's frame with its current scopes (vso.githubconnections, vso.work);
no scope was added. A failed lookup falls back to the plain card.

Mock: git-only authors on the Commits page (Gwen Git, in a mock ADO
directory in mockSdk.ts; Sam Unlinked, in none) and Carol on Files.
Shots pages hover-git-ado and hover-git.

647c47f

Fix Files' blank commit columns and branch label after a branch switch

Found live in ADO on tn-local-agents. Switching from main to a branch with
more files left most rows without Last change or Commits: the new ref
rendered one frame before its folder listing, so the commit lookup ran with
the old branch's two paths under the new ref, and getCommits cached that
answer by ref and folder alone. The key now carries the entries' paths.

The branch picker also went blank after a switch: the Dropdown keeps its
own selection, and once the branch list reloads the picked item is gone,
hiding the placeholder that carries the branch name. It now remounts per
ref.

47da628

Release 0.39.2

PR Overview threads show the code they comment on; Copilot review comments
show their title, severity and a link to their suggested fix, and Copilot
and other bots appear as themselves; every person's name or avatar has a
hover card, with Azure DevOps' own card for commit authors whose email
isn't linked to GitHub; and Files no longer loses its commit columns or
branch label after switching branch.

ee93a99

Full changelog: v0.39.1...v0.39.2