Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): runtime setting support #5602

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

forehalo
Copy link
Member

@forehalo forehalo commented Jan 16, 2024


Generated summary (powered by Graphite)

TL;DR

This pull request adds a new migration file, a new model, and new modules related to runtime settings. It also introduces a new Runtime service that allows getting, setting, and updating runtime configurations.

What changed

  • Added a new migration file migration.sql that creates a table called application_settings with columns key and value.
  • Added a new model ApplicationSetting with properties key and value.
  • Added a new module RuntimeSettingModule that exports the Runtime service.
  • Added a new service Runtime that provides methods for getting, setting, and updating runtime configurations.
  • Modified the app.module.ts file to import the RuntimeSettingModule.
  • Modified the index.ts file in the fundamentals directory to export the Runtime service.
  • Added a new file def.ts in the runtime directory that defines the runtime configurations and provides a default implementation.
  • Added a new file service.ts in the runtime directory that implements the Runtime service.

How to test

  1. Run the migration script to create the application_settings table.
  2. Use the Runtime service to get, set, and update runtime configurations.
  3. Verify that the runtime configurations are stored correctly in the database and can be retrieved and modified using the Runtime service.

Why make this change

This change introduces a new feature related to runtime settings. The Runtime service allows the application to dynamically manage and modify runtime configurations without requiring a restart. This provides flexibility and allows for easier customization and configuration of the application.

Copy link

graphite-app bot commented Jan 16, 2024

Your org has enabled the Graphite merge queue for merging into canary

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

You can enable merging using labels in your Graphite merge queue settings.

Copy link
Member Author

forehalo commented Jan 16, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @forehalo and the rest of your teammates on Graphite Graphite

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: Patch coverage is 91.81401% with 125 lines in your changes are missing coverage. Please review.

Project coverage is 67.75%. Comparing base (7a657b5) to head (02f7c46).
Report is 1 commits behind head on canary.

Files Patch % Lines
.../server/src/fundamentals/config/runtime/service.ts 84.29% 38 Missing ⚠️
...ackages/backend/server/src/core/config/resolver.ts 82.19% 33 Missing and 1 partial ⚠️
packages/backend/server/src/config/affine.self.ts 55.17% 13 Missing ⚠️
...kend/server/src/core/sync/events/events.gateway.ts 22.22% 7 Missing ⚠️
...backend/server/src/fundamentals/config/register.ts 89.39% 7 Missing ⚠️
packages/backend/server/src/core/auth/resolver.ts 75.00% 5 Missing ⚠️
.../backend/server/src/fundamentals/config/default.ts 95.45% 4 Missing ⚠️
...ackages/backend/server/src/core/auth/controller.ts 57.14% 3 Missing ⚠️
...ages/backend/server/src/plugins/redis/instances.ts 0.00% 3 Missing ⚠️
...backend/server/src/core/storage/wrappers/avatar.ts 81.81% 2 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           canary    #5602      +/-   ##
==========================================
+ Coverage   67.53%   67.75%   +0.22%     
==========================================
  Files         584      603      +19     
  Lines       28385    28934     +549     
  Branches     2590     2624      +34     
==========================================
+ Hits        19170    19605     +435     
- Misses       8944     9058     +114     
  Partials      271      271              
Flag Coverage Δ
server-test 78.43% <91.80%> (+0.02%) ⬆️
unittest 39.34% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@forehalo forehalo marked this pull request as draft January 16, 2024 05:54
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from 9956a2b to 04ffeae Compare February 7, 2024 02:57
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from 04ffeae to 52e4b59 Compare March 14, 2024 01:44
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from 52e4b59 to 8b63435 Compare April 24, 2024 11:34
@forehalo forehalo force-pushed the 61/runtime-application-settings branch 5 times, most recently from 495aee4 to 6676f03 Compare May 11, 2024 12:16
@github-actions github-actions bot added test Related to test cases app:core labels May 11, 2024
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from 6676f03 to 0f53b93 Compare May 12, 2024 04:27
@forehalo forehalo force-pushed the 61/runtime-application-settings branch 5 times, most recently from 4996297 to da92936 Compare May 20, 2024 08:24
@forehalo forehalo force-pushed the 61/runtime-application-settings branch 2 times, most recently from 57e8da5 to ae40517 Compare May 21, 2024 05:50
@forehalo forehalo marked this pull request as ready for review May 21, 2024 05:51
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from ae40517 to 264ce92 Compare May 21, 2024 08:44
@forehalo forehalo force-pushed the 61/runtime-application-settings branch 2 times, most recently from fd0c4e1 to bd2ee8a Compare May 22, 2024 09:32
@forehalo forehalo force-pushed the 61/runtime-application-settings branch 2 times, most recently from fb40cf1 to 70594bd Compare May 22, 2024 09:35
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from 70594bd to 02f7c46 Compare May 22, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:core app:server test Related to test cases
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

4 participants