Repository navigation
Releases
Releases · slashben/cq-source-github
v0.1.0
The first release.
Every table of the old plugin now exists (31 tables, parity/pending.json is empty), plus 19 new GitHub Actions tables, 50 in all. Child tables are synced only when listed in tables: (or with skip_dependent_tables: false); the examples list them. The README's "Tables" section lists every table with its parent, scope, permission and request cost.
Release readiness
- The workflows' actions are pinned to commit SHAs and GoReleaser to an exact version (v2.20.2). A tag with a pre-release suffix (
v0.1.0-rc.1) is published as a pre-release, and the released binary reports the tag (v0.1.0), asmake builddoes. CI has arelease-buildjob that runs GoReleaser in snapshot mode and checks, withscripts/check-dist.sh, thatdist/holds exactly the sixcq-source-github_<os>_<arch>.ziparchives (one file each) andchecksums.txt. - New documents:
docs/releasing.md(the owner's checklist),SECURITY.mdandCONTRIBUTING.md.
Tables of the old plugin, now implemented
- Organizations:
github_organization_members,github_organization_dependabot_alertsandgithub_organization_dependabot_secrets(children ofgithub_organizations);github_teamswithgithub_team_membersandgithub_team_repositories;github_hookswithgithub_hook_deliveries;github_installations;github_external_groups. - Repositories:
github_repository_branches,github_repository_keys,github_repository_sboms,github_releaseswithgithub_release_assets,github_repository_dependabot_alertsandgithub_repository_dependabot_secrets(children ofgithub_repositories). - Billing:
github_billing_action,github_billing_packageandgithub_billing_storage, one row per organization. - Issues and traffic:
github_issues(listed withstate=all, pull requests included, as before) andgithub_traffic_clones,github_traffic_views,github_traffic_paths,github_traffic_referrers.
New Actions tables (not in the old plugin)
- 19 tables:
github_organization_runners,github_repository_runners,github_organization_hosted_runners,github_organization_runner_groups(with childrengithub_organization_runner_group_runnersandgithub_organization_runner_group_repositories),github_organization_actions_permissions,github_repository_actions_permissions,github_organization_actions_secrets,github_repository_actions_secrets,github_organization_actions_variables,github_repository_actions_variables,github_environments(with childrengithub_environment_secretsandgithub_environment_variables),github_artifacts,github_actions_caches,github_organization_oidc_subject_claimsandgithub_repository_oidc_subject_claims. Secret tables hold names and metadata only. The variables tables store variable values. - With
local_cache_pathset, the Actions variables listings are requested withCache-Control: no-store, so variable values are never written to the HTTP cache. The SBOM requests ofgithub_repository_sbomsare too, so the redirect carrying the report's pre-signed download URL is never stored and a cached "not ready" answer cannot hide a finished report. The README now says the cache holds full API responses. Only responses from the API host are written to the cache; requests to hosts other than the API host bypass it (on github.com that includes the upload host, as well as download redirects).
Differences from the old plugin
- A per-row lookup that GitHub denies (403 that is not a rate limit, or 404) leaves its column null and keeps the row. This covers
membershipofgithub_organization_membersandgithub_team_members,protectionofgithub_repository_branches(also null when the branch has no protection any more) andrequestandresponseofgithub_hook_deliveries, which keeps the listing's summary. Any other error leaves the column null and is logged, except forgithub_hook_deliveries, where it fails the table for that hook (rows already emitted stay). The old plugin failed the row when themembershiplookup ofgithub_organization_membersor theprotectionlookup failed;docs/behaviour-notes.mddoes not record what it did for team membership or delivery detail. github_organization_dependabot_secretsreads all pages of secrets; the old plugin read only the first page.github_repository_sbomsuses GitHub's asynchronous SBOM flow (generate, then fetch, up to 6 attempts over about 30 seconds), falling back to the legacy synchronous endpoint when generation answers 404 (older GitHub Enterprise Server). A report that is not ready in time is skipped with a warning and picked up by a later sync. A downloaded report larger than 64 MiB is a download error for that repository. A 404 from the legacy endpoint (dependency graph disabled) skips the table for that repository with a warning that mentions the dependency graph, instead of failing with an error.- Billing: when GitHub answers 404 or 410 (organizations on the new billing platform) the table yields no rows and one warning per organization and table says the endpoint is unavailable; a 403 skips the table with the usual warning. The rows are decoded into the plugin's own structs, so fractional values such as
estimated_storage_for_monthare stored instead of failing the table, and the integer columns (days_left_in_billing_cycleand the two bandwidth columns ofgithub_billing_package) are rounded to the nearest integer when GitHub sends a number with a fraction (such as5.0). github_releaseskeeps the columnsmake_latest,discussion_category_nameandgenerate_release_notesof the old schema, but they are always null: GitHub only accepts them when creating a release and the current client library no longer has them on its release type. Releases include drafts and prereleases.github_release_assets: a 404 for a release's assets (the release was deleted during the sync) yields no rows for that release, without a warning. A 404 on a child ofgithub_repositories(github_repository_branches,github_repository_keys,github_releases,github_repository_dependabot_alerts,github_repository_dependabot_secrets,github_repository_sboms) or ofgithub_organizations(github_organization_members,github_organization_dependabot_alerts,github_organization_dependabot_secrets) skips the table with a warning, as a 403 does: those parents come from discovery or theorgslist, so a 404 usually means an endpoint the credentials cannot read (deploy keys need admin access, for example).github_repository_sboms: a 410 from the legacy endpoint is reported as 404 in the skip warning (SkipOnNoAccesstreats only 403 and 404 as no access).github_traffic_pathsandgithub_traffic_referrersskip an entry without its path or referrer, with a debug line, since a null key cannot be written.github_issues: a repository with issues disabled (410) yields no rows and a debug line, not a warning.- The traffic tables need push access; a 403 skips the table with the usual warning.
github_team_members: the organization ID is read from the segment afterorganizationsin the team'smembers_url, so GitHub Enterprise Server URLs (with an/api/v3prefix) work too.github_hooks.configand the deliveries'requestandresponseare stored as GitHub returns them and are never logged.
Skipping, retries and incremental sync
github_organizationsis skipped with a warning, instead of failing, when GitHub answers 404 (for example for a user account inorgs).- A table skipped for lack of access is warned about once per organization and table instead of once per repository; later skips log at debug level, and the sync ends with one info line per table and organization giving the number of skips (one per repository, or per parent row for a child table: runs for
github_workflow_jobsandgithub_workflow_run_usage). - The skip warning is now once per organization, table and HTTP status, so a table denied first with 403 and later with 404 gets both warnings. A child listing dropped because its parent answered 404 (team, hook, release, workflow run, environment or runner group deleted during the sync) is still silent at the default level, but the sync's end now reports it: one info line per table and organization,
child listings dropped because the parent was gone, with thecount. The per-listing debug line is nowparent not found, skipping its rowsfor every such table; the parent's ID keeps its field (team_id,hook_id,release_id,environment_id,runner_group_id,run_id). - GET requests answered with 500, 502, 503 or 504, or failing without a response, are retried up to 3 times after 1, 2 and 4 seconds (a single 500 on one page of a repository's artifacts listing failed the rest of that repository in a real run; other methods are not retried); a GET whose response headers do not arrive within 60 seconds is retried once only.
- A GET whose response body breaks while being read (such as
stream error: ... CANCEL; received from peeron HTTP/2, or a body shorter than itsContent-Length) is retried the same way as a failed connection. Successful GET bodies of up to 16 MiB are read in full before they are handed on, so the HTTP cache only stores complete bodies. github_workflow_jobs: when a page of a run's jobs listing fails with 500, 502, 503 or 504 after those retries, the run's listing is restarted once with 30 jobs a page (GitHub times out on large pages of jobs for some runs), without emitting any job twice.- Incremental sync: a run on the retry list is refetched on every sync while its first failure is under an hour old, then at most hourly. Once its first failure is over a day old, the next sync gives it a final attempt; if its jobs or usage fail again (or it cannot be fetched on that attempt) it is dropped with one warning. A full retry list (1,000 runs) keeps its runs and refuses new ones with a war...