This is an automated email from the ASF dual-hosted git repository.
voidmatcha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push:
new 3bf5acd3d8 [ZEPPELIN-6312] Remove configuration WS usage in frontend
3bf5acd3d8 is described below
commit 3bf5acd3d88d2f0d53d769670f27f3952ddf59a7
Author: SeungYoung Oh <[email protected]>
AuthorDate: Tue Sep 1 19:02:32 2026 +0900
[ZEPPELIN-6312] Remove configuration WS usage in frontend
### What is this PR for?
Currently, configuration data is fetched through both REST API and
WebSocket channels.
Besides the duplicated API paths, the WebSocket-based configuration path
did not have authorization checks.
#5099 separated the client-facing configuration REST API with
authorization in mind and applied it to the frontend:
- `/api/configurations/all` for the configuration page
- `/api/configurations/client` for client-side limits such as
`wsMaxMessageSize`
With those REST APIs in place, this PR removes the remaining unnecessary
frontend code for the configuration WebSocket flow.
### What type of PR is it?
Improvement
### Todos
* [ ] - [ZEPPELIN-6313] Drop configuration WS endpoint in backend
### What is the Jira issue?
[ZEPPELIN-6312]
### How should this be tested?
- Open `/#/configuration` and verify it loads configurations via `GET
/api/configurations/all`
- Import/export a note and verify it fetches `GET
/api/configurations/client`
- Confirm WebSocket frames no longer include `LIST_CONFIGURATIONS`
### Screenshots (if appropriate)
### Questions:
* Does the license files need to update? N
* Is there breaking changes for older versions? N
* Does this needs documentation? N
Closes #5444 from seung-00/ZEPPELIN-6312.
Signed-off-by: YONGJAE LEE <[email protected]>
---
.../src/interfaces/message-common.interface.ts | 90 ----------------------
.../interfaces/message-data-type-map.interface.ts | 4 +-
.../src/interfaces/message-operator.interface.ts | 5 +-
.../projects/zeppelin-sdk/src/message.ts | 4 -
.../notebook/action-bar/action-bar.component.ts | 7 --
.../src/app/services/message.service.ts | 4 -
.../src/app/services/ticket.service.ts | 6 --
.../src/app/share/header/header.component.ts | 12 +--
.../app/share/note-import/note-import.component.ts | 3 +-
.../src/app/notebook/notebook.controller.js | 2 +-
.../src/app/notebook/notebook.controller.test.js | 1 -
.../src/components/navbar/navbar.controller.js | 5 --
.../websocket/websocket-event.factory.js | 2 -
.../websocket/websocket-message.service.js | 4 -
14 files changed, 6 insertions(+), 143 deletions(-)
diff --git
a/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-common.interface.ts
b/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-common.interface.ts
index d13c3e8c49..565eeef6e6 100644
---
a/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-common.interface.ts
+++
b/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-common.interface.ts
@@ -26,96 +26,6 @@ export interface ClientConfigurations {
wsMaxMessageSize: number;
}
-export interface ConfigurationsInfo {
- configurations: {
- 'zeppelin.war.tempdir': string;
- 'zeppelin.notebook.azure.user': string;
- 'zeppelin.helium.npm.installer.url': string;
- 'zeppelin.notebook.git.remote.username': string;
- 'zeppelin.interpreter.remoterunner': string;
- 'zeppelin.notebook.s3.user': string;
- 'zeppelin.server.port': string;
- 'zeppelin.plugins.dir': string;
- 'zeppelin.notebook.new_format.delete_old': string;
- 'zeppelin.ssl.truststore.type': string;
- 'zeppelin.ssl.keystore.path': string;
- 'zeppelin.notebook.s3.bucket': string;
- 'zeppelin.notebook.git.remote.access-token': string;
- 'zeppelin.recovery.dir': string;
- 'zeppelin.notebook.s3.timeout': string;
- 'zeppelin.notebook.cron.enable': string;
- 'zeppelin.server.addr': string;
- 'zeppelin.username.force.lowercase': string;
- 'zeppelin.ssl.keystore.type': string;
- 'zeppelin.ssl.truststore.path': string;
- 'zeppelin.notebook.dir': string;
- 'zeppelin.interpreter.lifecyclemanager.class': string;
- 'zeppelin.notebook.gcs.dir': string;
- 'zeppelin.notebook.s3.sse': string;
- 'zeppelin.websocket.max.text.message.size': string;
- 'zeppelin.notebook.git.remote.origin': string;
- 'zeppelin.server.authorization.header.clear': string;
- 'zeppelin.interpreter.dep.mvnRepo': string;
- 'zeppelin.ssl': string;
- 'zeppelin.notebook.autoInterpreterBinding': string;
- 'zeppelin.config.storage.class': string;
- 'zeppelin.helium.node.installer.url': string;
- 'zeppelin.notebook.storage': string;
- 'zeppelin.notebook.new_format.convert': string;
- 'zeppelin.interpreter.dir': string;
- 'zeppelin.anonymous.allowed': string;
- 'zeppelin.credentials.persist': string;
- 'zeppelin.notebook.mongo.uri': string;
- 'zeppelin.config.fs.dir': string;
- 'zeppelin.server.allowed.origins': string;
- 'zeppelin.notebook.mongo.database': string;
- 'zeppelin.encoding': string;
- 'zeppelin.server.jetty.request.header.size': string;
- 'zeppelin.search.temp.path': string;
- 'zeppelin.notebook.s3.endpoint': string;
- 'zeppelin.notebook.homescreen.hide': string;
- 'zeppelin.scheduler.threadpool.size': string;
- 'zeppelin.notebook.azure.share': string;
- 'zeppelin.helium.yarnpkg.installer.url': string;
- 'zeppelin.server.strict.transport': string;
- 'zeppelin.interpreter.setting': string;
- 'zeppelin.server.xxss.protection': string;
- 'zeppelin.server.rpc.portRange': string;
- 'zeppelin.war': string;
- 'zeppelin.interpreter.output.limit': string;
- 'zeppelin.dep.localrepo': string;
- 'zeppelin.interpreter.max.poolsize': string;
- 'zeppelin.server.ssl.port': string;
- 'zeppelin.notebook.mongo.collection': string;
- 'zeppelin.notebook.public': string;
- 'zeppelin.helium.registry': string;
- 'zeppelin.server.kerberos.principal': string;
- 'zeppelin.server.default.dir.allowed': string;
- 'zeppelin.ssl.client.auth': string;
- 'zeppelin.server.context.path': string;
- 'zeppelin.recovery.storage.class': string;
- 'zeppelin.notebook.default.owner.username': string;
- 'zeppelin.home': string;
- 'zeppelin.interpreter.lifecyclemanager.timeout.threshold': string;
- 'zeppelin.notebook.git.remote.url': string;
- 'zeppelin.notebook.mongo.autoimport': string;
- 'zeppelin.notebook.one.way.sync': string;
- 'zeppelin.notebook.homescreen': string;
- 'zeppelin.interpreter.connect.timeout': string;
- 'zeppelin.server.xframe.options': string;
- 'zeppelin.interpreter.lifecyclemanager.timeout.checkinterval': string;
- 'zeppelin.server.kerberos.keytab': string;
- 'zeppelin.interpreter.rpc.portRange': string;
- 'zeppelin.interpreter.group.default': string;
- 'zeppelin.conf.dir': string;
- 'zeppelin.interpreter.localRepo': string;
- 'zeppelin.notebook.collaborative.mode.enable': string;
- 'zeppelin.search.use.disk': string;
- 'zeppelin.notebook.s3.cannedAcl': string;
- 'zeppelin.notebook.s3.pathStyleAccess': string;
- };
-}
-
export interface ErrorInfo {
info?: string;
}
diff --git
a/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-data-type-map.interface.ts
b/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-data-type-map.interface.ts
index f05583afb3..f86dbdb2b1 100644
---
a/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-data-type-map.interface.ts
+++
b/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-data-type-map.interface.ts
@@ -10,7 +10,7 @@
* limitations under the License.
*/
-import { AuthInfo, ConfigurationsInfo, ErrorInfo } from
'./message-common.interface';
+import { AuthInfo, ErrorInfo } from './message-common.interface';
import {
CheckpointNote,
CloneNote,
@@ -91,7 +91,6 @@ export type MessageDataTypeMap = MessageSendDataTypeMap |
MessageReceiveDataType
export interface MessageReceiveDataTypeMap {
[OP.COMPLETION_LIST]: CompletionReceived;
[OP.NOTES_INFO]: NotesInfo;
- [OP.CONFIGURATIONS_INFO]: ConfigurationsInfo;
[OP.NOTE]: Note;
[OP.NOTE_REVISION]: NoteRevision;
[OP.ERROR_INFO]: ErrorInfo;
@@ -125,7 +124,6 @@ export interface MessageReceiveDataTypeMap {
export interface MessageSendDataTypeMap {
[OP.PING]: undefined;
- [OP.LIST_CONFIGURATIONS]: undefined;
[OP.LIST_NOTES]: undefined;
[OP.GET_HOME_NOTE]: undefined;
[OP.RESTORE_ALL]: undefined;
diff --git
a/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-operator.interface.ts
b/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-operator.interface.ts
index a43549fa71..3a98074219 100644
---
a/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-operator.interface.ts
+++
b/zeppelin-web-angular/projects/zeppelin-sdk/src/interfaces/message-operator.interface.ts
@@ -282,14 +282,13 @@ export enum OP {
/**
* [c-s]
- * ask all key/value pairs of configurations
+ * @deprecated Retained for backend wire contract compatibility. Use
ConfigurationService REST APIs instead.
*/
LIST_CONFIGURATIONS = 'LIST_CONFIGURATIONS',
/**
* [s-c]
- * all key/value pairs of configurations
- * @param settings serialized Map<String = 'String', String> object
+ * @deprecated Retained for backend wire contract compatibility. Use
ConfigurationService REST APIs instead.
*/
CONFIGURATIONS_INFO = 'CONFIGURATIONS_INFO',
diff --git a/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts
b/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts
index 110af36f27..0f070c6354 100644
--- a/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts
+++ b/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts
@@ -535,10 +535,6 @@ export class Message {
});
}
- listConfigurations(): void {
- this.send<OP.LIST_CONFIGURATIONS>(OP.LIST_CONFIGURATIONS);
- }
-
getInterpreterSettings(): void {
this.send<OP.GET_INTERPRETER_SETTINGS>(OP.GET_INTERPRETER_SETTINGS);
}
diff --git
a/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts
b/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts
index a0b92d2c72..16c0ecc3b0 100644
---
a/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts
+++
b/zeppelin-web-angular/src/app/pages/workspace/notebook/action-bar/action-bar.component.ts
@@ -203,10 +203,6 @@ export class NotebookActionBarComponent extends
MessageListenersManager implemen
}
async exportNote() {
- if (!this.ticketService.configuration) {
- throw new Error('Configuration is not loaded');
- }
-
const sizeLimit = await this.configurationService.fetchWsMaxMessageSize();
const jsonContent = JSON.stringify(this.note);
if (jsonContent.length > sizeLimit) {
@@ -355,9 +351,6 @@ export class NotebookActionBarComponent extends
MessageListenersManager implemen
) {
super(messageService);
this.updateIsNoteParagraphRunning();
- if (!this.ticketService.configuration) {
- throw new Error('Configuration is not loaded');
- }
}
ngOnInit(): void {
diff --git a/zeppelin-web-angular/src/app/services/message.service.ts
b/zeppelin-web-angular/src/app/services/message.service.ts
index 1c61fb052b..050d78c44c 100644
--- a/zeppelin-web-angular/src/app/services/message.service.ts
+++ b/zeppelin-web-angular/src/app/services/message.service.ts
@@ -356,10 +356,6 @@ export class MessageService extends Message implements
OnDestroy {
super.saveInterpreterBindings(noteId, selectedSettingIds);
}
- listConfigurations(): void {
- super.listConfigurations();
- }
-
getInterpreterSettings(): void {
super.getInterpreterSettings();
}
diff --git a/zeppelin-web-angular/src/app/services/ticket.service.ts
b/zeppelin-web-angular/src/app/services/ticket.service.ts
index 868b36c225..7d6d948809 100644
--- a/zeppelin-web-angular/src/app/services/ticket.service.ts
+++ b/zeppelin-web-angular/src/app/services/ticket.service.ts
@@ -19,7 +19,6 @@ import { map, tap } from 'rxjs/operators';
import { NzMessageService } from 'ng-zorro-antd/message';
import { ITicket, ITicketWrapped, IZeppelinVersion } from
'@zeppelin/interfaces';
-import { ConfigurationsInfo } from '@zeppelin/sdk';
import { BaseUrlService } from './base-url.service';
@@ -27,17 +26,12 @@ import { BaseUrlService } from './base-url.service';
providedIn: 'root'
})
export class TicketService {
- configuration?: ConfigurationsInfo['configurations'];
ticket = new ITicketWrapped();
originTicket = new ITicket();
ticket$ = new Subject<ITicketWrapped>();
logout$ = new BehaviorSubject<boolean>(false);
version?: string;
- setConfiguration(conf: ConfigurationsInfo) {
- this.configuration = conf.configurations;
- }
-
getTicket() {
return forkJoin([
this.httpClient.get<ITicket>(`${this.baseUrlService.getRestApiBase()}/security/ticket`),
diff --git a/zeppelin-web-angular/src/app/share/header/header.component.ts
b/zeppelin-web-angular/src/app/share/header/header.component.ts
index 46884fdb04..ea1fddcd1e 100644
--- a/zeppelin-web-angular/src/app/share/header/header.component.ts
+++ b/zeppelin-web-angular/src/app/share/header/header.component.ts
@@ -17,8 +17,6 @@ import { NzModalService } from 'ng-zorro-antd/modal';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
-import { MessageListener, MessageListenersManager } from '@zeppelin/core';
-import { MessageReceiveDataTypeMap, OP } from '@zeppelin/sdk';
import { MessageService, NotebookService, TicketService } from
'@zeppelin/services';
import { AboutZeppelinComponent } from
'../about-zeppelin/about-zeppelin.component';
@@ -29,7 +27,7 @@ import { AboutZeppelinComponent } from
'../about-zeppelin/about-zeppelin.compone
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false
})
-export class HeaderComponent extends MessageListenersManager implements
OnInit, OnDestroy {
+export class HeaderComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
connectStatus = 'error';
noteListVisible = false;
@@ -72,11 +70,6 @@ export class HeaderComponent extends MessageListenersManager
implements OnInit,
localStorage.setItem(HeaderComponent.HISTORY_KEY,
JSON.stringify(this.searchHistory));
}
- @MessageListener(OP.CONFIGURATIONS_INFO)
- getConfiguration(data: MessageReceiveDataTypeMap[OP.CONFIGURATIONS_INFO]) {
- this.ticketService.setConfiguration(data);
- }
-
constructor(
public ticketService: TicketService,
public messageService: MessageService,
@@ -85,7 +78,6 @@ export class HeaderComponent extends MessageListenersManager
implements OnInit,
private notebookService: NotebookService,
private cdr: ChangeDetectorRef
) {
- super(messageService);
this.classicUiHref = this.resolveClassicUiHref();
}
@@ -95,7 +87,6 @@ export class HeaderComponent extends MessageListenersManager
implements OnInit,
} catch {
this.searchHistory = [];
}
- this.messageService.listConfigurations();
this.messageService.connectedStatus$.pipe(takeUntil(this.destroy$)).subscribe(status
=> {
this.connectStatus = status ? 'success' : 'error';
this.cdr.markForCheck();
@@ -119,7 +110,6 @@ export class HeaderComponent extends
MessageListenersManager implements OnInit,
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
- super.ngOnDestroy();
}
private resolveClassicUiHref() {
diff --git
a/zeppelin-web-angular/src/app/share/note-import/note-import.component.ts
b/zeppelin-web-angular/src/app/share/note-import/note-import.component.ts
index ef5fdb7f40..1471630718 100644
--- a/zeppelin-web-angular/src/app/share/note-import/note-import.component.ts
+++ b/zeppelin-web-angular/src/app/share/note-import/note-import.component.ts
@@ -12,7 +12,7 @@
import { HttpBackend, HttpClient } from '@angular/common/http';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from
'@angular/core';
-import { ConfigurationService, MessageService, TicketService } from
'@zeppelin/services';
+import { ConfigurationService, MessageService } from '@zeppelin/services';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { NzUploadFile } from 'ng-zorro-antd/upload';
@@ -103,7 +103,6 @@ export class NoteImportComponent extends
MessageListenersManager implements OnIn
constructor(
public messageService: MessageService,
- private ticketService: TicketService,
private configurationService: ConfigurationService,
private cdr: ChangeDetectorRef,
private nzModalRef: NzModalRef,
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js
b/zeppelin-web/src/app/notebook/notebook.controller.js
index 2a987f8a67..3abe8dfe7e 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -269,7 +269,7 @@ function NotebookCtrl($scope, $route, $routeParams,
$location, $rootScope,
$scope.exportNote = function() {
$http.get(baseUrlSrv.getRestApiBase() +
'/configurations/client').then(function(response) {
- const limit = response.data.body.wsMessageMaxSize;
+ const limit = response.data.body.wsMaxMessageSize;
let jsonContent = JSON.stringify($scope.note, null, 2);
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.test.js
b/zeppelin-web/src/app/notebook/notebook.controller.test.js
index e3769daaa9..6de12ab813 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.test.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.test.js
@@ -9,7 +9,6 @@ describe('Controller: NotebookCtrl', function() {
getInterpreterBindings: function() {},
updateNote: function() {},
renameNote: function() {},
- listConfigurations: function() {},
};
let baseUrlSrvMock = {
diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js
b/zeppelin-web/src/components/navbar/navbar.controller.js
index b35c60eac9..4cbf3ad9fc 100644
--- a/zeppelin-web/src/components/navbar/navbar.controller.js
+++ b/zeppelin-web/src/components/navbar/navbar.controller.js
@@ -85,10 +85,6 @@ function NavCtrl($scope, $rootScope, $http, $routeParams,
$location,
return ($routeParams.noteId === noteId);
}
- function listConfigurations() {
- websocketMsgSrv.listConfigurations();
- }
-
function loadNotes() {
websocketMsgSrv.getNoteList();
}
@@ -226,7 +222,6 @@ function NavCtrl($scope, $rootScope, $http, $routeParams,
$location,
$scope.$on('loginSuccess', function(event, param) {
$rootScope.ticket.screenUsername = $rootScope.ticket.principal;
- listConfigurations();
loadNotes();
getHomeNote();
});
diff --git a/zeppelin-web/src/components/websocket/websocket-event.factory.js
b/zeppelin-web/src/components/websocket/websocket-event.factory.js
index 18b2affb26..befd5b45bd 100644
--- a/zeppelin-web/src/components/websocket/websocket-event.factory.js
+++ b/zeppelin-web/src/components/websocket/websocket-event.factory.js
@@ -187,8 +187,6 @@ function WebsocketEventFactory($rootScope, $websocket,
$location, baseUrlSrv, sa
});
} else if (op === 'SESSION_LOGOUT') {
$rootScope.$broadcast('session_logout', data);
- } else if (op === 'CONFIGURATIONS_INFO') {
- $rootScope.$broadcast('configurationsInfo', data);
} else if (op === 'INTERPRETER_SETTINGS') {
$rootScope.$broadcast('interpreterSettings', data);
} else if (op === 'PARAGRAPH_ADDED') {
diff --git a/zeppelin-web/src/components/websocket/websocket-message.service.js
b/zeppelin-web/src/components/websocket/websocket-message.service.js
index 49b16aad45..786553b630 100644
--- a/zeppelin-web/src/components/websocket/websocket-message.service.js
+++ b/zeppelin-web/src/components/websocket/websocket-message.service.js
@@ -387,10 +387,6 @@ function WebsocketMessageService($rootScope,
websocketEvents) {
data: {noteId: noteId, selectedSettingIds: selectedSettingIds}});
},
- listConfigurations: function() {
- websocketEvents.sendNewEvent({op: 'LIST_CONFIGURATIONS'});
- },
-
getInterpreterSettings: function() {
websocketEvents.sendNewEvent({op: 'GET_INTERPRETER_SETTINGS'});
},