Skip to content

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

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

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

Conversation

@ozhelezniak-talend

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, so connectors such as cosmosDB have to be published as 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).

What does this PR adds (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 (cosmosdb, dataqualityrule, jsonvalidator, embeddingai, semanticmatch, neo4jimport). A missing file gives an empty map.
  • Only exact lowercase names are remapped, so old-named jars are unchanged.
  • Test: ContainerManagerTest#legacyPluginIdsAreRemapped. Only container-core tests were run (ContainerManagerTest, MvnDependencyListLocalRepositoryResolverTest).
  • Rollout: this runtime must ship before any connector is renamed, otherwise older runtimes derive cosmosdb and change all ids.
  • Open: stored pluginLocation GAV (becomes lowercase), dataprep dependencies.txt, other loaders (Studio-embedded, remote-engine-customizer) 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

Comment on lines +227 to +231
if (existing != null && !existing.equals(gav)) {
getLog()
.warn("Legacy plugin id '" + legacyId + "' of '" + name + "' is already registered for '"
+ existing + "', it is not overwritten");
return;

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 we are fine with it.
test: org.talend.sdk.component.maven.BuildComponentM2RepositoryMojoTest#collidingLegacyIdIsNotOverwritten

if in the classpath we have both: cosmos-db and cosmosDB -> no harm to use cosmosDB.
shouldn't be possible in our use-case

Comment on lines +701 to +703
final String m2 = System.getProperty(M2_REPOSITORY_PROPERTY);
if (m2 != null && !m2.isBlank()) {
final Path file = Paths.get(m2).resolve(M2_FILE_NAME);

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 we can take this risk.

it was done for previewrunner. Maybe we can have a better solution

@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 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 from bb8885a to 80cd05b Compare November 17, 2026 13:38
ozhelezniak-talend and others added 4 commits November 19, 2026 11:28
* 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>
@ozhelezniak-talend
ozhelezniak-talend force-pushed the ozhelezniak/QTDI-2410_legacy_plugin_ids branch from 80cd05b to 0559cd2 Compare November 19, 2026 11:28
@sonar-rnd

sonar-rnd Bot commented Nov 19, 2026

Copy link
Copy Markdown

Failed Quality Gate failed

  • 76.30% 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

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