Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions deploy/CONNECTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Connectors pull data from your tools — Jira issues, Slack messages, GitHub pul
- [Prerequisites](#prerequisites)
- [Contents](#contents)
- [Anatomy of a connector Secret](#anatomy-of-a-connector-secret)
- [The 19 available connectors](#the-19-available-connectors)
- [The 20 available connectors](#the-20-available-connectors)
- [Example Secret for every connector](#example-secret-for-every-connector)
- [AI & coding assistants](#ai--coding-assistants)
- [Source control & CI](#source-control--ci)
Expand Down Expand Up @@ -52,16 +52,16 @@ stringData:
jira_api_token: "ATATT-CHANGE_ME"
```

## The 19 available connectors
## The 20 available connectors

Replace `CHANGE_ME` (and any other placeholder) values in whichever connector files you need, under `connectors/`:

`jira`, `slack`, `github-v2`, `gitlab`, `m365`, `zoom`, `confluence`, `zendesk`, `bamboohr`, `ms-entra`, `outline`, `hubspot`, `cursor`, `chatgpt-team`, `claude-team`, `claude-enterprise`, `bitbucket-cloud`, `zulip-proxy`, `github-directory`.
`jira`, `slack`, `github-v2`, `gitlab`, `m365`, `zoom`, `confluence`, `zendesk`, `bamboohr`, `ms-entra`, `outline`, `hubspot`, `cursor`, `chatgpt-team`, `claude-team`, `claude-enterprise`, `bitbucket-cloud`, `zulip-proxy`, `github-directory`, `github-nocode`.

Apply all of them at once, or one at a time:

```sh
kubectl -n insight apply -f connectors/ # all 19 connectors at once
kubectl -n insight apply -f connectors/ # all 20 connectors at once
# or one at a time:
kubectl -n insight apply -f connectors/jira.yaml
```
Expand Down Expand Up @@ -203,6 +203,28 @@ stringData:
github_organizations: '["myorg"]' # JSON array
```

```yaml
# Declarative GitHub connector on the git-cli-proxy: commit-level data comes
# from a bare clone served by the proxy instead of one vendor API call per
# commit. Needs the proxy deployed (gitClIProxy.deploy: true) and
# git_proxy_token equal to APP__gears__git_cli_proxy__config__proxy_token in
# the umbrella-composed insight-git-cli-proxy-config Secret.
apiVersion: v1
kind: Secret
metadata:
name: insight-github-nocode-main
namespace: insight
labels: { app.kubernetes.io/part-of: insight }
annotations: { insight.cyberfabric.com/connector: github-nocode, insight.cyberfabric.com/source-id: github-nocode-main }
type: Opaque
stringData:
github_token: "ghp_CHANGE_ME" # repo, read:org
github_organizations: '["myorg"]' # JSON array
github_start_date: "2026-01-01"
git_proxy_url: "http://insight-git-cli-proxy:8085"
git_proxy_token: "CHANGE_ME" # must match the proxy's own Secret
```

### Issue tracking & docs

```yaml
Expand Down
5 changes: 4 additions & 1 deletion scripts/ci/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@
"pytest_args": "--suites-only",
"cover": False,
"triggered_by": ["connector-tests-harness"],
"paths": ["src/ingestion/connectors/task-tracking/jira"],
"paths": [
"src/ingestion/connectors/task-tracking/jira",
"src/ingestion/connectors/git/github-nocode",
],
},
# `src/frontend/helm` falls under this path but has no measured lines, so it
# never moves the number.
Expand Down
24 changes: 24 additions & 0 deletions scripts/ci/connector_wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
4. cast-types — contributors MUST NOT explicitly cast the same class_people
column to different types; `union_by_tag` UNION ALLs the
branches and ClickHouse raises Code 386 NO_COMMON_TYPE.
5. builder — a declarative `connector.yaml` MUST NOT carry the Airbyte
Builder's `#magic___^_^___line` marker. Inside a `>-` folded
scalar it is CONTENT, not a comment, so a round-trip through
the Builder silently appends it to whatever value it landed
in — including `unique_key`, which is the declared
primary_key and the ReplacingMergeTree order_by.

Empty `images.<key>.image` refs are reported as warnings, never errors: a
brand-new CDK connector legitimately ships with `image: ""` and is patched by
Expand All @@ -38,6 +44,9 @@
"""

# ruff: noqa: T201 — stdout/stderr IS this script's CI report (cf. changed.py).

# Scoped to connector.yaml on purpose: the same marker appears legitimately in
# prose (dbt model descriptions, test-case docs), and an ignore-list would rot.
from __future__ import annotations

import argparse
Expand All @@ -50,6 +59,7 @@
# Strict semver per semver.org §2, identical to classify_bump.py and
# bump-descriptor-version.sh: numeric identifiers MUST NOT carry leading
# zeroes, which is what keeps `2026.05.04` distinguishable from a real triplet.
BUILDER_MARKER = "#magic___"
SEMVER_RE = re.compile(r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$")

CLASS_PEOPLE_TAG = "silver:class_people"
Expand Down Expand Up @@ -160,6 +170,20 @@ def main(argv: list[str]) -> int:
f"`./generate-connectors-config.sh '{rel}'`."
)

# ── 5. Airbyte Builder marker ───────────────────────────────────────
# Read as RAW TEXT: after yaml.safe_load the marker is indistinguishable
# from any other substring, which is exactly the problem.
manifest = connector_dir / "connector.yaml"
if manifest.is_file():
for lineno, line in enumerate(manifest.read_text().splitlines(), start=1):
if BUILDER_MARKER in line:
errors.append(
f"{rel}/connector.yaml:{lineno}: contains "
f"{BUILDER_MARKER!r}. Inside a `>-` folded scalar this is "
"CONTENT, not a comment — it is appended to the value. "
"Strip it after every Builder round-trip."
)

# ── 3-4. class_people contributors only ─────────────────────────────
if not models:
continue
Expand Down
15 changes: 15 additions & 0 deletions src/ingestion/connections/example-tenant.yaml.example
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
10 changes: 7 additions & 3 deletions src/ingestion/connectors/git/github-directory/connector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ definitions:
error_handler:
type: DefaultErrorHandler
max_retries: 5
# The CDK resolves backoff per requester, not per response filter: the
# first strategy returning a value wins for every retryable response.
# X-RateLimit-Reset is stamped on GitHub responses of any status, so
# reading it here would put a transient 5xx to sleep until the hourly
# window resets.
backoff_strategies:
- type: WaitTimeFromHeader
header: Retry-After
max_waiting_time_in_seconds: 600
- type: WaitUntilTimeFromHeader
header: X-RateLimit-Reset
max_waiting_time_in_seconds: 600
- type: ExponentialBackoffStrategy
factor: 2
Comment thread
aleksdotbar marked this conversation as resolved.
Resolved
response_filters:
- type: HttpResponseFilter
action: RATE_LIMITED
Expand Down
76 changes: 76 additions & 0 deletions src/ingestion/connectors/git/github-nocode/README.md
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).
Loading
Loading