aws / aws-parallelcluster-ui

Apache License 2.0
31 stars 20 forks source link

[Feature Flag] Fix a bug in versions comparison that was disabling all PC 3.2.0+ features on PC 3.10.0+. #341

Closed gmarciani closed 1 month ago

gmarciani commented 1 month ago

Description

Fix a bug in feature flagging that was disabling of all PC 3.2.0+ features on PC 3.10.0+. In particular, we needed to fix the logic that compares semantic versions.

Before this change 3.10.0 and 3.10.1 were considered lower than 3.2.0 and greater than 3.1.0, so every feature between 3.2.0 and 3.9.0 was disabled. With this fix, feature flags are correct.

Example: the feature flexible instance type was disablòed for 3.10.0 because of the bug. With the fix it is now enabled (see screenshot)

Screenshot 2024-07-19 at 17 05 45

Note There is a package dedicated to semver comparison (semver), but it's not worth it to add an extra dependency for such an easy logic.

How Has This Been Tested?

  1. Unit tests (full suite + one new test covering the buggy case)
  2. Deployed in personal account and verified that feature flagging is working for 3.10.1

References

PR Quality Checklist

In order to increase the likelihood of your contribution being accepted, please make sure you have read both the Contributing Guidelines and the Project Guidelines

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.