Skip to content

fix(repos): a missing merge setting is not drift #6875

Closed

Description

@dan-petty

Problem

On 2026-11-23 the drift Job (CronJob repos-drift, #6783) reported row 2 (Repository) of dan-petty/devops-cli as pending, with each key of the baseline: allow_squash_merge, allow_merge_commit, allow_rebase_merge, squash_merge_commit_title, squash_merge_commit_message, allow_auto_merge, allow_update_branch, delete_branch_on_merge.

  • The same GET with the login of the owner gives true false false PR_TITLE PR_BODY true true true, which is equal to the baseline. So the report is false.
  • The Job uses an App installation token that asks for read permissions only (CONST_GITHUB_APP_READ_TOKEN_PERMISSIONS). GitHub does not give these fields to that token, and row 2 counts a missing field as a difference. The PR comment of feat(repos): report the drift of onboarded repositories nightly #6816 named this risk as not verified.
  • So RepositorySettingsDrift fires each night for devops-cli, and row 2 can hide or invent drift in each repository.

Proposed remedy

  • A field that the reply does not hold is unknown, not different: row 2 reports it as not readable (with the reason), not as pending.
  • Find the permission that gives the merge fields to an App token (GitHub documentation or one probe), and if a read permission gives them, ask for it.

Acceptance criteria

  • A test: a repository reply with no merge fields gives row 2 not readable, and no pending key.
  • A test: a reply with the fields equal to the baseline gives present.

Dependencies

None. Related: #6783, #6784.

Activity

  1. added
    type/bug
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 23, 2026
  2. dan-petty commented on Nov 23, 2026

    @dan-petty
    OwnerAuthor
  3. added
    scope/repos
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 23, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 23, 2026
  5. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-23 14:01 UTC

  6. dan-petty commented on Nov 23, 2026

    @dan-petty
    OwnerAuthor

    Owner decision of 2026-11-23: the token of the drift Job (CronJob repos-drift) also asks for Contents write and Administration write, so rows 2 and 10 read the merge settings and the bypass actors each night. GitHub returns those fields only with these write permissions ("Get a repository", "Get a repository ruleset"). The pod already holds the App key, which can mint a write token, so the read-only request only guarded against a code bug; plan mode still sends GET requests only, and the route-ownership test pins that. PR #6878 carries this change with the fix of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/repossource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions