Repository navigation
feat(source-github): support wildcard repositories for users - #83319
Bhupesh Cholake (RealBhupesh) wants to merge 10 commits into
Conversation
👋 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 TricksPR Slash CommandsAs needed or by request, Airbyte Maintainers can execute the following slash commands on your PR:
Tips for Working with CI
📚 Show Repo GuidanceHelpful Resources
|
|
↪️ Triggering 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 ( Thanks for the contribution! |
|
🧪 Fix Validation Evidence🟢 Outcome: Fix ProvenThe new capability was exercised end-to-end and works, with no regression on the existing organization path. Against a user-owned wildcard ( 🚦 Next Steps
📋 Connector & PR detailsConnector: 📝 Evidence planProving criteria
Disproving criteria
Testing strategyIsolated testing only — no live customer connection was pinned or synced. The new codepath is triggered purely by a config value ( Cases attempted
✅ Pre-flight checks
📊 Detailed evidence logLocal comparison — PR build vs. published
|
| 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.
|
|
|
↪️ Triggering Reason: |
Reviewing PR for connector safety and quality.
|
🛡️ AI PR Review Report🔴 Review Action: REQUEST CHANGES
|
| 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 Connectorsuccess ·Build and Verify Artifacts (source-github)success ·Test source-github Connector [No Creds]failure ·source-github Pre-Release Checkssuccess (excluded) ·source-github Progressive Rollout Gatefailure (excluded) ·Connector Active Progressive Rollout Checks Summaryfailure (excluded) ·Format Check,Check Changelog Updated,Docs / Vale,Docs / MarkDownLint,Analyze Python,Validate PR Titlesuccess ·CodeQLneutral - 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 onRepositoryOwners.path/request_params— worth a look, but bot comments do not affect PR Hygiene - Spec comparison: not applicable — no
spec*.json/spec*.yamlor 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.
|
↪️ Triggering Reason: The branch now conflicts with |
|
Co-Authored-By: bot_apk <[email protected]>
|
🔀 Resolved merge conflict with Resolution: conflicts were limited to version/changelog churn from Pushed the resolved branch; its CI and review gates will re-run on the new HEAD. |
|
↪️ Triggering Reason: |
Reviewing PR for connector safety and quality.
|
🛡️ AI PR Review Report🔴 Review Action: REQUEST CHANGES
|
| 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 Connectorsuccess ·Build and Verify Artifacts (source-github)success ·Test source-github Connector [No Creds]failure ·source-github Pre-Release Checkssuccess (excluded) ·source-github Progressive Rollout Gatefailure (excluded) ·Connector Active Progressive Rollout Checks Summaryfailure (excluded) ·Format Check,Check Changelog Updated,Docs / Vale,Docs / MarkDownLint,Analyze Python,Validate PR Titlesuccess ·CodeQLneutral - 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 onRepositoryOwners.path/request_params— worth a look, but bot comments do not affect PR Hygiene - Spec comparison: not applicable — no
spec*.json/spec*.yamlor 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.
|
🙋 Escalated to #human-in-the-loop per Hands-Free AI Triage Project triage next step. Reason: |
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.
Baz (bazarnov)
left a comment
There was a problem hiding this comment.
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.
|
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. |
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:
/users/{owner}to distinguish users from organizations./users/{owner}/reposfor user-owned wildcard repositories and keeps/orgs/{owner}/reposfor organizations.The connector version is bumped to 2.2.0 because this adds a supported configuration capability.
Checks
152 passed.metadata.yamlsuccessfully.pyproject.tomlandmetadata.yaml.git diff --check.