Skip to content

chore(ingestion): retire orphaned run-init.sh host-script family - #1486

Merged
cyberantonz merged 5 commits into
constructorfabric:mainfrom
cyberantonz:chart-validation
Jun 25, 2026
Merged

chore(ingestion): retire orphaned run-init.sh host-script family#1486
cyberantonz merged 5 commits into
constructorfabric:mainfrom
cyberantonz:chart-validation

Conversation

@cyberantonz

@cyberantonz cyberantonz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

run-init.sh and its chain were a manual host bootstrap that the gitops Hook-Job + Argo reconcile-cron model has fully obsoleted, and they no longer even run (sync-flows.sh sourced airbyte-toolkit/, removed earlier). The per-connector sync CronWorkflows they generated are now created and maintained in-cluster by the reconcile loop (verified on the live cluster: *-default-sync CronWorkflows are owned by insight-reconcile-loop, not sync-flows.sh), and ClickHouse migrations moved to the clickhouse-migrate Hook Job.

Remove (dead/broken):

  • run-init.sh, scripts/init.sh, scripts/sync-flows.sh, update-workflows.sh, workflows/schedules/sync.yaml.tpl

Keep (live manual one-shot tools, no broken deps):

  • run-sync.sh, run-tt-enrich-jira.sh, workflows/onetime/, reconcile-connectors/

Fix references in current docs/code to point at reconcile-connectors.sh:

  • src/ingestion/README.md, docs/domain/ingestion/{README,DESIGN,PRD,DECOMPOSITION}, docs/domain/identity-resolution/DESIGN, cypilot connector skill docs, dbt_project.yml + reconcile-connectors/lib/airbyte.sh comments, .gitignore.

Mark superseded toolkit specs obsolete (historical, not rewritten):

  • airbyte-toolkit PRD.md + DESIGN.md banners; ADR-0004 obsoleted-mechanics note. Live reconcile ADRs/FEATURE left intact.

Summary by CodeRabbit

  • New Features
    • Introduced a unified reconciliation workflow for connector setup and scheduled ingestion, including in-cluster reconciliation.
    • Added the ability to reconcile a single connector via scoped commands.
  • Documentation
    • Updated deployment and operations/runbook steps to use the new reconciliation flow (including an optional “adopt” pass).
    • Marked legacy host-based initialization and update commands as obsolete and removed them from the documented lifecycles.

run-init.sh and its chain were a manual host bootstrap that the gitops
Hook-Job + Argo reconcile-cron model has fully obsoleted, and they no
longer even run (sync-flows.sh sourced airbyte-toolkit/, removed earlier).
The per-connector sync CronWorkflows they generated are now created and
maintained in-cluster by the reconcile loop (verified on the live cluster:
*-default-sync CronWorkflows are owned by insight-reconcile-loop, not
sync-flows.sh), and ClickHouse migrations moved to the clickhouse-migrate
Hook Job.

Remove (dead/broken):
- run-init.sh, scripts/init.sh, scripts/sync-flows.sh, update-workflows.sh,
  workflows/schedules/sync.yaml.tpl

Keep (live manual one-shot tools, no broken deps):
- run-sync.sh, run-tt-enrich-jira.sh, workflows/onetime/, reconcile-connectors/

Fix references in current docs/code to point at reconcile-connectors.sh:
- src/ingestion/README.md, docs/domain/ingestion/{README,DESIGN,PRD,DECOMPOSITION},
  docs/domain/identity-resolution/DESIGN, cypilot connector skill docs,
  dbt_project.yml + reconcile-connectors/lib/airbyte.sh comments, .gitignore.

Mark superseded toolkit specs obsolete (historical, not rewritten):
- airbyte-toolkit PRD.md + DESIGN.md banners; ADR-0004 obsoleted-mechanics
  note. Live reconcile ADRs/FEATURE left intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Anton Zelenov <antonz@constructor.tech>
@cyberantonz
cyberantonz requested a review from a team as a code owner June 25, 2026 12:46
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR replaces documented host-side init and workflow update steps with reconcile-connectors.sh, updates ingestion and domain specs for per-connector CronWorkflow reconciliation, and marks legacy Airbyte toolkit materials and supporting comments as obsolete.

Changes

Ingestion reconcile docs migration

Layer / File(s) Summary
Connector workflow guides
cypilot/.core/skills/connector/workflows/deploy.md, cypilot/.core/skills/connector/workflows/workflow.md
The connector workflow guides now use reconcile-connectors.sh --connector <name> and describe CronWorkflow rendering from descriptor.yaml schedules and the umbrella-installed WorkflowTemplates.
Ingestion command docs
src/ingestion/README.md, docs/domain/ingestion/README.md
reconcile-connectors.sh replaces the documented setup, deployment, onboarding, and schedule-change commands; the src/ingestion/ tree description now shows the reconcile-connectors/ layout and per-connector CronWorkflow ownership.
Orchestration and use-case specs
docs/domain/ingestion/specs/DECOMPOSITION.md, docs/domain/ingestion/specs/DESIGN.md, docs/domain/ingestion/specs/PRD.md, docs/domain/identity-resolution/specs/DESIGN.md
The ingestion and identity-resolution specs switch orchestration steps from run-init.sh/update-workflows.sh to reconcile-connectors.sh, and describe per-connector CronWorkflow rendering, apply, and scheduled reconciliation.
Legacy toolkit notes and support comments
docs/components/airbyte-toolkit/specs/ADR/0004-cluster-config-via-configmap.md, docs/components/airbyte-toolkit/specs/DESIGN.md, docs/components/airbyte-toolkit/specs/PRD.md, docs/components/airbyte-toolkit/specs/feature-reconcile/FEATURE.md, src/ingestion/.gitignore, src/ingestion/dbt/dbt_project.yml, src/ingestion/reconcile-connectors/lib/airbyte.sh
The Airbyte toolkit docs are marked obsolete/superseded, and supporting comments now describe in-cluster reconcile behavior, stale CronWorkflow ignores, placeholder provenance, and environment-variable sourcing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • mitasovr

Poem

I hopped through docs by moonlit light,
Reconcile scripts now lead the flight.
CronWorkflows hum on schedule fair,
Old host-side trails dissolve to air,
Thump! New paths bloom bright. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: retiring the legacy ingestion host-script family, especially run-init.sh and related scripts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/components/airbyte-toolkit/specs/feature-reconcile/FEATURE.md`:
- Line 99: The current description for cpt-insightspec-actor-ci-pipeline
conflates the scheduled in-cluster CronWorkflow with the host-triggered one-shot
flow. Update the wording in the feature spec to clearly separate these paths:
the CronWorkflow schedules in-cluster reconcile runs, while the host triggers
the separate reconcile/sync execution path. Use the
cpt-insightspec-actor-ci-pipeline entry as the anchor and adjust the sentence so
it no longer implies the CronWorkflow itself is invoked on demand from the host.

In `@docs/domain/ingestion/specs/DECOMPOSITION.md`:
- Around line 295-299: The spec entry points to the wrong template location
because it omits the `src/ingestion/` prefix. Update the reference in the
reconciliation section to use the correct template path from the repository,
keeping the surrounding bullets intact and ensuring the `reconcile-connectors`
template location is accurate for readers.

In `@docs/domain/ingestion/specs/PRD.md`:
- Around line 630-634: The reconcile flow description overstates what the script
does by saying it creates the destination. Update the “Main Flow” wording to
reflect that the reconcile path in the connector reconcile script and
CronWorkflow resolves the destination ID, but only creates the source and
connection when needed. Keep the description aligned with the actual reconcile
behavior in the PRD section so it matches the
`reconcile-connectors.sh`/CronWorkflow flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e2fbc06-da1e-466f-b4ad-7611c8a96dd8

📥 Commits

Reviewing files that changed from the base of the PR and between 509e241 and 7b32581.

📒 Files selected for processing (20)
  • cypilot/.core/skills/connector/workflows/deploy.md
  • cypilot/.core/skills/connector/workflows/workflow.md
  • docs/components/airbyte-toolkit/specs/ADR/0004-cluster-config-via-configmap.md
  • docs/components/airbyte-toolkit/specs/DESIGN.md
  • docs/components/airbyte-toolkit/specs/PRD.md
  • docs/components/airbyte-toolkit/specs/feature-reconcile/FEATURE.md
  • docs/domain/identity-resolution/specs/DESIGN.md
  • docs/domain/ingestion/README.md
  • docs/domain/ingestion/specs/DECOMPOSITION.md
  • docs/domain/ingestion/specs/DESIGN.md
  • docs/domain/ingestion/specs/PRD.md
  • src/ingestion/.gitignore
  • src/ingestion/README.md
  • src/ingestion/dbt/dbt_project.yml
  • src/ingestion/reconcile-connectors/lib/airbyte.sh
  • src/ingestion/run-init.sh
  • src/ingestion/scripts/init.sh
  • src/ingestion/scripts/sync-flows.sh
  • src/ingestion/update-workflows.sh
  • src/ingestion/workflows/schedules/sync.yaml.tpl
💤 Files with no reviewable changes (5)
  • src/ingestion/scripts/init.sh
  • src/ingestion/update-workflows.sh
  • src/ingestion/scripts/sync-flows.sh
  • src/ingestion/workflows/schedules/sync.yaml.tpl
  • src/ingestion/run-init.sh

Comment thread docs/components/airbyte-toolkit/specs/feature-reconcile/FEATURE.md Outdated
Comment thread docs/domain/ingestion/specs/DECOMPOSITION.md Outdated
Comment thread docs/domain/ingestion/specs/PRD.md
cyberantonz and others added 2 commits June 25, 2026 15:07
The ingestion README still pointed at removed scripts/dirs after the
host-script retirement + reconcile refactor. Fix the verifiable rot:

- airbyte-toolkit/cdk-build.sh        → reconcile-connectors/lib/cdk-build.sh
- airbyte-toolkit/lib/env.sh          → reconcile-connectors/lib/env.sh
- update-connectors/-connections/-workflows.sh → reconcile-connectors.sh
- run-init.sh                         → reconcile-connectors.sh (+ migrations
                                        are a clickhouse-migrate Hook Job)
- secrets/validate.sh                 → removed (validation is internal to
                                        reconcile: valsec_check_secret)
- namespace `data`                    → `insight` (single-namespace umbrella)
- drop "done automatically by up.sh"  (up.sh removed)
- Project Structure tree aligned to actual src/ingestion contents

Left for a product-aware follow-up (flagged, not guessed): NodePort access
URLs (localhost:30500/30123), "Kind"-specific local-dev wording, the
tenant_id ConfigMap mechanism, and the ClickHouse debug snippets that
assume a bundled in-namespace CH (now external in insight-infra).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Anton Zelenov <antonz@constructor.tech>
- FEATURE.md: separate the scheduled in-cluster CronWorkflow path from the
  host-run reconcile command (the CronWorkflow isn't host-invoked).
- DECOMPOSITION.md: correct cron-workflow template path to the full
  src/ingestion/reconcile-connectors/templates/ location.
- PRD.md: the reconcile step creates source + connection; the shared bronze
  destination is resolved (created once) per ADR-0012, not created per-connector.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Anton Zelenov <antonz@constructor.tech>

```bash
./update-workflows.sh <tenant>
./reconcile-connectors.sh --connector <name>

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.

i'm not sure we have such script, but ok for now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it is reconcile.sh, i will fix

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/ingestion/README.md`:
- Line 28: The README and the reconcile script disagree on the namespace for the
insight-config ConfigMap. Update the documentation in README to match the actual
behavior of reconcile-connectors/main.sh, or change the script if the intended
default namespace is now insight; make sure the namespace referenced alongside
INSIGHT_TENANT_ID and the connector reconciliation flow is consistent
everywhere.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 30a148a2-d793-4ade-9712-923925e2f45b

📥 Commits

Reviewing files that changed from the base of the PR and between 7b32581 and f577dee.

📒 Files selected for processing (4)
  • docs/components/airbyte-toolkit/specs/feature-reconcile/FEATURE.md
  • docs/domain/ingestion/specs/DECOMPOSITION.md
  • docs/domain/ingestion/specs/PRD.md
  • src/ingestion/README.md
✅ Files skipped from review due to trivial changes (3)
  • docs/components/airbyte-toolkit/specs/feature-reconcile/FEATURE.md
  • docs/domain/ingestion/specs/DECOMPOSITION.md
  • docs/domain/ingestion/specs/PRD.md

Comment thread src/ingestion/README.md
@cyberantonz
cyberantonz merged commit 277a7ae into constructorfabric:main Jun 25, 2026
18 checks passed
@cyberantonz
cyberantonz deleted the chart-validation branch June 26, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants