Repository navigation
Move gui and user-system configurations to core/config and host config-retrieval endpoints via core/config-service - #3458
Merged
Conversation
GuiConfigService that requests the backend endpointapplication.conf and read via the http request
aglinxinyuan
requested changes
Jun 5, 2025
aglinxinyuan
approved these changes
Jun 8, 2025
aglinxinyuan
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Please also get approval from @shengquan-ni for backend changes.
bobbai00
force-pushed
the
jiadong-move-config-to-backend
branch
from
June 9, 2025 05:37
2922d6b to
9d58028
Compare
application.conf and read via the http requestcore/conf and host endpoints for retrieving configs via core/config-service
core/conf and host endpoints for retrieving configs via core/config-servicecore/conf and host config-retrieval endpoints via core/config-service
shengquan-ni
reviewed
Jun 9, 2025
# Conflicts: # core/amber/src/main/scala/edu/uci/ics/amber/engine/common/AmberConfig.scala
core/conf and host config-retrieval endpoints via core/config-servicecore/config and host config-retrieval endpoints via core/config-service
SarahAsad23
pushed a commit
to madisonmlin/texera
that referenced
this pull request
May 20, 2026
…fig-retrieval endpoints via `core/config-service` (apache#3458) This PR adds the `GuiConfig` endpoint and frontend handlers. The GUI will request this endpoint to load the config values from the backend webserver during the initialization. And all the usages of config item from the `environment.ts` have been replaced with config items from `GuiConfigService`. ## For Developers - To change the values of gui-related or user-system-related config, please go to: - `core/config/src/main/resources/user-system.conf` for user-system configs - `core/config/src/main/resources/gui.conf` for gui-related configs - During local development, **always start `ConfigService`** located at `core/config-service/src/main/scala/edu/uci/ics/texera/service/ConfigService.scala` ## Motivation The current `gui` configuration design has some major issues. ### Problem 1: 2-copy of the same configurations Some configurations have 2 copies: one at the `gui`, another at the backend services. For example: `user-sys.enabled`: this flag appears in both the gui in `environment.default.ts`: ```typescript /** * whether user system is enabled */ userSystemEnabled: false, ``` and the backend in `application.conf` ```hocon user-sys { enabled = false enabled = ${?USER_SYS_ENABLED} } ``` 2-copy has lots of issues: - Inconsistency definition will result into undefined behaviors - During docker image building, backend is configured via environmental variables, but `gui` requires hard-coded values. ### Problem 2: Feature Usability are controlled at the `gui`, not at the backend Some configurations are **only** at the `gui` and control the usabilities of system features ```typescript /** * whether hub feature is enabled */ hubEnabled: true, /** * whether forum feature is enabled */ forumEnabled: false, /** * whether project feature is enabled */ projectEnabled: false, ``` Toggling these values will make the corresponding components appearing/disappearing. But the problems are - The corresponding endpoints are still being hosted at the backend - Users can modify the flag at the browser(maybe maliciously) and use these features. These problems can result into undefined behaviors One naive solution is: add the same configuration to the backend. **This will fallback to the 2-copy issue** ## Solution - Move the necessary configuration from `gui` to the backend - Have the endpoint(s) to send the configuration to the frontend ### Benefit - Solve the 2-copy issue and security issue - In the future, we can enable - Hot-reloading the system features by the system admin - Fine-grained controls of the feature availability, e.g. per user ## Design Details ### 1. How many endpoints should be there? 2 endpoints, - /api/config/gui: return all the configs related to gui - /api/config/user-system: return configs related to user-system ### 2. Which backend micro service should host the endpoint(s)? A separate micro service, `ConfigService`, has been created. It loads the conf files in `core/conf` module and hosts two endpoints mentioned above. ### 3. Where the configurations should be stored? Currently they are stored in the `core/conf/src/main/resources`. In the future, if there are needs of changing the config, we will add the persistency using database. ### 4. How `gui` should fetch the configurations Configs are fetched once by the `GuiConfigService` at the frontend. In the future, if we introduce the modification of the configurations, we should consider persisting them in the database. ## Implementation Details ### Backend Services Two sub modules have been added to the `core`: - `core/conf`: holds the configuration files and readers of the configurations - `core/config-service`: hosts the endpoints of reading the configuration files ### Deployment `deployment/k8s/texera-helmchart` has been updated to have the environment variables for gui setting. ### Frontend - `environment.default.ts` has been cleared to only have `production` flag and the `apiEndpoint` string. - A new service, `core/gui/src/app/common/service/gui-config.service.ts`, has been introduced to load the config from the. backend. - A new type definition, `core/gui/src/app/common/type/gui-config.ts` has been introduced to contain the configs names and types. - A new mock service, `core/gui/src/app/common/service/gui-config.service.mock.ts`, has been added and only used during the unit testing. ## Future Plan after this PR 1. A subsequent PR will be raised to move all the conf files to `core/conf/src/main/resources`, including `application.conf`, `storage.conf`, `auth.conf` 2. The Step1 and Step2 of wikis will be refactored based on the latest configuration structures.
1 of 6 tasks
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
…fig-retrieval endpoints via `core/config-service` (apache#3458) This PR adds the `GuiConfig` endpoint and frontend handlers. The GUI will request this endpoint to load the config values from the backend webserver during the initialization. And all the usages of config item from the `environment.ts` have been replaced with config items from `GuiConfigService`. ## For Developers - To change the values of gui-related or user-system-related config, please go to: - `core/config/src/main/resources/user-system.conf` for user-system configs - `core/config/src/main/resources/gui.conf` for gui-related configs - During local development, **always start `ConfigService`** located at `core/config-service/src/main/scala/edu/uci/ics/texera/service/ConfigService.scala` ## Motivation The current `gui` configuration design has some major issues. ### Problem 1: 2-copy of the same configurations Some configurations have 2 copies: one at the `gui`, another at the backend services. For example: `user-sys.enabled`: this flag appears in both the gui in `environment.default.ts`: ```typescript /** * whether user system is enabled */ userSystemEnabled: false, ``` and the backend in `application.conf` ```hocon user-sys { enabled = false enabled = ${?USER_SYS_ENABLED} } ``` 2-copy has lots of issues: - Inconsistency definition will result into undefined behaviors - During docker image building, backend is configured via environmental variables, but `gui` requires hard-coded values. ### Problem 2: Feature Usability are controlled at the `gui`, not at the backend Some configurations are **only** at the `gui` and control the usabilities of system features ```typescript /** * whether hub feature is enabled */ hubEnabled: true, /** * whether forum feature is enabled */ forumEnabled: false, /** * whether project feature is enabled */ projectEnabled: false, ``` Toggling these values will make the corresponding components appearing/disappearing. But the problems are - The corresponding endpoints are still being hosted at the backend - Users can modify the flag at the browser(maybe maliciously) and use these features. These problems can result into undefined behaviors One naive solution is: add the same configuration to the backend. **This will fallback to the 2-copy issue** ## Solution - Move the necessary configuration from `gui` to the backend - Have the endpoint(s) to send the configuration to the frontend ### Benefit - Solve the 2-copy issue and security issue - In the future, we can enable - Hot-reloading the system features by the system admin - Fine-grained controls of the feature availability, e.g. per user ## Design Details ### 1. How many endpoints should be there? 2 endpoints, - /api/config/gui: return all the configs related to gui - /api/config/user-system: return configs related to user-system ### 2. Which backend micro service should host the endpoint(s)? A separate micro service, `ConfigService`, has been created. It loads the conf files in `core/conf` module and hosts two endpoints mentioned above. ### 3. Where the configurations should be stored? Currently they are stored in the `core/conf/src/main/resources`. In the future, if there are needs of changing the config, we will add the persistency using database. ### 4. How `gui` should fetch the configurations Configs are fetched once by the `GuiConfigService` at the frontend. In the future, if we introduce the modification of the configurations, we should consider persisting them in the database. ## Implementation Details ### Backend Services Two sub modules have been added to the `core`: - `core/conf`: holds the configuration files and readers of the configurations - `core/config-service`: hosts the endpoints of reading the configuration files ### Deployment `deployment/k8s/texera-helmchart` has been updated to have the environment variables for gui setting. ### Frontend - `environment.default.ts` has been cleared to only have `production` flag and the `apiEndpoint` string. - A new service, `core/gui/src/app/common/service/gui-config.service.ts`, has been introduced to load the config from the. backend. - A new type definition, `core/gui/src/app/common/type/gui-config.ts` has been introduced to contain the configs names and types. - A new mock service, `core/gui/src/app/common/service/gui-config.service.mock.ts`, has been added and only used during the unit testing. ## Future Plan after this PR 1. A subsequent PR will be raised to move all the conf files to `core/conf/src/main/resources`, including `application.conf`, `storage.conf`, `auth.conf` 2. The Step1 and Step2 of wikis will be refactored based on the latest configuration structures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the
GuiConfigendpoint and frontend handlers. The GUI will request this endpoint to load the config values from the backend webserver during the initialization. And all the usages of config item from theenvironment.tshave been replaced with config items fromGuiConfigService.For Developers
core/config/src/main/resources/user-system.conffor user-system configscore/config/src/main/resources/gui.conffor gui-related configsConfigServicelocated atcore/config-service/src/main/scala/edu/uci/ics/texera/service/ConfigService.scalaMotivation
The current
guiconfiguration design has some major issues.Problem 1: 2-copy of the same configurations
Some configurations have 2 copies: one at the
gui, another at the backend services. For example:user-sys.enabled: this flag appears in both the gui inenvironment.default.ts:and the backend in
application.conf2-copy has lots of issues:
guirequires hard-coded values.Problem 2: Feature Usability are controlled at the
gui, not at the backendSome configurations are only at the
guiand control the usabilities of system featuresToggling these values will make the corresponding components appearing/disappearing.
But the problems are
These problems can result into undefined behaviors
One naive solution is: add the same configuration to the backend. This will fallback to the 2-copy issue
Solution
guito the backendBenefit
Design Details
1. How many endpoints should be there?
2 endpoints,
2. Which backend micro service should host the endpoint(s)?
A separate micro service,
ConfigService, has been created. It loads the conf files incore/confmodule and hosts two endpoints mentioned above.3. Where the configurations should be stored?
Currently they are stored in the
core/conf/src/main/resources. In the future, if there are needs of changing the config, we will add the persistency using database.4. How
guishould fetch the configurationsConfigs are fetched once by the
GuiConfigServiceat the frontend. In the future, if we introduce the modification of the configurations, we should consider persisting them in the database.Implementation Details
Backend Services
Two sub modules have been added to the
core:core/conf: holds the configuration files and readers of the configurationscore/config-service: hosts the endpoints of reading the configuration filesDeployment
deployment/k8s/texera-helmcharthas been updated to have the environment variables for gui setting.Frontend
environment.default.tshas been cleared to only haveproductionflag and theapiEndpointstring.core/gui/src/app/common/service/gui-config.service.ts, has been introduced to load the config from the. backend.core/gui/src/app/common/type/gui-config.tshas been introduced to contain the configs names and types.core/gui/src/app/common/service/gui-config.service.mock.ts, has been added and only used during the unit testing.Future Plan after this PR
core/conf/src/main/resources, includingapplication.conf,storage.conf,auth.conf