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

[ResponseOps] provide build-time check that our routes do not overlap #182743

Open
pmuellr opened this issue May 6, 2024 · 1 comment
Open

[ResponseOps] provide build-time check that our routes do not overlap #182743

pmuellr opened this issue May 6, 2024 · 1 comment
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@pmuellr
Copy link
Member

pmuellr commented May 6, 2024

When looking at #182594, I checked the alerting APIs to see if we'd have any "overlapping" URLs, if we relaxed the requirement that rule id's have to be UUIDs.

There are at least two that would overlap:

  • GET /internal/alerting/rule/{id}
  • GET /internal/alerting/rules/_find

Today, they can't overlap, because you can provide an arbitrary id when creating rules, but it must be a valid UUID. Once that's relaxed, someone could create a rule with an id of _find, and then the first URL will never be routed for that id.

It would be nice to have some build-time support for this, perhaps as a jest integration test making use of router.getRoute() to get the routes and "check them". It will need information on how varied the values can be. For instance, today we'd want to indicate the rule id has to be a UUID.

Seems a bit messy, guessing we would need to add some meta data to the routes to help out with this. But would be very useful I think.

@pmuellr pmuellr added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels May 6, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

No branches or pull requests

3 participants