Skip to content

Commit 88d6027

Browse files
committed
Merge branch 'release_25_2_1_sqle' of https://github.com/actiontech/cloudbeaver into fix/error-failed-maessage-filed-name
2 parents 26e2318 + 744fc3a commit 88d6027

17 files changed

Lines changed: 245 additions & 34 deletions

File tree

.github/workflows/push-pr-devel.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
build-server:
18-
uses: dbeaver/dbeaver-common/.github/workflows/mvn-package.yml@devel
19-
name: Check
20-
secrets: inherit
21-
with:
22-
mvn-args: -Dplain-api-server -Dheadless-platform
23-
project-directory: ./cloudbeaver/server/product/aggregate
24-
project-deps: ./cloudbeaver/project.deps
25-
timeout-minutes: 5
17+
# build-server:
18+
# uses: dbeaver/dbeaver-common/.github/workflows/mvn-package.yml@devel
19+
# name: Check
20+
# secrets: inherit
21+
# with:
22+
# mvn-args: -Dplain-api-server -Dheadless-platform
23+
# project-directory: ./cloudbeaver/server/product/aggregate
24+
# project-deps: ./cloudbeaver/project.deps
25+
# timeout-minutes: 5
2626

2727
# build-server:
2828
# name: Server
2929
# uses: ./.github/workflows/backend-build.yml
3030
# secrets: inherit
3131

32-
build-frontend:
33-
name: Frontend
34-
uses: ./.github/workflows/frontend-build.yml
35-
secrets: inherit
32+
# build-frontend:
33+
# name: Frontend
34+
# uses: ./.github/workflows/frontend-build.yml
35+
# secrets: inherit
3636

3737
lint-server:
3838
name: Server

server/bundles/io.cloudbeaver.resources.drivers.base/plugin.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<resource name="drivers/jaybird"/>
1515
<resource name="drivers/h2"/>
1616
<resource name="drivers/h2_v2"/>
17+
<resource name="drivers/hive2"/>
18+
<resource name="drivers/hive4"/>
1719
<resource name="drivers/sqlite/xerial"/>
1820
<resource name="drivers/mssql/new"/>
1921
<resource name="drivers/trino"/>
@@ -35,6 +37,8 @@
3537
<bundle id="drivers.firebird" label="Firebird drivers"/>
3638
<bundle id="drivers.h2" label="H2 drivers"/>
3739
<bundle id="drivers.h2_v2" label="H2 v2 drivers"/>
40+
<bundle id="drivers.hive2" label="Apache Hive 2 drivers"/>
41+
<bundle id="drivers.hive4" label="Apache Hive drivers"/>
3842
<bundle id="drivers.sqlite.xerial" label="SQLite drivers"/>
3943
<bundle id="drivers.mssql.new" label="SQL Server drivers"/>
4044
<bundle id="drivers.trino" label="Trino drivers"/>
@@ -58,6 +62,8 @@
5862
<driver id="sqlite:sqlite_jdbc"/>
5963
<driver id="sqlite:libsql_jdbc"/>
6064
<driver id="sqlserver:microsoft"/>
65+
<driver id="hive:apache_hive2"/>
66+
<driver id="hive:apache_hive4"/>
6167
<driver id="generic:trino_jdbc"/>
6268
<driver id="generic:duckdb_jdbc"/>
6369
<driver id="generic:kyuubi_hive"/>

server/bundles/io.cloudbeaver.service.admin/src/io/cloudbeaver/service/admin/impl/WebServiceAdmin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ public AdminUserInfo createUser(
163163
if (userName.isEmpty()) {
164164
throw new DBWebException("Empty user name");
165165
}
166-
String userId = userName.toLowerCase();
166+
// String userId = userName.toLowerCase();
167+
String userId = userName;
167168
try {
168169
GeneralUtils.validateResourceNameUnconditionally(userId);
169170
} catch (DBException e) {

server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected boolean isSubjectExists(String subjectId) throws DBCException {
123123
// Users
124124

125125
/**
126-
* Creates user. Saves user id in database in lower-case.
126+
* Creates user. Saves user id in database as provided.
127127
*/
128128
@Override
129129
public void createUser(
@@ -132,7 +132,6 @@ public void createUser(
132132
boolean enabled,
133133
@Nullable String defaultAuthRole
134134
) throws DBException {
135-
userId = userId.toLowerCase(); // creating new users only with lowercase
136135
validateAndCreateUser(userId, metaParameters, enabled, defaultAuthRole);
137136
}
138137

@@ -211,15 +210,13 @@ protected void importUsers(@NotNull Connection connection, @NotNull SMUserImport
211210
if (CommonUtils.isNotEmpty(metaParameters.get(SMStandardMeta.META_USER_ID))) {
212211
userId = metaParameters.get(SMStandardMeta.META_USER_ID);
213212
}
214-
for (String possibleUserId : List.of(userId, userId.toLowerCase())) {
215-
if (isSubjectExists(possibleUserId)) {
216-
log.info("User already exist : " + possibleUserId);
217-
setUserAuthRole(connection, possibleUserId, authRole);
218-
enableUser(connection, possibleUserId, true, null, null);
219-
continue outer;
220-
}
213+
if (isSubjectExists(userId)) {
214+
log.info("User already exist : " + userId);
215+
setUserAuthRole(connection, userId, authRole);
216+
enableUser(connection, userId, true, null, null);
217+
continue;
221218
}
222-
insertUser(connection, userId.toLowerCase(), metaParameters, true, authRole);
219+
insertUser(connection, userId, metaParameters, true, authRole);
223220
}
224221
}
225222

@@ -1291,7 +1288,6 @@ public SMTeam createTeam(
12911288
if (CommonUtils.isEmpty(teamId)) {
12921289
throw new DBCException("Empty team name is not allowed");
12931290
}
1294-
teamId = teamId.toLowerCase();
12951291
if (isSubjectExists(teamId)) {
12961292
throw new DBCException("User or team '" + teamId + "' already exists");
12971293
}

server/drivers/hive2/pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>drivers.hive2</artifactId>
5+
<version>1.0.0</version>
6+
<parent>
7+
<groupId>io.cloudbeaver</groupId>
8+
<artifactId>drivers</artifactId>
9+
<version>1.0.0</version>
10+
<relativePath>../</relativePath>
11+
</parent>
12+
13+
<properties>
14+
<deps.output.dir>hive2</deps.output.dir>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.apache.hive</groupId>
20+
<artifactId>hive-jdbc</artifactId>
21+
<version>2.3.9</version>
22+
<exclusions>
23+
<exclusion>
24+
<groupId>jdk.tools</groupId>
25+
<artifactId>jdk.tools</artifactId>
26+
</exclusion>
27+
<exclusion>
28+
<groupId>org.slf4j</groupId>
29+
<artifactId>slf4j-log4j12</artifactId>
30+
</exclusion>
31+
</exclusions>
32+
</dependency>
33+
</dependencies>
34+
35+
</project>
36+

server/drivers/hive4/pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>drivers.hive</artifactId>
5+
<version>1.0.0</version>
6+
<parent>
7+
<groupId>io.cloudbeaver</groupId>
8+
<artifactId>drivers</artifactId>
9+
<version>1.0.0</version>
10+
<relativePath>../</relativePath>
11+
</parent>
12+
13+
<properties>
14+
<deps.output.dir>hive</deps.output.dir>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.apache.hive</groupId>
20+
<artifactId>hive-jdbc</artifactId>
21+
<version>4.0.1</version>
22+
<classifier>standalone</classifier>
23+
<exclusions>
24+
<exclusion>
25+
<groupId>jdk.tools</groupId>
26+
<artifactId>jdk.tools</artifactId>
27+
</exclusion>
28+
</exclusions>
29+
</dependency>
30+
</dependencies>
31+
32+
</project>
33+

server/drivers/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<module>duckdb</module>
2424
<module>h2</module>
2525
<module>h2_v2</module>
26+
<module>hive2</module>
27+
<module>hive4</module>
2628
<module>jaybird</module>
2729
<module>kyuubi</module>
2830
<module>mysql</module>

webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@
5555
"vitest": "^3"
5656
},
5757
"packageManager": "yarn@4.9.2"
58-
}
58+
}

webapp/packages/core-blocks/src/layout/AppLogo.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ interface Props {
1919
export const AppLogo: React.FC<Props> = function AppLogo({ title, onClick, iconSrc = '/icons/logo_sm.svg' }) {
2020
const style = useS(styles);
2121
return (
22-
<div tabIndex={0} className={s(style, { container: true, active: onClick !== undefined })} onClick={onClick}>
22+
<div
23+
tabIndex={0}
24+
className={s(style, { container: true, active: onClick !== undefined })}
25+
onClick={() => {
26+
window.location.href = `${location.origin}?from=odc`;
27+
}}
28+
>
2329
<IconOrImage title={title} className={s(style, { logo: true })} icon={iconSrc} />
2430
</div>
2531
);

webapp/packages/core-blocks/src/useErrorDetails.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ interface IErrorDetailsHook {
2626
open: () => void;
2727
refresh?: () => void;
2828
errorCode?: string;
29+
workflowId?: string;
2930
}
3031

3132
type HookType =
@@ -54,9 +55,19 @@ export function useErrorDetails(error: IErrorDetailsHook['error']): HookType {
5455
}
5556
};
5657
const name = typeof error === 'string' ? translate('core_blocks_exception_message_error_message') : error?.name;
57-
const message = typeof error === 'string' ? error : error?.message;
58+
let message = (typeof error === 'string' ? error : error?.message) ?? undefined;
5859
const executionFailedMessage = (error as any)?.executionFailedMessage as string;
5960
const errorCode = (error as any)?.errorCode as string;
61+
let workflowId: string | undefined;
62+
63+
if (typeof message === 'string') {
64+
const match = message.match(/workflow_id:(\d+)/);
65+
66+
if (match) {
67+
workflowId = match[1];
68+
message = message.replace(/workflow_id:\d+,?\s*/g, '').trim();
69+
}
70+
}
6071

6172
return {
6273
name,
@@ -69,5 +80,6 @@ export function useErrorDetails(error: IErrorDetailsHook['error']): HookType {
6980
refresh: loadingError?.refresh,
7081
executionFailedMessage,
7182
errorCode,
83+
workflowId,
7284
};
7385
}

0 commit comments

Comments
 (0)