Skip to content

Conversation

@JoannaaKL
Copy link
Contributor

Lockdown mode improvement: if the author is trusted bot, don't filter out content. For now the list of trusted bots is hardcoded but it can easily be configurable if needed.

@JoannaaKL JoannaaKL requested a review from a team as a code owner November 21, 2025 10:56
Copilot AI review requested due to automatic review settings November 21, 2025 10:56
Copilot finished reviewing on behalf of JoannaaKL November 21, 2025 11:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request enhances lockdown mode to allow content from trusted bots (dependabot, github-actions, github-copilot) to bypass content filtering. The changes add a ViewerType field to track whether the GitHub API viewer is a Bot, and implement a isTrustedBot() check with a hardcoded list of trusted bot logins.

Key changes:

  • Added ViewerType field to track the __typename from GitHub's GraphQL API
  • Added trustedBotLogins map with hardcoded trusted bot identifiers
  • Modified IsSafeContent() to check for trusted bots before filtering content

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/lockdown/lockdown.go Added ViewerType field, trustedBotLogins map, isTrustedBot() method, and modified IsSafeContent() to check trusted bots; updated GraphQL query to fetch __typename
pkg/lockdown/lockdown_test.go Updated test mocks and assertions to include ViewerType field with value "User"

@JoannaaKL JoannaaKL force-pushed the allow-copilot-in-lockdown branch from 7f851b4 to 869c024 Compare November 21, 2025 11:04
@JoannaaKL JoannaaKL force-pushed the allow-copilot-in-lockdown branch from 869c024 to 8400964 Compare November 21, 2025 11:06
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.

2 participants