Skip to content

Conversation

@3nol
Copy link
Contributor

@3nol 3nol commented Dec 22, 2025

No description provided.

@3nol 3nol requested a review from a team as a code owner December 22, 2025 09:59
Copilot AI review requested due to automatic review settings December 22, 2025 09:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces deprecated HubItemVersion API usage with the newer ItemVersion API across component manipulation code. The changes modernize the version handling mechanism for Hub components by using the new URL-based version parsing and application methods.

Key Changes:

  • Replaced HubItemVersion with ItemVersion and updated version parsing to use URLResolverUtil
  • Refactored URI construction to use URIBuilder with proper query parameter handling
  • Removed deprecated update command logic and simplified error handling

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ManipulateComponents.java Updated version parsing from HubItemVersion.of() to URLResolverUtil.parseVersion(), replaced direct URI manipulation with URIBuilder, removed deprecated getUpdateComponentCommand() method, and simplified exception handling
ComponentAPI.java Updated method call to reflect renamed openChangeComponentItemVersionDialog() method
Comments suppressed due to low confidence (1)

org.knime.ui.java/src/eclipse/org/knime/ui/java/api/ManipulateComponents.java:1

  • The error message is vague about why URI construction failed. Consider including information about the target version being applied or the specific query parameters that caused the issue to help users diagnose the problem.
/*

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +109 to +113
final var newSrcUriBuilder = new URIBuilder(srcUri);
final var newQueryParams = URLResolverUtil.applyTo(targetVersion, newSrcUriBuilder.getQueryParams());
newSrcUriBuilder.setParameters(newQueryParams);
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The query parameters are retrieved, modified, and set back in separate steps. Consider checking if URLResolverUtil.applyTo() could be simplified or if this pattern could be encapsulated in a helper method to reduce the cognitive load of understanding the URI modification flow.

Copilot uses AI. Check for mistakes.
@xnhp
Copy link
Contributor

xnhp commented Dec 22, 2025

Bit confused, I think there should be a corresponding knime-gateway PR? https://knime-com.atlassian.net/browse/NXT-2173?focusedCommentId=182143

@3nol 3nol force-pushed the todo/AP-25387-remove-deprecated-hubitemversion branch from 1be509b to 430be89 Compare December 22, 2025 10:47
@3nol
Copy link
Contributor Author

3nol commented Dec 22, 2025

@xnhp, you're correct. The commit for NXT-2173 just (incorrectly) came with PR while mirroring PRs from Bitbucket zu GitHub. It's fixed now, and a separate PR is needed.

…ersion

AP-25387 (Remove deprecated `HubItemVersion` and its `LinkType`)
Copilot AI review requested due to automatic review settings December 22, 2025 13:28
@3nol 3nol force-pushed the todo/AP-25387-remove-deprecated-hubitemversion branch from 430be89 to aa00375 Compare December 22, 2025 13:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


final var srcUri = component.getTemplateInformation().getSourceURI();
final var currentVersion = HubItemVersion.of(srcUri).orElse(HubItemVersion.currentState());
final var currentVersion = URLResolverUtil.parseVersion(srcUri.getQuery()).orElseGet(ItemVersion::currentState);
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The original code used orElse(HubItemVersion.currentState()) which evaluates the default eagerly, while the new code uses orElseGet(ItemVersion::currentState) which evaluates lazily. If ItemVersion.currentState() has side effects or is computationally expensive, this change in evaluation strategy could alter behavior. Consider whether this semantic change is intentional.

Copilot uses AI. Check for mistakes.
.build();
}

// (2) Perform component update to fetch its info.
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The comment references step '(2)' but there's no corresponding comment for step '(1)' visible in the unchanged code context. While step '(1)' appears at line 117, the numbering should be consistent throughout the method to avoid confusion.

Copilot uses AI. Check for mistakes.
@3nol
Copy link
Contributor Author

3nol commented Dec 22, 2025

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