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

Add a configurable default backend. #426

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Commits on Jan 22, 2024

  1. Add a configurable default backend.

    For all requests that don't match any path or path prefix in the
    database, forward the request to ROUTER_DEFAULT_BACKEND_URL. This
    defaults to `government-frontend`, which is where 93% of routes go.
    
    This should allow shrinking the route database by an order of magnitude
    as well as making it a little easier to eliminate Router in the long
    run.
    
    We no longer respond 503 to all requests when the route database is
    empty. This feature was presumably conceived as a kind of lameduck
    mode (albeit somewhat buggy). We're almost certainly better off without
    it now that an empty database doesn't mean we're completely broken.
    sengi committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    1115bb6 View commit details
    Browse the repository at this point in the history
  2. Clean up test names and style in proxy_function_test.

    - Use common terminology e.g. "HTTP method".
    - Make the `Describe` / `It` test names fit together better.
    - Trivial style cleanup to reduce boilerplate somewhat.
    sengi committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    28767dc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    beb0095 View commit details
    Browse the repository at this point in the history
  4. Clean up startTarpitBackend test helper.

    - Remove unnecessary conditionals around time.Sleep().
    - Use const.
    sengi committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    1ea2b57 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eee0746 View commit details
    Browse the repository at this point in the history
  6. Prefer HaveHTTPStatus() over StatusCode.To(Equal()).

    This also gets rid of change-detectors on error response bodies (which
    we don't care about, because the edge caches replace them with prettier
    ones anyway).
    
    https://onsi.github.io/gomega/#working-with-http-responses
    
    Generated with:
    
    ```sh
    g grep -l resp.StatusCode integration_tests | xargs gsed -i \
      's/Expect(resp.StatusCode)\.To(Equal(\([0-9]\{3\}\)))/Expect(resp).To(HaveHTTPStatus(\1))/'
    ```
    sengi committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    f06f154 View commit details
    Browse the repository at this point in the history