Skip to content

feat(connectors): add sink/source connector templates, authoring guide, and blog post - #4636

Open
ryerraguntla wants to merge 6 commits into
masterfrom
feat/connectors-3956-sink-source-templates
Open

ryerraguntla wants to merge 6 commits into
masterfrom
feat/connectors-3956-sink-source-templates

Conversation

@ryerraguntla

Copy link
Copy Markdown
Contributor

Fixes #3956

What

Adds two ready-to-copy connector crates under core/connectors/:

  • core/connectors/sinks/sink_template/
  • core/connectors/sources/source_template/

Each implements every framework-level requirement already expected of a production connector — config parsing with unknown-field rejection,SecretString-wrapped credentials, connectivity validation in open(), retry/backoff + circuit breaker via iggy_connector_sdk::retry::RetryPolicy, batch processing / Ack-Nack cursor staging, and a canonical test suite — leaving only the backend-specific bits marked TODO(ConnectorDeveloper):

  • sink_template: the outbound data-push call to the destination system, plus a stable per-message dedup key for idempotent writes.
  • source_template: the connection/client setup, the data-fetch call against the source system, and setting a natural per-record identity on ProducedMessage.id when one exists.

Also included:

  • core/connectors/docs/authoring-sinks-and-sources.md — a written guide walking through the required patterns and why each one exists, meant to be cross-linked from the connector READMEs and reused as the basis for an Apache Iggy blog post.
  • core/connectors/BLOG_POST.md — a narrative draft for the project blog announcing the templates.
  • .claude/skills/connector-pr-review/SKILL.md — a new review-checklist skill (B1-B11 blockers, convention nits) encoding review patterns mined from real apache/iggy connector PRs, so recurring review comments (secrets typing, retry/circuit-breaker gaps, cursor staging, idempotency claims, zero-delivered-still-reports-Ok, ack-path budget blowups) get caught before human review instead of during it.
  • Updated connector-sink, connector-source, connector-testing, and connectors-overview skills to cross-link the templates and the new review checklist, and to reflect the current Source::batch_policy() / NACK-retry-configurability SDK surface (fix(connectors): make source NACK retries configurable and observable #4269) and the current resolver/toolchain setup, replacing stale text that predated both.
  • Workspace registration (Cargo.toml, Cargo.lock) and README entries (sinks/README.md, sources/README.md, core/connectors/README.md) for both new crates, each with publish = false.
  • Example runtime configs
    (core/connectors/runtime/example_config/connectors/{sink,source}_template.toml).

Why

Per the discussion in #3956: connector PRs have repeatedly lost review
cycles to the same non-backend-specific issues (secrets typed as plain
String, missing retry/circuit-breaker, config knob name drift, missing
canonical state tests, zero-delivered batches reported as success, ack-path
work with no bound on its own retry budget). Rather than re-teaching the
same framework contract PR after PR, these templates make the required
pattern the path of least resistance — a new connector starts from working,
reviewed-pattern code and only needs the backend-specific logic filled in.
The paired connector-pr-review skill turns the same lessons into an automatic pre-flight check for future connector PRs.

Testing

  • cargo build -p iggy_connector_template_sink -p iggy_connector_template_source
  • cargo test -p iggy_connector_template_sink -p iggy_connector_template_source (20/20)
  • cargo clippy -p iggy_connector_template_sink -p iggy_connector_template_source --all-targets -- -D warnings
  • cargo fmt --all --check
  • cargo sort --check --no-format (crate + workspace)
  • cargo machete
  • cargo doc -p iggy_connector_template_sink -p iggy_connector_template_source --no-deps with RUSTDOCFLAGS="-D warnings"
  • markdownlint on every new/changed doc
  • ./scripts/ci/license-headers.sh --check

AI Usage

  • Tools: Claude (Claude Code)
  • Scope: template crate authoring, the review-checklist skill, rebasing onto current master and reconciling against SDK changes that landed after the branch was first cut (e.g. fix(connectors): make source NACK retries configurable and observable #4269's batch_policy()), and mining real apache/iggy connector PR review comments for the checklist content.
  • Verification: see Testing above. Full verification chain run locally against the actual rebased/current apache/master, not a stale base.
  • I can explain every line of code and every checklist item if asked.

Notes for reviewers / before marking ready

  • This branch previously went out as feat(connectors): add sink_template and source_template starting points #3965 (closed: corrupted git history from repeated master merges) and separately as a draft on docs/connector-guidelines-template-and-blog-post (closed/abandoned, also under a misleading docs/ prefix despite shipping real code — renamed to this branch for that reason). This PR is the rebuilt, rebased, re-verified version of that work, squashed to a clean history.

AI Usage

If AI tools were used, please answer:

  1. Which tools? Claude
  2. Scope of usage? Analysis of the previous connectors PR reiew, summary of the analysis and template generation
  3. How did you verify the generated code works correctly? Reviewed Manually
  4. Can you explain every line of the code if asked? Yes

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Oct 24, 2026
@hubcio

hubcio commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

lets wait with this PR till deferred polling PR is merged, it changes all connectors

@ryerraguntla

Copy link
Copy Markdown
Contributor Author

/author

@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Oct 24, 2026
@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.27835% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.76%. Comparing base (717719c) to head (e349759).
⚠️ Report is 25 commits behind head on master.

Files with missing lines Patch % Lines
core/connectors/sources/source_template/src/lib.rs 76.56% 43 Missing and 2 partials ⚠️
core/connectors/sinks/sink_template/src/lib.rs 91.83% 11 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4636      +/-   ##
============================================
+ Coverage     89.78%   90.76%   +0.98%     
- Complexity     2146     2964     +818     
============================================
  Files          1343     1461     +118     
  Lines        291806   348126   +56320     
  Branches     248040   292931   +44891     
============================================
+ Hits         261989   315976   +53987     
- Misses        24096    25487    +1391     
- Partials       5721     6663     +942     
Components Coverage Δ
Rust Core 92.08% <84.27%> (+1.05%) ⬆️
Java SDK 77.75% <ø> (+4.57%) ⬆️
C# SDK 83.54% <ø> (+2.22%) ⬆️
Python SDK 85.64% <ø> (-5.08%) ⬇️
PHP SDK 90.59% <ø> (+2.72%) ⬆️
Node SDK 96.45% <ø> (+1.22%) ⬆️
Go SDK 69.96% <ø> (-1.87%) ⬇️
C++ SDK 85.45% <ø> (+0.75%) ⬆️
Files with missing lines Coverage Δ
core/connectors/sinks/sink_template/src/lib.rs 91.83% <91.83%> (ø)
core/connectors/sources/source_template/src/lib.rs 76.56% <76.56%> (ø)

... and 542 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author PR is waiting on author response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add sink/source connector templates under core/connectors/ as fill-in-the-blank starting points

2 participants