org base permission is none, not read#178
Conversation
Connector PR Review: org base permission is none, not readBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review Summary Security Issues Correctness Issues Suggestions |
| perm := org.GetDefaultRepoPermission() | ||
| if perm == "" { | ||
| perm = readConst // GitHub default | ||
| l.Warn( |
There was a problem hiding this comment.
nit (non-blocking): I'd drop this to Debug. An empty default_repository_permission here isn't an error or a connector bug — it just means the credential lacks org-owner visibility, which is a normal, expected setup for a lot of tokens. We handle it gracefully (fail closed to none) and move on, and since it's cached per org it only fires once per sync. Logging that at Warn puts an expected, non-actionable condition into warning dashboards / retained OTEL spans as if something were wrong; Debug keeps the signal without the noise. Fine to keep if you want the higher visibility, just flagging it.
df6dd8c to
3ed5949
Compare
Fixes CXH-2100
This will drop 10s of millions of grants from some syncs.
Summary
direct-collaborators-only: whenGET /orgs/{org}omitsdefault_repository_permission(common without org-owner /admin:org/ Organization Administration visibility), stop inventing"read"and treat it as"none"instead.GrantExpandable, even when GitHub effective permission is"none".Context
Reported on DoorDash (
github_v2): C1 showed repo pull inherited from org membership for ~all members (~7.6k), whileGET /repos/.../collaborators/{user}/permissionreturned"none". Root cause is the empty→"read"default ingetOrgBasePermission.