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

fix(backend): derive INVITE_LINK_URL and BBB_LOGOUT_URL from FRONTEND_URL #1820

Merged
merged 7 commits into from
Aug 22, 2024

Conversation

Bettelstab
Copy link
Contributor

🍰 Pullrequest

In our kubernetes Deployment, the environment variable FRONTEND_BBB_LOGOUT_URL was missing. Therefore the fix for #1261 did not work.

Instead of adding the environment variable, I propose to simplify the config and derive its value, as well as the one for invite links, from the FRONTEND_URL.

@Bettelstab Bettelstab self-assigned this Aug 20, 2024
@Bettelstab Bettelstab changed the title backend(fix): derive INVITE_LINK_URL and BBB_LOGOUT_URL from FRONTEND_URL fix(backend): derive INVITE_LINK_URL and BBB_LOGOUT_URL from FRONTEND_URL Aug 20, 2024
Copy link
Contributor

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

environment

Comment on lines 42 to 43
FRONTEND_INVITE_LINK_URL: FRONTEND_URL + 'join-table/',
FRONTEND_BBB_LOGOUT_URL: FRONTEND_URL + 'table-closed/',
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, great idea, however I would completely remove these configuration variables. The frontend already knows its hostname. So, wherever FRONTEND_INVITE_LINK_URL is being used, that's the location where we would build a url. Only exception is if we have to reuse that link somewhere. If it's used only once, build it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but this is for the Backend :)

backend/src/config/config.ts Outdated Show resolved Hide resolved
@Bettelstab Bettelstab requested a review from roschaefer August 21, 2024 12:53
@Bettelstab Bettelstab dismissed roschaefer’s stale review August 21, 2024 15:10

Implemented the URL construction The other comment would be true for frontend config only.

@Bettelstab Bettelstab enabled auto-merge (squash) August 21, 2024 15:18
Copy link
Contributor

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

image

This is what I mean. The config variable is used only once. Please create the variable in TableResolver.ts. In the TableResolver.spec.ts you can set a hard-coded value.

There is a backend-deployment.yaml, where you can remove the environment variable, and the backend-deployment.yaml links to a configmap which consumes all data from values.yaml, where you can remove the corresponding frontend_invite_link_url as well.

It's an easy change in the deployment configuration, do you feel OK to take care of that?

Remove FRONTEND_BBB_LOGOUT_URL and FRONTEND_INVITE_LINK_URL from config
and calculate them where there are used
@Bettelstab Bettelstab requested a review from roschaefer August 21, 2024 18:56
@Bettelstab Bettelstab dismissed roschaefer’s stale review August 21, 2024 18:57

Changes implemented as requested

Copy link
Contributor

@roschaefer roschaefer left a comment

Choose a reason for hiding this comment

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

Great!

great

@@ -18,7 +18,7 @@ const getMeetingsMock = jest.mocked(getMeetings)

let testServer: ApolloServer<Context>

CONFIG.FRONTEND_INVITE_LINK_URL = '/'
CONFIG.FRONTEND_URL = 'https://my.frontend.url'
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, this one is global state being mutated in a test suite. I.e. it will affect other test suites that get executed afterwards.

Anyways, I think this is for another PR. There was an assignment to CONFIG.FRONTEND_INVITE_LINK_URL already.

@Bettelstab Bettelstab merged commit 6ebf34c into master Aug 22, 2024
27 checks passed
@ulfgebhardt ulfgebhardt deleted the simplify-config branch September 12, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants