Skip to content

feat(source-github): support wildcard repositories for users - #83319

Closed
Bhupesh Cholake (RealBhupesh) wants to merge 10 commits into
airbytehq:masterfrom
RealBhupesh:RealBhupesh/source-github-user-wildcard
Closed

Bhupesh Cholake (RealBhupesh) wants to merge 10 commits into
airbytehq:masterfrom
RealBhupesh:RealBhupesh/source-github-user-wildcard

Conversation

@RealBhupesh

Copy link
Copy Markdown

What

Fixes #67626.

The GitHub source currently treats every wildcard repository configuration such as username/* as an organization and calls /orgs/{owner}/repos. This prevents users from selecting all repositories owned by a personal GitHub account.

This change:

  • Resolves wildcard owners through /users/{owner} to distinguish users from organizations.
  • Uses /users/{owner}/repos for user-owned wildcard repositories and keeps /orgs/{owner}/repos for organizations.
  • Passes user-owned repositories into the existing repository stream set while keeping organization-only streams scoped to organizations.
  • Documents the user wildcard syntax and adds regression coverage for both owner types.

The connector version is bumped to 2.2.0 because this adds a supported configuration capability.

Checks

  • GitHub unit tests: 152 passed.
  • Python compilation passed.
  • Parsed metadata.yaml successfully.
  • Verified the version matches in pyproject.toml and metadata.yaml.
  • Ran git diff --check.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

👋 Welcome to Airbyte!

Thank you for your contribution from RealBhupesh/airbyte! We're excited to have you in the Airbyte community.

If you have any questions, feel free to ask in the PR comments or join our Slack community.

💡 Show Tips and Tricks

PR Slash Commands

As needed or by request, Airbyte Maintainers can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
  • /run-connector-tests - Runs connector tests.
  • /run-cat-tests - Runs CAT tests.
  • /run-regression-tests - Runs regression tests for the modified connector(s).
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
  • /ai-review - AI-powered PR review for connector safety and quality gates.
  • /ai-docs-review - AI-powered documentation review for PRs with connector changes.
  • /ai-create-docs-pr - Creates a documentation PR for connector changes.
  • /force-merge reason="<A_GOOD_REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.

Tips for Working with CI

  1. Pre-Release Checks. Please pay attention to these, as they contain standard checks on the metadata.yaml file, docs requirements, etc. If you need help resolving a pre-release check, please ask a maintainer.
    • Note: If you are creating a new connector, please be sure to replace the default logo.svg file with a suitable icon.
  2. Connector CI Tests. Some failures here may be expected if your tests require credentials. Please review these results to ensure (1) unit tests are passing, if applicable, and (2) integration tests pass to the degree possible and expected.
  3. (Optional.) BYO Connector Credentials for tests in your fork. You can optionally set up your fork with BYO credentials for your connector. This can significantly speed up your review, ensuring your changes are fully tested before the maintainers begin their review.
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@RealBhupesh Bhupesh Cholake (RealBhupesh) changed the title ✨ Source GitHub: support wildcard repositories for users feat(source-github): support wildcard repositories for users Aug 2, 2026
@airbyte-support-bot

Copy link
Copy Markdown
Contributor

↪️ Triggering /ai-prove-fix per Hands-Free AI Triage Project triage next step.

Reason: Draft community PR with no fix-validation on record. Running prove-fix to publish a pre-release image and gather regression evidence (SPEC/CHECK/DISCOVER/READ) so the change has objective validation attached before it reaches a maintainer.

Note on CI: the failing checks (Progressive Rollout Gate, Connector Active Progressive Rollout Checks Summary, [No Creds] connector tests) are the standard fork-PR limitations — forked branches cannot access the org secrets those jobs require — rather than defects in this diff.

Thanks for the contribution!


Devin session

@octavia-bot-suspended

octavia-bot-suspended Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

🔍 AI Prove Fix session starting... Running readiness checks and testing against customer connections. View playbook

✅ Devin AI session created successfully!

@airbyte-support-bot

Airbyte Support Bot (airbyte-support-bot) commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

🧪 Fix Validation Evidence

🟢 Outcome: Fix Proven

The new capability was exercised end-to-end and works, with no regression on the existing organization path. Against a user-owned wildcard (octocat/*), the published baseline 2.1.38 fails check (/orgs/octocat/repos → repeated HTTP 404, "Some of the provided repositories couldn't be found") and emits 0 repositories records, while the PR build succeeds and emits 8 records (matching public_repos: 8 for that account). Against an organization wildcard, the PR build emits a byte-for-byte identical repository set to 2.1.38. A full comparison regression test (all 39 streams, GSM integration credentials) came back SPEC/CHECK/DISCOVER/READ all ✅ with zero record-count deltas on every stream.

🚦 Next Steps
  1. This PR looks ready for maintainer review and merge.
  2. One caveat worth a maintainer decision before merge (does not block validation): private user repositories are not synced. The implementation calls GET /users/{owner}/repos, which is the public repository listing, and passes no visibility/affiliation parameters. Even when the PAT belongs to the account being synced, only public repos are returned — confirmed in testing (all 8 emitted records had "private": false). Syncing private repos for a user wildcard would require GET /user/repos?affiliation=owner for the authenticated user. Either implement that or document the limitation in docs/integrations/sources/github.md, so user/* isn't mistaken for parity with org/*.
  3. For broader validation before release, /ai-canary-prerelease can exercise the pre-release on additional connections.
  4. The daily_hands_free_triage automation will monitor the release rollout after merge.

📋 Connector & PR details

Connector: source-github
PR: #83319 (2.1.38 → 2.2.0), head 4cd0f02
Pre-release version: 2.2.0-preview.4cd0f02
Comparison baseline: latest (auto) = airbyte/source-github:2.1.38 — the current published version is exactly the one lacking the capability, so no override_control_image was needed.
Regression test run: https://github.com/airbytehq/airbyte-ops-mcp/actions/runs/30746265807
Detailed results: this comment (no customer data was involved — all validation used public GitHub accounts and Airbyte integration-test credentials).

📝 Evidence plan

Proving criteria

  1. repositories: ["<user>/*"] — check succeeds and the repositories stream emits that user's repos, where 2.1.38 resolves nothing.
  2. repositories: ["<org>/*"] — the target emits the same repository set as 2.1.38.
  3. No unexpected differences across SPEC/CHECK/DISCOVER/READ in the comparison regression test.

Disproving criteria

  • User wildcard still yields no repositories, or fails check.
  • Organization wildcard emits fewer/different repositories than the baseline, or org-scoped streams (teams, users, organizations) start receiving user owners.

Testing strategy

Isolated testing only — no live customer connection was pinned or synced. The new codepath is triggered purely by a config value (user/*) that no production connection can be using today, since it does not work; pinning a customer connection would have proven nothing. Evidence therefore comes from (a) the Cloud comparison regression test for no-regression coverage and (b) a local run of the PR build vs. the published 2.1.38 image against public GitHub data with both wildcard types, which is the only way to exercise the new behavior.

Cases attempted

# Case Outcome
1 Local, user wildcard, PR build vs 2.1.38 ✅ Proving evidence — see below
2 Local, organization wildcard, PR build vs 2.1.38 ✅ No regression — identical output
3 Cloud comparison regression test, all streams, GSM credentials ✅ All four verbs PASS, no deltas
4 Connector unit tests on the PR branch ✅ 171 passed
✅ Pre-flight checks
  • Viability — the diff addresses the reported gap (GitHub source only allow for repositories in organizations when using a wildcard and not also for users #67626). Wildcard owners are classified via GET /users/{owner}; user-owned wildcards read from /users/{owner}/repos while organizations keep /orgs/{org}/repos. Organization-only streams remain scoped to organizations, so user owners are not fed into org endpoints.
  • Safety — no obfuscation, no changes to credential handling, no new external endpoints beyond documented GitHub REST routes.
  • Breaking change — none. No schema, primary-key, cursor, spec, stream-removal, or state-format changes. Repositories records for user-owned repos populate the existing synthetic organization field with the username, which is the same state partition key the stream already uses. The 2.1.38 → 2.2.0 minor bump is appropriate for an additive capability; no breakingChanges entry required.
  • Pin exclusion — n/a; no connections were pinned.
  • Reversibility — safe to roll back. State written under the username partition key is readable by 2.1.38; downgrading simply restores the old behavior.
📊 Detailed evidence log

Local comparison — PR build vs. published 2.1.38

Ran spec, check, discover, and a repositories-only read for each combination. Baseline runs used docker run --rm airbyte/source-github:2.1.38; target runs used the PR branch at 4cd0f02 via poetry run source-github. Read-only calls against public GitHub data.

Implementation Config spec check discover repositories records
baseline 2.1.38 octocat/* (user) SUCCEEDED FAILED FAILED 0
PR 2.2.0 octocat/* (user) SUCCEEDED SUCCEEDED SUCCEEDED 8
baseline 2.1.38 pyca/* (org) SUCCEEDED SUCCEEDED SUCCEEDED 7
PR 2.2.0 pyca/* (org) SUCCEEDED SUCCEEDED SUCCEEDED 7

Baseline octocat/* check message, and the log emitted after the 404s:

Some of the provided repositories couldn't be found. Please verify if every entered repository has a valid name...
Syncing `Repositories` stream isn't available for organization `octocat`.

The eight records emitted by the PR build for octocat/*:

octocat/Spoon-Knife            octocat/git-consortium
octocat/boysenberry-repo-1     octocat/hello-worId
octocat/Hello-World            octocat/octocat.github.io
octocat/linguist               octocat/test-repo1

The seven records for pyca/* were identical between the PR build and 2.1.38 (pyca/cryptography, pyopenssl, bcrypt, service-identity, infra, pynacl, ed25519).

Debug logs confirm the intended request routing — owner classification followed by the owner-type-appropriate endpoint:

user  → GET /users/octocat        then GET /users/octocat/repos?per_page=100&sort=updated&direction=desc
org   → GET /users/pyca           then GET /orgs/pyca/repos

Cloud comparison regression test

Target airbyte/source-github:dev (built from this PR) vs. control airbyte/source-github:2.1.38, GSM integration credentials, all streams, comparison mode.

Command Result Details
SPEC ✅ PASS Both versions succeeded
CHECK ✅ PASS Both versions succeeded
DISCOVER ✅ PASS Both versions succeeded
READ ✅ PASS Both versions succeeded

Record counts were identical across all 39 streams (Δ = 0 everywhere), including repositories (278 = 278), organizations, teams, team_members, and users — i.e. the extra owner-classification step did not change which repositories or organizations are resolved. Message-type totals matched exactly (1,080 RECORD, 258 STATE, 110 TRACE on both sides); the only delta in the entire run was +1 LOG message on the target, consistent with the one additional GET /users/{owner} classification request per wildcard owner. That extra request is also the one operational cost of this change: one additional API call per wildcard owner per sync, negligible against GitHub's rate limit.

Unit tests

poetry run pytest unit_tests on the PR branch: 171 passed (warnings are pre-existing deprecation notices).

Notes on CI

The [No Creds] connector-test failures and the progressive-rollout checks are standard fork-PR limitations — forked branches cannot access the org secrets those jobs need — not defects in this diff. The first pre-release publish attempt (run) failed on a transient 429 Too Many Requests from the GitHub contents API while reading metadata.yaml; it was re-triggered (run) and is unrelated to the change.


Devin session

@airbyte-support-bot Airbyte Support Bot (airbyte-support-bot) added the hyd-prove Hydra: ai-prove-fix stage has run label Aug 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Pre-release Connector Publish Started

Publishing pre-release build for connector source-github.
PR: #83319

Pre-release versions will be tagged as {version}-preview.4cd0f02
and are available for version pinning via the scoped_configuration API.

View workflow run
❌ Pre-release Publish FAILED for source-github.

@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Pre-release Connector Publish Started

Publishing pre-release build for connector source-github.
PR: #83319

Pre-release versions will be tagged as {version}-preview.4cd0f02
and are available for version pinning via the scoped_configuration API.

View workflow run
❌ Pre-release Publish FAILED for source-github.

@airbyte-support-bot
Airbyte Support Bot (airbyte-support-bot) marked this pull request as ready for review August 3, 2026 11:35
@airbyte-support-bot

Copy link
Copy Markdown
Contributor

↪️ Triggering /ai-review per Hands-Free AI Triage Project triage next step.

Reason: /ai-prove-fix posted 🟢 Fix Proven, so the PR has been marked ready-for-review and is due for AI review.

Devin session

@octavia-bot-suspended

octavia-bot-suspended Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

AI PR Review starting...

Reviewing PR for connector safety and quality.
View playbook

✅ Devin AI session created successfully!

@airbyte-support-bot

Airbyte Support Bot (airbyte-support-bot) commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ AI PR Review Report

🔴 Review Action: REQUEST CHANGES

Gate Status
Forwards Compatibility FAIL (warning — elevates Risk Level, does not block)
Behavioral Changes FAIL (warning — elevates Risk Level, does not block)
CI Checks FAIL (enforced)

⚠️ Risk Level: 4/5

Repositories.stream_slices/transform and a new per-owner GET /users/{owner} call trip the two anti-pattern gates (which force risk ≥ 4), though the org path itself is byte-for-byte unchanged per /ai-prove-fix.

🔧 Remediation Required

CI Checks (enforced — blocks approval)

Test source-github Connector [No Creds] fails on both runs of this HEAD SHA. Unit tests are green (163 passed, plus 8 passed in the second session); the only failures are the CDK docker standard tests:

FAILED test_airbyte_standards.py::TestSuite::test_docker_image_build_and_check['config' Test Scenario]
  - FileNotFoundError: .../source-github/secrets/config.json
FAILED test_airbyte_standards.py::TestSuite::test_docker_image_build_and_check['config_oauth' Test Scenario]
  - FileNotFoundError: .../source-github/secrets/config_oauth.json

This is the expected fork-PR limitation (no access to org secrets), not a defect in the diff — a maintainer can re-run the connector tests from the base-repo context (/run-connector-tests) or manually approve after code review. The bot cannot approve while a core check is red.

Forwards Compatibility (warning)

Add a unit test at the Repositories stream level that exercises the new user slices — that stream_slices() still yields the pre-existing {"organization": <org>} slices unchanged, and that a user slice produces record["organization"] == <username> (the checkpoint partition key) via the new transform branch. This turns the state/partition reasoning below from inference into evidence.

Behavioral Changes (warning)

Note in the PR description that each wildcard owner now costs one additional GET /users/{owner} request during check/discover (visible in the updated requests_mock.call_count assertions: 5→7 and 2→3), so reviewers can weigh the extra rate-limit consumption for configs with many wildcard owners.


📋 PR Details

Connector(s): source-github (2.1.38 → 2.2.0)
PR: #83319
HEAD SHA: 4cd0f027e814fc3822bc583325ceb2e23e697b2f
Session: https://app.devin.ai/sessions/7b55146802604d2a8b2b10c2e88b53d3
Linked issue: #67626

🔍 Gate Evaluation Details

Gate-by-Gate Analysis

Gate Status Enforced? Details
PR Hygiene PASS Yes 1022-char description (well above the 50-char floor); changelog row 2.2.0 added in docs/integrations/sources/github.md; only unresolved comments are from github-advanced-security[bot] (bot comments are ignored).
Code Hygiene PASS WARNING Source changed (source.py, streams.py) and tests changed (unit_tests/test_source.py) → coverage evidence found.
Test Coverage PASS Yes feat title + linked issue → gate applies; new def test_get_user_repositories with assert users == ["example"] and a repository-set assertion.
Code Security PASS Yes No changed path matches *auth*/*token*/*credential*/*secret*; metadata.yaml diff hunks touch only dockerImageTag, none of allowedHosts/connectorBuildOptions/dockerRepository.
Per-Record Performance PASS WARNING Only per-record addition is one dict assignment in Repositories.transform for user slices; the new GET /users/{owner} is per wildcard owner at stream-init, not per record.
Breaking Dependencies PASS WARNING No dependency changes; pyproject.toml diff is the version string only.
Backwards Compatibility PASS Yes (enforced) No spec*.json/spec*.yaml change, no schemas/*.json change, no type/format change, no stream removed/renamed, no primary-key or cursor field or value change for existing org partitions. metadata.yaml diff is dockerImageTag: 2.1.38 → 2.2.0 — an additive capability, so minor bump with no releases.breakingChanges entry is correct.
Forwards Compatibility FAIL Warning (elevates Risk Level) Repositories is incremental (SemiIncrementalMixin) and its diff hunks touch stream_slices, transform and the slice shape ({"organization": …, "owner_type": "user"}), with no test covering slice/state behavior → fails the "keywords present without tests proving forwards compatibility" rule. Mitigating analysis: org slices are emitted unchanged by yield from super().stream_slices(...) and user slices are new partitions with no prior state, so the worst rollback case is loss of the new capability (user wildcards fail check again on 2.1.x), not corrupted or unreadable state.
Behavioral Changes FAIL Warning (elevates Risk Level) Operational keyword rate_limit matched in added lines (owner_stream.exit_on_rate_limit = True if is_check_connection else False, and the stream.exit_on_rate_limit lines duplicated into the org/user branches) — semantics are copied verbatim from the previous single-branch code, but the new resolution call does add one request per wildcard owner to the API budget (test assertions updated 5→7 and 2→3 calls).
Out-of-Scope Changes PASS Skip All 6 changed files are under airbyte-integrations/connectors/source-github/** or docs/**.
CI Checks FAIL Yes Core check Test source-github Connector [No Creds] = failure on both runs of this SHA (FileNotFoundError: secrets/config.json, secrets/config_oauth.json); unit tests themselves pass (163 + 8). Lint source-github Connector and Build and Verify Artifacts (source-github) are green. Test failure expected for community PR without credentials — maintainers can manually approve after code review. source-github Progressive Rollout Gate / Connector Active Progressive Rollout Checks Summary failures are excluded as release-management checks, and source-github Pre-Release Checks (success) is excluded as a pre-release check.
Live / E2E Tests PASS Yes Validation required (bug-fix/feature indicators + sync/discovery paths touched). /ai-prove-fix posted 🟢 Fix Proven: on octocat/* the published 2.1.38 baseline fails check (/orgs/octocat/repos → 404) and emits 0 repositories records while the PR build emits 8 (matching public_repos: 8); on an organization wildcard the PR build emits a byte-for-byte identical repository set to the baseline. Gate defers to that conclusion.
📚 Evidence Consulted

Evidence

  • Changed files: 6 — metadata.yaml, pyproject.toml, source_github/source.py (+48/−12), source_github/streams.py (+38/−3), unit_tests/test_source.py (+34/−7), docs/integrations/sources/github.md
  • CI checks (HEAD 4cd0f02): Lint source-github Connector success · Build and Verify Artifacts (source-github) success · Test source-github Connector [No Creds] failure · source-github Pre-Release Checks success (excluded) · source-github Progressive Rollout Gate failure (excluded) · Connector Active Progressive Rollout Checks Summary failure (excluded) · Format Check, Check Changelog Updated, Docs / Vale, Docs / MarkDownLint, Analyze Python, Validate PR Title success · CodeQL neutral
  • PR labels: community, connectors/source/github, hyd-prove, hyd-review
  • PR description: present (1022 chars)
  • Fix validation: /ai-prove-fix 🟢 Fix Proven (comment 5157588275)
  • Existing bot reviews: none from this reviewer for this SHA; github-advanced-security[bot] left 3 CodeQL "signature mismatch in overriding method" comments on RepositoryOwners.path/request_params — worth a look, but bot comments do not affect PR Hygiene
  • Spec comparison: not applicable — no spec*.json/spec*.yaml or schema file modified
❓ How to Respond

Resolving a Failing Gate

Each non-PASS gate above lists concrete remediation. Apply it, push, then re-run /ai-review — the bot re-evaluates from the diff, CI check-runs, and /ai-prove-fix results.

Written explanations do not change a gate verdict. If you believe a gate is a false positive or it cannot be remediated as written, request review from a human maintainer and explain the situation to them in a PR comment — a human reviewer can approve or merge over a bot FAIL. Never edit the PR description to argue with the bot; the description is how reviewers learn what the PR does.

@airbyte-support-bot

Copy link
Copy Markdown
Contributor

↪️ Triggering /ai-resolve-conflicts per Hands-Free AI Triage Project triage next step.

Reason: The branch now conflicts with master (mergeStateStatus: DIRTY), which blocks every downstream pipeline stage. Resolving the conflict lets the PR resume at its correct stage on the next pass.

Devin session

@octavia-bot-suspended

octavia-bot-suspended Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🔀 AI Resolve Conflicts session starting... Merging the latest master into the PR branch and resolving conflicts, then pushing the resolved branch so its CI and review gates re-run on the new HEAD. View playbook

✅ Devin AI session created successfully!

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🔀 Resolved merge conflict with master.

Resolution: conflicts were limited to version/changelog churn from master's dependency bump to 2.1.39 — metadata.yaml dockerImageTag and pyproject.toml version keep this PR's higher 2.2.0, and the docs/integrations/sources/github.md changelog keeps both entries (2.2.0 above 2.1.39). No source-code conflicts.

Pushed the resolved branch; its CI and review gates will re-run on the new HEAD.


Devin session

@airbyte-support-bot

Copy link
Copy Markdown
Contributor

↪️ Triggering /ai-review per Hands-Free AI Triage Project triage next step.

Reason: /ai-resolve-conflicts pushed a resolved branch (HEAD is now 5ec9d57b), so the previous review marker for 4cd0f027 is stale and a refreshed review is the next gate.

Devin session

@octavia-bot-suspended

octavia-bot-suspended Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

AI PR Review starting...

Reviewing PR for connector safety and quality.
View playbook

✅ Devin AI session created successfully!

@airbyte-support-bot

Airbyte Support Bot (airbyte-support-bot) commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ AI PR Review Report

🔴 Review Action: REQUEST CHANGES

Gate Status
Forwards Compatibility FAIL (warning — elevates Risk Level, does not block)
Behavioral Changes FAIL (warning — elevates Risk Level, does not block)
CI Checks FAIL (enforced)

⚠️ Risk Level: 4/5

Repositories.stream_slices/transform and a new per-owner GET /users/{owner} call trip the two anti-pattern gates (which force risk ≥ 4), though the org path itself is byte-for-byte unchanged per /ai-prove-fix.

ℹ️ This is a re-review after /ai-resolve-conflicts merged master into the branch (HEAD 4cd0f02 → 5ec9d57). The conflict resolution only reconciled version/changelog churn (2.1.39 base, keeping this PR's 2.2.0); the connector diff and the gate outcomes are unchanged from the previous review.

🔧 Remediation Required

CI Checks (enforced — blocks approval)

Test source-github Connector [No Creds] fails on this HEAD. Unit tests are green (163 passed, plus 8 passed in the second session); the only failures are the CDK docker standard tests:

FAILED test_airbyte_standards.py::TestSuite::test_docker_image_build_and_check['config' Test Scenario]
  - FileNotFoundError: .../source-github/secrets/config.json
FAILED test_airbyte_standards.py::TestSuite::test_docker_image_build_and_check['config_oauth' Test Scenario]
  - FileNotFoundError: .../source-github/secrets/config_oauth.json

This is the expected fork-PR limitation (no access to org secrets), not a defect in the diff — a maintainer can re-run the connector tests from the base-repo context (/run-connector-tests) or manually approve after code review. The bot cannot approve while a core check is red.

Forwards Compatibility (warning)

Add a unit test at the Repositories stream level that exercises the new user slices — that stream_slices() still yields the pre-existing {"organization": <org>} slices unchanged, and that a user slice produces record["organization"] == <username> (the checkpoint partition key) via the new transform branch. This turns the state/partition reasoning below from inference into evidence.

Behavioral Changes (warning)

Note in the PR description that each wildcard owner now costs one additional GET /users/{owner} request during check/discover (visible in the updated requests_mock.call_count assertions: 5→7 and 2→3), so reviewers can weigh the extra rate-limit consumption for configs with many wildcard owners.


📋 PR Details

Connector(s): source-github (2.1.39 → 2.2.0)
PR: #83319
HEAD SHA: 5ec9d57ba9bf367eb2c78c3faae0f4637735936d
Session: https://app.devin.ai/sessions/72b3c68f5bbd484394d9f60b00355be7
Linked issue: #67626

🔍 Gate Evaluation Details

Gate-by-Gate Analysis

Gate Status Enforced? Details
PR Hygiene PASS Yes 1022-char description (well above the 50-char floor); changelog row 2.2.0 present in docs/integrations/sources/github.md (now correctly above the merged 2.1.39 row); only unresolved comments are from github-advanced-security[bot] (bot comments are ignored).
Code Hygiene PASS WARNING Source changed (source.py, streams.py) and tests changed (unit_tests/test_source.py) → coverage evidence found.
Test Coverage PASS Yes feat title + linked issue → gate applies; new def test_get_user_repositories with assert users == ["example"] and a repository-set assertion.
Code Security PASS Yes No changed path matches *auth*/*token*/*credential*/*secret*; metadata.yaml diff hunks touch only dockerImageTag, none of allowedHosts/connectorBuildOptions/dockerRepository.
Per-Record Performance PASS WARNING Only per-record addition is one dict assignment in Repositories.transform for user slices; the new GET /users/{owner} is per wildcard owner at stream-init, not per record.
Breaking Dependencies PASS WARNING No dependency changes; pyproject.toml diff is the version string only (2.1.39 → 2.2.0).
Backwards Compatibility PASS Yes (enforced) No spec*.json/spec*.yaml change, no schemas/*.json change, no type/format change, no stream removed/renamed, no primary-key or cursor field or value change for existing org partitions. metadata.yaml diff is dockerImageTag: 2.1.39 → 2.2.0 — an additive capability, so minor bump with no releases.breakingChanges entry is correct.
Forwards Compatibility FAIL Warning (elevates Risk Level) Repositories is incremental (SemiIncrementalMixin) and its diff hunks touch stream_slices, transform and the slice shape ({"organization": …, "owner_type": "user"}), with no test covering slice/state behavior → fails the "keywords present without tests proving forwards compatibility" rule. Mitigating analysis: org slices are emitted unchanged by yield from super().stream_slices(...) and user slices are new partitions with no prior state, so the worst rollback case is loss of the new capability (user wildcards fail check again on 2.1.x), not corrupted or unreadable state.
Behavioral Changes FAIL Warning (elevates Risk Level) Operational keyword rate_limit matched in added lines (owner_stream.exit_on_rate_limit = True if is_check_connection else False, and the stream.exit_on_rate_limit lines duplicated into the org/user branches) — semantics are copied verbatim from the previous single-branch code, but the new resolution call does add one request per wildcard owner to the API budget (test assertions updated 5→7 and 2→3 calls).
Out-of-Scope Changes PASS Skip All 6 changed files are under airbyte-integrations/connectors/source-github/** or docs/**.
CI Checks FAIL Yes Core check Test source-github Connector [No Creds] = failure on this SHA (FileNotFoundError: secrets/config.json, secrets/config_oauth.json); unit tests themselves pass (163 + 8). Lint source-github Connector and Build and Verify Artifacts (source-github) are green. Test failure expected for community PR without credentials — maintainers can manually approve after code review. source-github Progressive Rollout Gate / Connector Active Progressive Rollout Checks Summary failures are excluded as release-management checks, and source-github Pre-Release Checks (success) is excluded as a pre-release check.
Live / E2E Tests PASS Yes Validation required (feature indicators + sync/discovery paths touched). /ai-prove-fix posted 🟢 Fix Proven: on octocat/* the published 2.1.38 baseline fails check (/orgs/octocat/repos → 404) and emits 0 repositories records while the PR build emits 8 (matching public_repos: 8); on an organization wildcard the PR build emits a byte-for-byte identical repository set to the baseline. The merge-conflict resolution did not touch connector code, so the prove-fix conclusion remains valid for this HEAD. Gate defers to that conclusion.
📚 Evidence Consulted

Evidence

  • Changed files: 6 — metadata.yaml, pyproject.toml, source_github/source.py (+48/−12), source_github/streams.py (+38/−3), unit_tests/test_source.py (+34/−7), docs/integrations/sources/github.md
  • CI checks (HEAD 5ec9d57): Lint source-github Connector success · Build and Verify Artifacts (source-github) success · Test source-github Connector [No Creds] failure · source-github Pre-Release Checks success (excluded) · source-github Progressive Rollout Gate failure (excluded) · Connector Active Progressive Rollout Checks Summary failure (excluded) · Format Check, Check Changelog Updated, Docs / Vale, Docs / MarkDownLint, Analyze Python, Validate PR Title success · CodeQL neutral
  • PR labels: community, connectors/source/github, hyd-prove, hyd-review
  • PR description: present (1022 chars)
  • Fix validation: /ai-prove-fix 🟢 Fix Proven (connector code unchanged since that run — only version/changelog conflict resolution)
  • Existing bot reviews: prior REQUEST CHANGES marker was for old HEAD 4cd0f02 (superseded); github-advanced-security[bot] left 3 CodeQL "signature mismatch in overriding method" comments on RepositoryOwners.path/request_params — worth a look, but bot comments do not affect PR Hygiene
  • Spec comparison: not applicable — no spec*.json/spec*.yaml or schema file modified
❓ How to Respond

Resolving a Failing Gate

Each non-PASS gate above lists concrete remediation. Apply it, push, then re-run /ai-review — the bot re-evaluates from the diff, CI check-runs, and /ai-prove-fix results.

Written explanations do not change a gate verdict. If you believe a gate is a false positive or it cannot be remediated as written, request review from a human maintainer and explain the situation to them in a PR comment — a human reviewer can approve or merge over a bot FAIL. Never edit the PR description to argue with the bot; the description is how reviewers learn what the PR does.

@airbyte-support-bot

Copy link
Copy Markdown
Contributor

🙋 Escalated to #human-in-the-loop per Hands-Free AI Triage Project triage next step.

Reason: /ai-resolve-conflicts pushed a resolved branch, but /ai-review then returned FAIL for the exact current HEAD 5ec9d57b and connector CI is red, so no automated gate is left. A maintainer needs to rule on the review findings or send the author direction.

Devin session

Resolve conflicts in favour of master for source_github/source.py,
source_github/streams.py, unit_tests/test_source.py and
docs/integrations/sources/github.md.

Master replaced the Python repository discovery this branch patched:
`_get_org_repositories` and the Python `Repositories` stream are gone,
wildcard expansion now runs through the manifest's `repositories_resolver`
partition routers. The branch's changes to that code no longer apply, so the
merge keeps master's implementation and the fix is re-applied on top against
the current architecture.
…ounts

`owner/*` only ever expanded through `GET /orgs/{owner}/repos`, which 404s for a
user account, so a wildcard entry naming a user resolved to no repositories at
all: `check` reported "Some of the provided repositories couldn't be found" and
every stream synced nothing (airbytehq#67626).

Route the listing on the owner type instead. `GET /users/{owner}` answers for
both kinds of owner and reports which one it is in `type`, so the new
`owner_types_resolver` stream resolves each wildcard owner once (cached) and
carries the type in the partition's `extra_fields`, from where the shared
`owner_repositories_path` picks `users/{owner}/repos` or `orgs/{owner}/repos`.

Organizations keep the org endpoint, which is the only listing that includes the
private repos the token can see; switching everything to the user endpoint would
have dropped those silently. Org-scoped streams keep receiving organizations
only: `organization_partition_router` now slices on the owner list filtered to
non-user accounts, so a user login can never reach `/orgs/{login}/...`. The
`repositories` stream slices on the unfiltered owner list instead, since listing
a user's repos is exactly that stream's job.

Partition fields and per-partition state keys are unchanged, so the organization
path emits the same records as before at the cost of one extra cached request per
wildcard owner.
Resolution, both shared partition routers, the `repositories` stream and `check`
are each pinned for a user-owned wildcard, and the organization path is pinned
against ever falling back to the user listing (it would silently drop private
repos).

Wildcard owner resolution now costs one `GET /users/{owner}` per owner, so the
shared mocks answer that endpoint with an organization by default and the two
`check` request counts grow by one per wildcard owner. Tests about user-owned
wildcards register their own response for that owner.
Document that a wildcard entry may name a user account and that a user's
listing covers public repositories only.

@bazarnov Baz (bazarnov) 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.

Thanks for the contribution - the bug is real and your diagnosis was exactly right; the earlier prove-fix run also confirmed it end to end (user wildcard: baseline fails check with repeated 404 and 0 records, the fix emits the full repository set; org path byte-identical).

What changed since you opened the PR: master migrated repository discovery to the declarative manifest (_get_org_repositories and the Python Repositories stream no longer exist), so the original Python implementation could not apply. I re-ported the intent into the manifest: an owner-type resolver (GET /users/{owner}, cached, one extra request per wildcard owner - same request math as your version) routes each wildcard owner to users/{owner}/repos or orgs/{owner}/repos (list-repositories-for-a-user), organization-scoped streams keep receiving only organizations, and per-partition state keys stay unchanged so existing connections keep their state. Your docs line and test scenarios were carried over; the CodeQL signature-mismatch alerts died with the replaced code.

Also packaged: release 2.4.0 (changelog 2026-08-28) and a note in the docs that /users/{owner}/repos returns public repositories only - private user-owned repos still need explicit entries. Evaluated: not breaking - additive capability, no schema/state/PK change, spec byte-identical.

Verification on this head: 254 unit tests green (8 new user-wildcard tests, red on master), credentialed Connector CI Checks Summary green, connector regression run (repositories, target vs control) success. Fork [No Creds] failing is expected.

Merger note: active progressive rollout for source-github (2.2.0) >> bypass checkbox or finalize first. PR 82726 (exclusion selectors) touches the same manifest region - whichever lands second needs a small rebase.

@github-project-automation github-project-automation Bot moved this from New PRs to Ready to Ship in 🧑‍🏭 Community Pull Requests Aug 28, 2026
@pnilan

Copy link
Copy Markdown
Member

Closing as this PR as been approved for 4+ weeks and no action have been taken. Please submit a Github issue for this request if still desired.

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

Projects

Status: Inactive

Development

Successfully merging this pull request may close these issues.

GitHub source only allow for repositories in organizations when using a wildcard and not also for users

6 participants