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

Merged
merged 1 commit into from
May 28, 2024

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

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

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

Project coverage is 67.21%. Comparing base (9d296c4) to head (638fc62).

Files Patch % Lines
...ackages/backend/server/src/core/config/resolver.ts 80.67% 39 Missing and 1 partial ⚠️
.../server/src/fundamentals/config/runtime/service.ts 84.29% 38 Missing ⚠️
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   66.92%   67.21%   +0.28%     
==========================================
  Files         592      611      +19     
  Lines       28950    29514     +564     
  Branches     2615     2653      +38     
==========================================
+ Hits        19374    19837     +463     
- Misses       9303     9404     +101     
  Partials      273      273              
Flag Coverage Δ
server-test 77.68% <91.49%> (+0.11%) ⬆️
unittest 39.02% <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 3 times, most recently from 70594bd to 02f7c46 Compare May 22, 2024 09:52
@forehalo forehalo force-pushed the 61/runtime-application-settings branch 2 times, most recently from a3b3b7b to 062c158 Compare May 27, 2024 07:56
@forehalo forehalo changed the base branch from canary to 61/admin-feature May 27, 2024 07:56
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from 062c158 to d0d989a Compare May 27, 2024 11:03
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from d0d989a to 4708eee Compare May 27, 2024 11:05
@Brooooooklyn Brooooooklyn changed the base branch from 61/admin-feature to canary May 27, 2024 11:30
@forehalo forehalo force-pushed the 61/runtime-application-settings branch 2 times, most recently from d827836 to d1da6b0 Compare May 28, 2024 06:33
Copy link

graphite-app bot commented May 28, 2024

Merge activity

---

<details open="true"><summary>Generated summary (powered by <a href="https://app.graphite.dev">Graphite</a>)</summary>

> ## 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.
</details>
@forehalo forehalo force-pushed the 61/runtime-application-settings branch from d1da6b0 to 638fc62 Compare May 28, 2024 06:44
@graphite-app graphite-app bot merged commit 638fc62 into canary May 28, 2024
32 checks passed
@graphite-app graphite-app bot deleted the 61/runtime-application-settings branch May 28, 2024 06:55
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