Skip to content

feat(QTDI-2410): Map lowercase plugin names to legacy plugin ids - #1297

Open
ozhelezniak-talend wants to merge 3 commits into
masterfrom
ozhelezniak/QTDI-2410_legacy_plugin_ids
Open

ozhelezniak-talend wants to merge 3 commits into
masterfrom
ozhelezniak/QTDI-2410_legacy_plugin_ids

Conversation

@ozhelezniak-talend

@ozhelezniak-talend ozhelezniak-talend commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Requirements

  • Any code change adding any logic MUST be tested through a unit test executed with the default build
  • Any API addition MUST be done with a documentation update if relevant

Why this PR is needed?

GitHub Packages only accepts lowercase Maven artifactIds. The cosmosDB connector is published as cosmos-db, but its plugin id must stay cosmosDB. The plugin id is derived from the plugin name (jar filename or GAV artifactId), and family, component and config ids are Base64(plugin#...). Renaming would change every id and break existing jobs and pipelines (QTDI-2410).

Scope

  • Cloud only. This PR changes the component runtime used by the Cloud services. It does not change Studio behavior.
  • cosmosDB only. The only mapping is cosmos-db=cosmosDB.
  • Studio loads the cosmos-db artifact, but Studio handles the migration on its side and does not provide TALEND-INF/legacy-plugin-ids.properties. With no mapping file, the map is empty, so Studio ids do not change.

What does this PR add (design/code thoughts)?

  • ContainerManager.buildAutoIdFromName applies a lowercase name -> legacy plugin id mapping last, for both the GAV and the filename branch. All loaders go through it.
  • The mapping is in TALEND-INF/legacy-plugin-ids.properties. A missing file gives an empty map.
  • Only exact lowercase names are remapped, so old-named jars are unchanged.
  • The mapping file in this repository is a test resource. The production file ships with the cosmos connector.
  • Component server and Maven plugin: BuildComponentM2RepositoryMojo copies the legacy ids into the m2 registry, and the server deploys each GAV once.

Tests

  • ContainerManagerTest (12 tests), LegacyPluginIdsTest (3), MvnDependencyListLocalRepositoryResolverTest (4): all pass.
  • BuildComponentM2RepositoryMojoTest (5): all pass.

Rollout

This runtime must ship before the cosmos connector is renamed to cosmos-db. Older runtimes derive cosmos-db and would change all ids.

Open

  • Stored pluginLocation GAV (becomes lowercase): not checked.
  • Dataprep dependencies.txt: not checked.
  • No docs yet.

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

Copilot AI left a comment

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.

🟡 Changes recommended

The forced-ID Maven plugin path does not yet apply the legacy mapping, and mapping coverage is incomplete.

1 open issue
What changed in this PR

This pull request preserves legacy plugin IDs when connector artifact names are renamed to lowercase for Maven publication.

Changes:

  • Adds a properties-based mapping from lowercase artifact names to historical plugin IDs.
  • Applies mappings to IDs derived from Maven coordinates and JAR filenames.
  • Adds unit coverage for representative remapped and unchanged plugin names.
File Description
container/​container-core/​src/​test/​java/​org/​talend/​sdk/​component/​ContainerManagerTest.java Tests filename and GAV-based legacy ID remapping and unchanged plugin behavior.
container/​container-core/​src/​main/​resources/​TALEND-INF/​legacy-plugin-ids.properties Defines lowercase artifact-to-legacy-ID compatibility mappings.
container/​container-core/​src/​main/​java/​org/​talend/​sdk/​component/​container/​ContainerManager.java Loads and applies legacy mappings during automatic plugin ID derivation.

Review effort: Lite

Copilot AI left a comment

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.

🔵 Needs a closer look

Address dynamic-dependency lookups and explicit forced-ID loading so renamed connectors consistently retain legacy IDs.

No open issues 🎉

1 resolved since last review

Review effort: Lite

Copilot AI left a comment

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.

🔵 Needs a closer look

Persisted-ID compatibility and the acknowledged unverified loader paths require human validation before connector renaming proceeds.

No open issues 🎉

Review effort: Balanced

@ozhelezniak-talend

Copy link
Copy Markdown
Contributor Author

For the cloud, the same mapping is provided by Talend/connectors#74: cloud-components-extensions ships TALEND-INF/legacy-plugin-ids.properties (same six entries). ServerSetup copies that jar to /opt/talend/custom, so it is on the component server classpath that ContainerManager reads. This relies on the loader staying a classpath resource lookup; the connectors release must be deployed with or after a runtime containing this PR.

Copilot AI left a comment

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.

🟡 Changes recommended

The legacy-ID mapping exists only in test resources, so published runtimes silently skip remapping, and several exact-match keys do not match the documented connector names.

2 open issues

Review effort: Balanced

@ozhelezniak-talend
ozhelezniak-talend force-pushed the ozhelezniak/QTDI-2410_legacy_plugin_ids branch from 3d95b7f to 2399eca Compare November 2, 2026 13:18
@ozhelezniak-talend
ozhelezniak-talend marked this pull request as ready for review November 3, 2026 14:01
@ozhelezniak-talend
ozhelezniak-talend requested a balanced review from Copilot November 3, 2026 14:01

Copilot AI left a comment

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.

🟡 Changes recommended

The legacy-ID mapping is missing from the production JAR, and its keys omit the advertised lowercase artifact IDs, so renamed connectors still receive incompatible plugin IDs.

2 open issues
1 resolved since last review

Review effort: Balanced

undx
undx previously approved these changes Nov 3, 2026

@undx undx left a comment

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.

lgtm

Copilot AI left a comment

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.

🟡 Changes recommended

Registry merging can retain conflicting entries that cause duplicate-container failures, while mappings in constructor- or server-configured repository roots are ignored, changing renamed connector IDs.

2 open issues
2 resolved since last review

Review effort: Balanced

@ozhelezniak-talend
ozhelezniak-talend force-pushed the ozhelezniak/QTDI-2410_legacy_plugin_ids branch from 95fdd47 to bb8885a Compare November 9, 2026 14:39
undx
undx previously approved these changes Nov 10, 2026

@undx undx left a comment

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.

lgtm

@ozhelezniak-talend
ozhelezniak-talend force-pushed the ozhelezniak/QTDI-2410_legacy_plugin_ids branch 2 times, most recently from 80cd05b to 0559cd2 Compare November 19, 2026 11:28
ozhelezniak-talend and others added 2 commits December 2, 2026 12:41
* from the m2 root
* from the classloader

* Legacy plugin ids add a second registry key for the same GAV, so the
server deployed it twice and failed with 'Container already exists'.

* GitHub Packages requires lowercase artifactIds, but plugin, family and
component ids derive from the plugin name. Remap known lowercase names
(cosmosdb -> cosmosDB, ...) in ContainerManager.buildAutoIdFromName so
ids stay unchanged after a connector is renamed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Warn without overwriting on legacy id collision, document static
loading constraint, extract distinctGavs and add tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Only cosmos-db needs the lowercase to legacy id migration. Remove the
other five entries from the mapping and their test assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonar-rnd

sonar-rnd Bot commented Dec 3, 2026

Copy link
Copy Markdown

Failed Quality Gate failed

  • 75.20% Coverage on New Code (is less than 80.00%)
  • 1 New Issues (is greater than 0)

Project ID: org.talend.sdk.component:component-runtime

View in SonarQube

Copilot AI left a comment

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.

🟡 Changes recommended

The cached mapping remains empty when a renamed connector bundle is reloaded without restarting the JVM, causing cosmos-db to receive a new plugin ID and breaking existing IDs.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment on lines +692 to +693
private static final Map<String, String> VALUES =
loadLegacyPluginIds(ContainerManager.class.getClassLoader());

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.

I think it's expected that we load it only once. That's was the idea.
I'm not sure that we have the functionality of reloading of the connectors.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants