Skip to content

(1st MR) Refactorings to prepare to add a Logger

Omar Qunsul requested to merge extract-rules-matching-into-router-engine into main

Preparing for: #18 (closed)

This was extracted from the (2nd MR) !205 (merged)

Context in this conversation: !205 (comment 2078617851)

What has been done in this MR?

  1. .gitignoreing wrangler.toml because it's generated by GDK, which makes it show up in the git diff. The original file content has been copied to wrangler.toml.example instead.
  2. Moving all the classify logic into classify.ts
  3. Moving the main rules matching into a new class RouterEngine that can encapsulate all the logic of rules matching and applying the matching rule. And keeping the main part of the Router minimal export default.
  4. Adding unique ID to the rules, so that we log which rule has been matched. Maybe we can add a validation that the IDs of the rules are unique in a follow up issue?
  5. Refactor the Documentation. Moved the development into its own page and added Blueprint relevant pages.

Validate changes

On both values GITLAB_RULES_CONFIG=passthrough & GITLAB_RULES_CONFIG=firstcell in your wrangler.toml in env.dev section, the Router should still forward requests to the GitLab instance. By visiting http://gdk.test:3000 you should still see GitLab running.

Edited by Omar Qunsul

Merge request reports

Loading