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

[server] Single source of configuration I/II #4882

Merged
merged 3 commits into from
Jul 27, 2021
Merged

Conversation

geropl
Copy link
Member

@geropl geropl commented Jul 20, 2021

Attempts to fix #4650. This is the 1st in a series of 2 PRs.

It turns out the helm chart and parsing interaction in Env is rather complicated. To make sure we do not miss any variance we take a 2 step approach:

  1. Introduce new Config shape which contains everything from Env (minus some basic refactoring and cleanup). This is not used yet to make sure we don't break anything, but instead just printed out on startup for reference.
  2. The next step is to ease the process of serializing->deserializing the config from helm chart to Config, ideally reducing it to a {{ toJson | b64enc }} on helm followed by a JSON.parse(...) + validation in server. To make sure we don't break stuff we can compare the result to the print-outs from staging and devstaging

For this PR, feedback is very welcome on:

  • the structure of Config
  • verification that the remaining unused fields in Env can be removed.

The rest is straight forward extract/removal.

@geropl geropl changed the title [server] Single source of configuration I [server] Single source of configuration I/II Jul 20, 2021
@geropl geropl requested review from AlexTugarev and removed request for akosyakov July 21, 2021 12:56
@geropl geropl force-pushed the gpl/4650-server-config branch 2 times, most recently from ef42fc0 to 74d3a80 Compare July 26, 2021 12:40
@geropl geropl requested a review from AlexTugarev July 26, 2021 12:57
@roboquat
Copy link
Contributor

@Goldselleruk: changing LGTM is restricted to collaborators

In response to this:

#Gdzie gold

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@AlexTugarev
Copy link
Member

AlexTugarev commented Jul 27, 2021

/werft run

👍 started the job as gitpod-build-gpl-4650-server-config.8

Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good. Thanks @geropl!
Let's resolve the merge conflicts and perhaps wait with merging for todays deployment in order to verify on staging one more time.

components/server/ee/src/config.ts Outdated Show resolved Hide resolved
To be able to easily map Env+EnvEE into config there was some minor refactoring/cleanup necessary. This has be done in a way to be as straigth forward as possible to minimize the risk of breaking things, while making it possible to easily write an alternative Config parser.
@geropl
Copy link
Member Author

geropl commented Jul 27, 2021

@AlexTugarev I rebased, merged Env/EnvEE -> Config and squashed commits: ready to merge!

@@ -80,6 +82,7 @@ export class Server<C extends GitpodClient, S extends GitpodServer> {

public async init(app: express.Application) {
log.info('Initializing');
log.info('config', { config: JSON.stringify(this.config, undefined, 2) });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@AlexTugarev
Copy link
Member

/hold

/lgtm

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 7f2752ee0e556fad6c7ea68ed6e637e559627209

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexTugarev, geropl, Goldselleruk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@AlexTugarev
Copy link
Member

@geropl feel free to release the break ;-)

@roboquat roboquat merged commit ae0698e into main Jul 27, 2021
@roboquat roboquat deleted the gpl/4650-server-config branch July 27, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[server] rewrite configuration to use a single config source
3 participants