Repository navigation
feat(github): replace the CDK GitHub connector #2490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8ed3a84
feat(github-nocode): declarative GitHub connector on the git-cli-proxy
aleksdotbar 5d758c1
refactor(github): promote the proxy connector to the github slug
aleksdotbar 3fc210f
feat(github): point the silver staging models at the proxy bronze
aleksdotbar 5e546fb
test(metrics): reshape the git fixtures to the proxy bronze columns
aleksdotbar ffbade1
chore(github): add the bronze DDL snapshot for the renamed connector
aleksdotbar 7836f76
fix(github): correct the setup contract the connector documents
aleksdotbar fc76959
feat(github): collect issue and pull-request lifecycle events
aleksdotbar 5aec0ef
chore(github): snapshot the timeline-event tables and the new class
aleksdotbar e1d5545
docs(github): correct two claims the connector no longer holds
aleksdotbar fce690c
perf(github): bound the worst-case file-changes page
aleksdotbar db4a962
chore(ingestion): dump the silver snapshot from a complete warehouse
aleksdotbar f3770d6
fix(github): dedup the mutable bronze reads the staging models make
aleksdotbar ee08ccc
fix(github): close the gaps an adversarial review of this branch found
aleksdotbar d501ff0
chore: drop the YAML formatter and the marker check that chased it
aleksdotbar 76edefd
fix(github): stop the staging models reporting values they do not have
aleksdotbar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Tenant config for the LOCAL declarative-connector runner | ||
| # (tools/declarative-connector/source.sh). Not used by the deployed reconcile | ||
| # loop, which reads the tenant from the connector Secret in the cluster. | ||
| # | ||
| # Copy to {tenant-name}.yaml (e.g. acme.yaml) and pass that name as the | ||
| # <tenant> argument: | ||
| # | ||
| # cp example-tenant.yaml.example acme.yaml | ||
| # ./tools/declarative-connector/source.sh check git/github-nocode acme | ||
| # | ||
| # Contains ONLY tenant_id — every credential comes from the connector Secret | ||
| # in secrets/connectors/<connector>.yaml, and insight_source_id from that | ||
| # Secret's insight.cyberfabric.com/source-id annotation. | ||
|
|
||
| tenant_id: example_tenant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # github-nocode | ||
|
|
||
| Declarative GitHub connector on the git-cli-proxy: commit-level extraction | ||
| (commits, per-file changes, branches) is served from a bare blobless clone by | ||
| the proxy instead of one vendor API call per commit; everything git cannot | ||
| carry (PRs, reviews, comments, issues, projects, CI, deployments) stays on | ||
| api.github.com. | ||
|
|
||
| Coexists with `git/github-v2` (CDK) under its own `data_source` | ||
| (`insight_github_nocode`); nothing is replaced or deleted by this connector. | ||
|
|
||
| ## Streams | ||
|
|
||
| | Stream | Source | Incremental | | ||
| |---|---|---| | ||
| | repositories | GitHub `/orgs/{org}/repos` | full refresh | | ||
| | commits | proxy `/v1/commits` | committed_date, per pushed repo | | ||
| | file_changes | proxy `/v1/file-changes` | committed_date, per pushed repo | | ||
| | branches | proxy `/v1/branches` | full refresh, per pushed repo | | ||
| | pull_requests | `/repos/{r}/pulls` (list) | updated_at, newest-first data feed | | ||
| | pull_request_reviews | `/pulls/{n}/reviews` | windowed PR parent, full refresh per PR | | ||
| | pull_request_commits | `/pulls/{n}/commits` | windowed PR parent, full refresh per PR | | ||
| | pull_request_diff_stats | GraphQL `repository.pullRequests` nodes | updated_at, newest-first data feed | | ||
| | pull_request_comments | `/repos/{r}/issues/comments` | updated_at, server-side `since` | | ||
| | issues | `/repos/{r}/issues` | updated_at, server-side `since`; PRs filtered out | | ||
| | projects_v2 | GraphQL `organization.projectsV2` | full refresh | | ||
| | workflow_runs | `/repos/{r}/actions/runs` | created_at, weekly step windows | | ||
| | deployments | `/repos/{r}/deployments` | created_at, newest-first data feed | | ||
| | deployment_statuses | `/deployments/{id}/statuses` | windowed deployments parent | | ||
|
|
||
| **org_members is deliberately absent**: the deployed `git/github-directory` | ||
| connector already syncs the org roster for identity resolution. Folding it in | ||
| here is a separate migration. | ||
|
|
||
| ## Error policy | ||
|
|
||
| - GitHub reports secondary rate limits as **403**, so throttle predicates | ||
| (body message, `x-ratelimit-remaining: 0`) run before any 403 handling; | ||
| what remains of 403 — plus 404/410 — on repo-scoped streams skips that | ||
| repository and the sync continues. 401 fails fast as a config error. | ||
| - The proxy answers 429 + Retry-After while a repository is being cloned in | ||
| the background; proxy requesters retry generously (a cold clone of a large | ||
| repository runs many Retry-After cycles). 404/413 skip the repository; | ||
| 409 (superseded snapshot) fails the attempt — the rerun resumes from the | ||
| stored cursor. | ||
| - GraphQL errors arrive as HTTP 200: rate-limit-typed errors back off, | ||
| anything else fails with GitHub's own message. | ||
|
|
||
| ## Known NULL columns (v1) | ||
|
|
||
| `pull_requests.additions/deletions/changed_files/merged_by` are detail-only | ||
| (`GET /pulls/{n}`) and are not fetched — PR size derives from the proxy's | ||
| file_changes. Inline code-review comments (`/pulls/comments`) are not synced; | ||
| conversation comments and reviews are. | ||
|
|
||
| ## Cost shape | ||
|
|
||
| Steady state ≈ 6 calls/repo + 1 call per PR updated in the child window + | ||
| 1 call per deployment created in the deploy window + O(changed rows). First | ||
| workflow_runs backfill goes back at most 90 days — GitHub's run retention — | ||
| paged in weekly windows because `created` queries cap at 1000 results per | ||
| window. | ||
|
|
||
| ### PR size | ||
|
|
||
| `pull_request_diff_stats` carries per-pull-request `additions`, `deletions` and | ||
| `changed_files`. REST has these on the pull-request DETAIL response only, which | ||
| would cost one call per pull request; the GraphQL list node carries all three, | ||
| so a page of 100 pull requests costs a single request. The connection accepts | ||
| no `updatedAfter` argument, so the stream is a newest-first data feed like | ||
| `pull_requests`. | ||
|
|
||
| ## Silver Targets | ||
|
|
||
| Not wired yet — bronze-only until the silver dbt models land (they must match | ||
| the CDK connectors' column types exactly or `union_by_tag` fails). |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.