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

Refactor Route IDs #1891

Merged
merged 12 commits into from
May 6, 2024
Merged

Refactor Route IDs #1891

merged 12 commits into from
May 6, 2024

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented Apr 25, 2024

Describe your changes

We have at least 3 distinct IDs in use for routes:

  • ID in route.Route, which is the ID in the database
  • NetID in route.Route, which is the Name/ID in the dashboard
  • HAUniqueID which is a combination of Route.NetID and Route.Network

Having so many IDs using all string it's hard to distinguish them from each other.
This PR refactors the IDs to use dedicated types to avoid mixing them up.
Conversions from/to string must be done explicitly. Conversions between the types must not happen.

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@lixmal lixmal changed the base branch from main to fix/route-selection April 25, 2024 16:14
@lixmal lixmal marked this pull request as ready for review April 25, 2024 16:40
Base automatically changed from fix/route-selection to main April 29, 2024 16:43
@lixmal lixmal force-pushed the refactor/route-ids branch from d01f5a3 to eb99e1d Compare May 3, 2024 10:23
@lixmal lixmal merged commit 4e7c177 into main May 6, 2024
16 checks passed
@lixmal lixmal deleted the refactor/route-ids branch May 6, 2024 12:47
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