Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromcoder/coder

feat: implement runtime configuration package with multi-org support#13

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lizard-boy wants to merge19 commits intomain
base:main
Choose a base branch
Loading
fromdk/runtime-configs

Conversation

@lizard-boy
Copy link

RFC.

What this does

Adds a new runtimeconfig package for managing all runtime related configuration. The goal of this package is to create a consistent method for CRUD on runtime configuration (as opposed to startup values).

The motivation and driver is mutli-org. Multi org settings must be configured at runtime. Instead of creating ad-hoc CRUD operations to a key/val store, this package creates a single code path for all settings.

Design

The design uses a Manager singleton that produces Resolvers to enable a cache layer in the future. A pure singleton cannot be used as the Resolver requires a database.Store, which could be a tx. So the user of the package must create the Resolver on demand with their local instance of the db.

Usage

The design is intentionally created so that we can deprecate startup values in favor of runtime in the future. The DeploymentEntry type specifically uses startup values as a fallback.

This will allow us to move some startup values into runtime, which has been a sticky point for configuring aspects of coder for awhile now.

Future work

Caching layer ::coder#14586
A follow up to this PR will be a caching layer that uses pubsub to update it's cached values. Adding a cache layer will make all settings essentially free to read, allowing use in hot paths such as httpmw (as we currently do for startup values).

RBAC layer ::coder/internal#154

When caching is implemented, dbauthz will not be called for cache hits. So this layer, or some layer above, needs to be RBAC aware.

Maybe in the initialize? the New? The field could know it's own RBAC properties??

Remove old runtime settings in favor of this
Pretty much all these sql queries:https://github.com/coder/coder/blob/e461d2773b5a2f1bd04ff899a922032b373e187f/coderd/database/queries/siteconfig.sql

Upside is we will remove a lot of database.Store queries (always nice to trim)

dannykoppingand others added19 commitsSeptember 6, 2024 10:19
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
* chore: refactor entry into deployment and runtimeRuntimeEntry has no startup value, and omits functions requiredto be serpent compatible.Co-authored-by: Danny Kopping <danny@coder.com>---------Co-authored-by: Danny Kopping <danny@coder.com>
@lizard-boylizard-boy changed the titleDk/runtime configsfeat: implement runtime configuration package with multi-org supportSep 18, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@lizard-boy@dannykopping@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp