Add support for attestation commit#8794
Open
alexr00 wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an “attestation commit” capability to the GitHub Pull Requests extension, allowing users to optionally create and push an empty signed commit to the PR branch (and to request that flow during review submission) to attest to a PR even when individual commits are unsigned.
Changes:
- Adds a new
githubPullRequests.enableAttestationCommitssetting plus a newpr.addAttestationCommitcommand, and introducessrc/github/attestationCommit.tsto implement the feature. - Extends review submission messaging so webviews can request an attestation commit before submitting a review, and updates timeline ordering logic to avoid misclassifying pre-review attestation commits as “new since review”.
- Updates the PR comment UI to include an “Add attestation” checkbox when applicable.
Show a summary per file
| File | Description |
|---|---|
| webviews/components/comment.tsx | Adds “Add attestation” checkbox and forwards an addAttestation flag through review submit actions. |
| webviews/common/context.tsx | Updates webview->extension review submission payload shape to include { body, addAttestation }. |
| webviews/common/common.css | Adds styling for the new attestation checkbox and right-aligned action grouping. |
| webviews/activityBarView/index.css | Adds overlay positioning for the checkbox in the activity bar PR view. |
| src/github/views.ts | Extends PR view models with attestationCommitsEnabled and introduces SubmitReviewArgs. |
| src/github/utils.ts | Refines “new commits since review” ordering using timestamps (attestation-aware behavior). |
| src/github/pullRequestOverview.ts | Implements “submit review with optional attestation commit” handling and exposes feature enablement to the webview. |
| src/github/issueOverview.ts | Adjusts issue comment submission to accept SubmitReviewArgs and uses args.body. |
| src/github/attestationCommit.ts | New implementation for creating/pushing an empty signed attestation commit and reading the related setting. |
| src/github/activityBarViewProvider.ts | Adds the same “review with optional attestation commit” handling for the activity bar PR view. |
| src/common/settingKeys.ts | Adds ENABLE_ATTESTATION_COMMITS setting key constant. |
| src/commands.ts | Registers pr.addAttestationCommit command (command palette / programmatic entry point). |
| package.nls.json | Adds localized strings for the new setting description and command title. |
| package.json | Contributes the new setting and command to the extension manifest. |
Copilot's findings
- Files reviewed: 14/14 changed files
- Comments generated: 7
sandy081
approved these changes
Jun 15, 2026
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
src/github/utils.ts:1707
- The loop in
insertNewCommitsSinceReviewnever evaluatesi === 0, so iflatestReviewCommitOidis the first timeline event (a valid case), theNewCommitsSinceReviewmarker is never inserted. This also makes the new unit tests fail when the latest-review commit is at index 0.
if (latestReviewCommitOid && head && head.sha !== latestReviewCommitOid) {
let lastViewerReviewIndex: number = timelineEvents.length - 1;
let lastViewerReviewTime: number | undefined;
let comittedDuringReview: boolean = false;
let interReviewCommits: Common.TimelineEvent[] = [];
for (let i = timelineEvents.length - 1; i > 0; i--) {
- Files reviewed: 15/15 changed files
- Comments generated: 4
Comment on lines
412
to
414
| const defaultMergeMethod = getDefaultMergeMethod(mergeMethodsAvailability); | ||
| this._existingReviewers = parseReviewers(requestedReviewers!, timelineEvents!, pullRequest.author); | ||
| this._existingReviewers = parseReviewers(requestedReviewers!, timelineEvents, pullRequest.author); | ||
|
|
Comment on lines
+163
to
+167
| assert.strictEqual(events[1].event, EventType.NewCommitsSinceReview); | ||
| assert.strictEqual(events[2].event, EventType.Committed); | ||
| assert.strictEqual((events[2] as CommitEvent).sha, HEAD_SHA); | ||
| assert.strictEqual(events[3].event, EventType.Reviewed); | ||
| }); |
| name="add-attestation" | ||
| checked={addAttestation} | ||
| disabled={isBusy || busy} | ||
| onChange={() => setAddAttestation(!addAttestation)} |
| name="add-attestation" | ||
| checked={addAttestation} | ||
| disabled={isBusy || pr.busy} | ||
| onChange={() => setAddAttestation(!addAttestation)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.