Skip to content

Add support for attestation commit#8794

Open
alexr00 wants to merge 4 commits into
mainfrom
alexr00/sore-deer
Open

Add support for attestation commit#8794
alexr00 wants to merge 4 commits into
mainfrom
alexr00/sore-deer

Conversation

@alexr00

@alexr00 alexr00 commented Jun 15, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 15, 2026 14:12
@alexr00 alexr00 self-assigned this Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.enableAttestationCommits setting plus a new pr.addAttestationCommit command, and introduces src/github/attestationCommit.ts to 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

Comment thread webviews/components/comment.tsx
Comment thread webviews/components/comment.tsx
Comment thread webviews/activityBarView/index.css Outdated
Comment thread webviews/components/comment.tsx Outdated
Comment thread src/github/activityBarViewProvider.ts
Comment thread src/github/pullRequestOverview.ts
Comment thread src/github/utils.ts
@alexr00 alexr00 enabled auto-merge (squash) June 15, 2026 15:02
@alexr00 alexr00 disabled auto-merge June 15, 2026 15:02
Copilot AI review requested due to automatic review settings June 15, 2026 15:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

Comments suppressed due to low confidence (1)

src/github/utils.ts:1707

  • The loop in insertNewCommitsSinceReview never evaluates i === 0, so if latestReviewCommitOid is the first timeline event (a valid case), the NewCommitsSinceReview marker 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)}
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.

3 participants