Skip to content

dbeaver/pro#7128 Remove deprecated API#3820

Open
serge-rider wants to merge 29 commits into
develfrom
7128-remove-deprecated-api
Open

dbeaver/pro#7128 Remove deprecated API#3820
serge-rider wants to merge 29 commits into
develfrom
7128-remove-deprecated-api

Conversation

@serge-rider

Copy link
Copy Markdown
Member

No description provided.

Wroud
Wroud previously approved these changes Oct 13, 2025

@Wroud Wroud 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.

seems okay, need testing

@serge-rider serge-rider closed this May 3, 2026
@serge-rider serge-rider deleted the 7128-remove-deprecated-api branch May 3, 2026 19:50
@serge-rider serge-rider restored the 7128-remove-deprecated-api branch May 28, 2026 13:05
@serge-rider serge-rider reopened this May 28, 2026
@serge-rider serge-rider dismissed stale reviews from alexander-skoblikov and Wroud via 479baa7 May 28, 2026 13:08
@codacy-production

codacy-production Bot commented May 28, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 123 complexity · 0 duplication

Metric Results
Complexity 123
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment on lines +15 to +24
const node: NavNode = {
uri: '',
folder: true,
hasChildren: false,
inline: false,
navigable: false,
filtered: false,
objectFeatures: [],
nodeType: NAV_NODE_TYPE_FOLDER,
};

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.

this is a bad pattern to just update the object. so lets create a mock function which creates new object each time based on args we provide

Comment on lines +13 to 15
export function getFolderPath(node: NavNode): string {
return getFolderPathWithProjectId(node).split('/').slice(1).join('/');
}

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.

unit tests would be nice here


export function getFolderPathWithProjectId(folderId: string): string {
if (!isFolderNodeId(folderId)) {
export function getFolderPathWithProjectId(node: NavNode): string {

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.

here as well

Comment on lines +27 to 29
getPlainPath(nodeId: string): string {
return nodeId.startsWith(NODE_PATH_PREFIX) ? nodeId.slice(NODE_PATH_PREFIX.length) : nodeId;
},

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.

this one can be covered with unit tests as well

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.

Yes but lets do it a little bit later

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.

I think the value here is more than time to spent to generate these tests
if some bugs appear we will definitely know these parts are out of suspects

const parts = getPathParts(path);

return parts.map((_, i, array) => createPath(...array.slice(0, i))).filter(parent => parent !== path);
return parts.map((_, i, array) => createPath(...array.slice(0, i))).filter(parent => parent !== path && parent !== '');

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.

could you specify why this changed?

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.

createPath might return empty string, previously it was valid parent but now its not

const parents = data.nodePaths.map(nodeId => {
const parents = getFolderNodeParents(nodeId);

const parents = this.navNodeInfoResource.getParents(nodeId);

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.

am I understand it right?
now folders has no prefix "folder". it has prefix "node". and we got lost an ability to define wether its folder or not by uri path?
I see that we can define it by node type but if possible it would be nice to define it also by path its quite useful

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.

Yes, now folder is just a node in terms of path structure. node://{project}/datasource/{...folders}/{connection}/{...}

return nodeId.startsWith('folder://');
import { NAV_NODE_TYPE_FOLDER, type NavNode } from '@cloudbeaver/core-navigation-tree';

export function isFolderNodeId(node: NavNode): boolean {

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.

isFolderNode

}
return true;

return NodeManagerUtils.isDatabaseObject(node.uri);

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.

why this changed?

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.

To exclude extra nodes that are now returning with datasources

SychevAndrey
SychevAndrey previously approved these changes Jun 8, 2026
Comment on lines +15 to +37
const node: NavNode = {
uri: '',
folder: true,
hasChildren: false,
inline: false,
navigable: false,
filtered: false,
objectFeatures: [],
nodeType: NAV_NODE_TYPE_FOLDER,
};

test('should extract projectId and folderId from a valid nodeId', () => {
const id = 'node://u_cbadmin/datasources/QAtestRegress';
node.uri = id;
expect(getConnectionFolderIdFromNodeId(node)).toEqual({ projectId: 'u_cbadmin', folderId: 'QAtestRegress' });
});

test('should return undefined for non-folder ids', () => {
const id = 'ext://resources/g_GlobalConfiguration/Aleksandr';
expect(getConnectionFolderIdFromNodeId(id)).toEqual(undefined);
const id = 'node://u_cbadmin/datasources/QAtestRegress';

node.uri = id;
node.folder = false;
delete node.nodeType;

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.

instead of object mutation maybe it's better to use simple factory here and create needed node instance in each case? It will make test more isolated.

return nodeId.startsWith('folder://');
import { NAV_NODE_TYPE_FOLDER, type NavNode } from '@cloudbeaver/core-navigation-tree';

export function isFolderNodeId(node: NavNode): boolean {

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.

I would rename this fn to smth like isNodeAFolder

We do not operate with any node id anymore

Comment on lines 70 to 75
@Property
@Deprecated(forRemoval = true)
public String getId() {
return node.getNodeItemPath();
return node.getNodeUri();
}

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.

don't we need to delete it?

sergeyteleshev
sergeyteleshev previously approved these changes Jun 9, 2026
yagudin10
yagudin10 previously approved these changes Jun 9, 2026
SychevAndrey
SychevAndrey previously approved these changes Jun 9, 2026
sergeyteleshev
sergeyteleshev previously approved these changes Jun 9, 2026
@serge-rider serge-rider dismissed stale reviews from sergeyteleshev and SychevAndrey via 63ef6c3 June 9, 2026 15:14
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.

8 participants