Skip to content

Let a .v* extension config key apply to any extension version - #10

Open
vvoland wants to merge 2 commits into
moby:mainfrom
vvoland:wildcard-config
Open

vvoland wants to merge 2 commits into
moby:mainfrom
vvoland:wildcard-config

Conversation

@vvoland

@vvoland vvoland commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Config was looked up only by the exact extension id, so config for org.example.foo.v1 did not apply to org.example.foo.v2.

A config key can now leave out the version, like org.example.foo, to apply to all versions.
A key with the full id still wins.

Only the last version is dropped, so org.example.foo does not match org.example.foo.runtime.v1.

Comment thread docs/AUTHORING.md Outdated
@vvoland
vvoland requested review from thaJeztah and a balanced review from Copilot October 23, 2026 11:20

Copilot AI 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.

🟢 Approval recommended

The focused change preserves exact-ID precedence, consistently updates both delivery paths, and has no unresolved review findings.

No open issues 🎉

What changed in this PR

Adds version-wide extension configuration through .v* keys while preserving exact-ID precedence. Both in-process and executable extensions use the shared lookup behavior.

Changes:

  • Adds configuration-key validation and exact-first lookup with .v* fallback.
  • Integrates lookup into broker initialization and launcher startup.
  • Documents wildcard configuration and tests validation, precedence, and matching.
File Description
internal/​launcher/​launcher.go Uses shared configuration lookup for the startup handshake.
internal/​broker/​broker.go Uses shared configuration lookup during extension initialization.
host/​host.go Documents wildcard keys and exact-ID precedence.
docs/​DESIGN.md Explains configuration sharing across extension versions.
docs/​AUTHORING.md Adds wildcard examples and configuration guidance.
core.go Adds key validation and version-aware configuration lookup.
core_test.go Tests key validation and configuration selection.

Review effort: Balanced

An id like org.example.v1.v2 was valid, with org.example.v1 as its
name.
That name is also a valid extension id, so the two can't be told
apart.

ValidateExtensionID now rejects ids whose name ends in a version.
Ids are checked segment by segment instead of with a regular
expression.

Signed-off-by: Paweł Gronowski <git@grono.dev>
Config was looked up only by the exact extension id, so config for
org.example.foo.v1 did not apply to org.example.foo.v2.

A config key can now leave out the version, like org.example.foo, to
apply to all versions.
A key with the full id still wins.

Only the last version is dropped, so org.example.foo does not match
org.example.foo.runtime.v1.

Signed-off-by: Paweł Gronowski <git@grono.dev>
Comment thread docs/AUTHORING.md
Comment on lines +436 to +439
A key without the version, such as `com.example.other`, applies to every version of that extension.
It matches only that name: `com.example.other` does not reach `com.example.other.runtime.v1`.
A key with the full id, such as `com.example.other.v2`, takes precedence over it.
Because each version is a separate extension, a versionless entry must suit the configuration format of every version it reaches.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, having (e.g.) both com.example.other.runtime.v1 and com.example.other.runtime makes one config apply to v1, and the other for com.example.other.runtime.v0, com.example.other.runtime.v2, com.example.other.runtime.v3 (any other version), right?

Probably works, yes; alternative could be to not allow a mix of versioned and non-versioned for the same match. (Not sure if that's better/clearer though).

Mostly thinking there if there's situations where I would have multiple versions of the same extension installed (could we come up with reasons for that? do we / do we want to allow that?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think there's a reason to allow multiple versions of the same extension running at the same time.

For mixing.. I'm thinking if it would make sense to merge them - so the "versionless" kinda acts as a base, and then the per version can adjust it. But I don't think we should do it now.

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.

3 participants