Skip to content

[server] Change response codes returned from api/feature-flags/slow-database endpoint #14930

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

Merged
merged 3 commits into from
Nov 25, 2022

Conversation

andrew-farries
Copy link
Contributor

Description

Make the api/feature-flags/slow-database return code 200 and set the X-Gitpod-Slow-Database header consistently.

We don't need to distinguish between response codes for the reverse proxy 'pre-flight' added in #14897 and in fact having the endpoint return non-success codes is actively unhelpful when using the Caddy forward_auth directive.

See #14897 (comment) for more context.

Related Issue(s)

Part of #9198

How to test

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@andrew-farries andrew-farries requested a review from a team November 24, 2022 16:20
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Nov 24, 2022
@easyCZ
Copy link
Member

easyCZ commented Nov 24, 2022

/hold for suggested refactor, up to you if you want to do it

@roboquat roboquat added size/S and removed size/XS labels Nov 25, 2022
Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

LGTM ✔️

@andrew-farries
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 04fb36c into main Nov 25, 2022
@roboquat roboquat deleted the af/feature-flag-endpoint-response-codes branch November 25, 2022 10:39
try {
if (!User.is(req.user)) {
res.setHeader("X-Gitpod-Slow-Database", "false");
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch!

@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants