Skip to content

fix(endpoint): use Kafka client bootstrap addresses - #694

Closed
marcschier wants to merge 3 commits into
xregistry:mainfrom
marcschier:fix/spec-625-kafka-bootstrap-values
Closed

marcschier wants to merge 3 commits into
xregistry:mainfrom
marcschier:fix/spec-625-kafka-bootstrap-values

Conversation

@marcschier

@marcschier marcschier commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #625

Proposed Changes - current review scope

This original PR remains open as policy decision (e). The approved
three-bundle consolidation does not approve or merge this proposal.

The two Contoso entries can be aligned with Kafka's documented canonical host:port client configuration and the existing separate security.protocol model member as b. The surrounding normative patch goes further: strict scheme exclusion, mandatory bracketed IPv6, and mandatory rejection of implicit listener-URL migration are an explicit xRegistry admission/compatibility profile, not a universally forced native-client correction.

e - decision requiring separate approval

The profile forbids previously illustrated/tolerated forms and constrains consumer migration behavior. Its helper/documentation follows that choice, not a standalone c defect.

  • @@ -1012,10 +1013,44 @@: complete address-admission/security/migration profile and its new example
  • Kafka configuration reference and supporting authoring hint
  • README describing the strict resolved-address checker

Python cleanup in 23520b4

The forward, signed cleanup commit removes new specification-text assertions
and synthetic policy-test code unless it has a concrete role in checking
real repository artifacts. It does not change this PR's normative proposal,
source models, samples, generated artifacts or production behavior.

Python path Disposition
tools/test_issue_625_kafka_bootstrap.py pruned: Removed re/SPEC_PATH and entire Markdown/prose example test; retained real sample/model/generator and parser checks.
endpoint/kafka_bootstrap.py retained unchanged: Real committed sample artifact validation only; stays with this E proposal, not B.

Script-only documentation and obsolete helper/test instructions were removed
or corrected with the affected code. Unmodified baseline Python is outside
the audit's scope; the cleanup is not evidence that a proposed policy is
already normative.

Current evidence and dependencies

  • python -B -m pytest tools\test_issue_625_kafka_bootstrap.py -q --tb=short -p no:cacheprovider -p pytest_asyncio.plugin: 43 passed in 2.06s.
  • python -B tools\verify.py endpoint; bash tools\spellcheck endpoint\README.md; git diff --check: passed.
  • direct parent, author-matching DCO, exact two-file scope, clean worktree: passed.

The selected xregistry/spec#723 (B) contributions are tracked separately. Their required prerequisite overlap intentionally remains in this original PR until the replacement is merged upstream. After that external merge, forward-merge, narrow the remaining diff and regenerate/rerun real artifact checks as applicable; do not remove necessary source prematurely.

The cleanup preserves the original draft state. No review thread is marked
resolved by this update, and no source branch is deleted. The historical
description below is preserved for context; its old test counts, helper
instructions and specification-text assertions are not current evidence.

Historical description at 9ac196c (before cleanup)
Fixes #625

## Changes

- Define Kafka client bootstrap entries as host:port strings, including
  bracketed IPv6, with security.protocol declared separately.
- Correct the two remaining Contoso SSL:// values and explicitly retain SSL.
  The field relocation already merged in #566 is unchanged.
- Preserve unresolved authoring strings, client-stage resolution and the
  Registry server exemption. Require explicit migration rather than stripping
  listener schemes or inferring security from a port.
- Add a small, network-free resolved-address checker and focused regressions.
  Helper links and scope explanations are confined to the adjacent README.

The source model already declares string-array bootstrap addresses and a
separate security.protocol member. No model or generated artifact changes are
needed. This branch is based directly on upstream
9ecf8ea67bc9a6128c154b4545a21164493cc71e and does not include unmerged generator
prerequisites or working-draft changes.

## Evidence

The first focused run failed the actual Contoso values in both generated
consumers and the missing canonical prose example. After the correction:

| Requirement | Evidence |
| --- | --- |
| Correct both residual values without losing SSL or repeating relocation | `test_contoso_kafka_samples_preserve_ssl_without_listener_urls` |
| Client host:port and bracketed IPv6 | `test_kafka_prose_example_uses_client_addresses_and_separate_security`, `test_resolved_host_port_and_bracketed_ipv6` |
| Listener URL negatives after substitution | `test_listener_urls_remain_invalid_after_out_of_band_resolution` |
| Preserve unresolved authoring and native string kinds | `test_authoring_placeholders_remain_strings_until_consumer_resolution`, `test_generated_schema_rejects_nonstring_addresses` |
| Empty, wrong-kind, malformed and port-boundary errors | `test_invalid_resolved_address_shapes_are_errors` |
| Keep existing model address/security fields separate | `test_kafka_source_model_keeps_address_and_security_separate` |

- Focused tests plus existing samples: **57 passed**.
- `python -B -m pytest tools -q --tb=short -p no:cacheprovider -p pytest_asyncio.plugin`:
  **111 passed**, four existing OpenAPI validator deprecation warnings.
- Real Markdown/title/translation functions and 34 local links across the two
  changed Markdown files: no issues. Git Bash spelling and tab checks passed
  on temporary copies of both Markdown files and the sample.
- Pinned native `xr model verify model.json`, run in the Endpoint directory:
  exit 0.

Primary sources: [Kafka client bootstrap configuration](https://kafka.apache.org/41/configuration/producer-configs/#producerconfigs_bootstrap.servers)
and [Kafka's bracketed IPv6 client-address examples](https://github.com/apache/kafka/blob/4.1.0/clients/src/test/java/org/apache/kafka/clients/ClientUtilsTest.java).
The checker tests passive declarations only. No broker, SDK serialization or
live interoperability is claimed; some Kafka implementations tolerate listener
URLs, which does not make them the canonical client declaration format.

Created as a draft because this issue changes five files.

```release-note
Kafka Endpoint bootstrap declarations now use client host:port entries, with
bracketed IPv6 and separate security configuration. The Contoso sample retains
SSL explicitly. Existing listener-style declarations need explicit migration.
```

Correct the residual listener-style sample values without changing the field relocation already merged in xregistry#566. Preserve SSL explicitly and distinguish unresolved authoring from client-stage address checks.

Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
@marcschier
marcschier marked this pull request as ready for review September 15, 2026 12:40
Signed-off-by: Marc Schier <marcschier@hotmail.com>
@marcschier

Copy link
Copy Markdown
Contributor Author

Applied signed, forward cleanup commit 23520b4. Removed Markdown/prose assertions while retaining the real Kafka sample/model/generator checks and artifact helper; the changed test module passed 43 cases.

The normative proposal, source models, samples and generated artifacts are unchanged by cleanup. This PR remains open for its e review; no policy decision or review-thread resolution is implied. Selected prerequisites are now tracked in xregistry/spec#723 (B); their necessary overlap remains here until those replacements land.

Updated the PR description with current evidence, explicit retained scope and the pre-cleanup description archived as historical context. Original draft state and source branch are preserved.

marcschier added a commit to marcschier/xregistry-drafts that referenced this pull request Sep 16, 2026
Port the cleaned net diff from xregistry#694 at 23520b4, relative to main 9ecf8ea.

Keep the pure helper with its real Contoso sample caller and generated-artifact tests. Preserve security separation, placeholder handling and explicit listener-URL migration. The two sample address/security corrections remain prerequisite overlap owned by xregistry#723 (B), pending upstream merge.

Signed-off-by: Marc Schier <marcschier@hotmail.com>
marcschier added a commit to marcschier/xregistry-drafts that referenced this pull request Sep 16, 2026
Address approved PY-COMP-01 from xregistry#694 and xregistry#724 compatibility. The enum-only selector returned None on both pinned C schema artifacts despite the standalone 43-case pass.

Use Draft7Validator on required protocol discriminators within positive schema combinators, require exactly one options branch, and reject missing or ambiguous selection explicitly. Preserve literal and case-insensitive pattern guards, unguarded and negated branch controls, order independence, the real generated options and Contoso sample, and all existing address/security negative cases.

Focused regressions were red (40 failed, 8 passed) before the repair. The exact targeted Kafka/history command now passes 92 cases; all 16 original options consumers also pass against the two real C artifacts without importing C implementation code or pinning a source hash in tests.

Signed-off-by: Marc Schier <marcschier@hotmail.com>
@marcschier

Copy link
Copy Markdown
Contributor Author

Superseded by the expanded Message, Endpoint and CloudEvents profiles keeper xregistry/spec#685. The reviewed net changes at 23520b4 were transferred with their issue and review provenance; specification-text/synthetic-policy Python stays removed.

Transfer and local integration evidence are in the keeper provenance comment. Immediately before closing, keeper head 2fec061 had successful verify and DCO gates.

Closing this original only as superseded: the policy decisions remain open in the keeper, no upstream merge or review-thread resolution is implied, and the source branch is preserved.

@marcschier marcschier closed this Sep 16, 2026
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.

Separate Kafka client bootstrap host-port values from listener URLs

1 participant