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

fix: searching edge identities (dashboard_alias prefix and identifier casing) #4700

Merged
merged 5 commits into from
Oct 8, 2024

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented Oct 7, 2024

Changes

This PR fixes 2 issues:

  1. Any search term that began with any number of characters contained in the string "dashboard_alias:" would fail because of the way in which lstrip works.
  2. When searching by an identifier, the search term was incorrectly lower cased, meaning that the search would return no results if the identifier contained upper case characters (see here for the culprit PR)

tl;dr on (1) - TIL str.lstrip() removes all characters from the beginning of the string that match the input string. What we actually wanted here was str.removeprefix(). More information available here.

How did you test this code?

Added a new unit test with a specific example of the issue.

@matthewelwell matthewelwell requested a review from a team as a code owner October 7, 2024 13:15
@matthewelwell matthewelwell requested review from zachaysan and removed request for a team October 7, 2024 13:15
Copy link

vercel bot commented Oct 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 10:55am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 10:55am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 10:55am

@github-actions github-actions bot added api Issue related to the REST API fix labels Oct 7, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4700 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4700 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4700 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4700 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4700 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Oct 7, 2024

Uffizzi Preview deployment-56981 was deleted.

@github-actions github-actions bot added fix and removed fix labels Oct 7, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.21%. Comparing base (e65c8da) to head (f003cd8).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4700   +/-   ##
=======================================
  Coverage   97.20%   97.21%           
=======================================
  Files        1171     1171           
  Lines       40640    40651   +11     
=======================================
+ Hits        39506    39517   +11     
  Misses       1134     1134           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added fix and removed fix labels Oct 8, 2024
@matthewelwell matthewelwell changed the title fix: searching dashboard alias fails for certain aliases fix: searching edge identities (dashboard_alias prefix and identifier casing) Oct 8, 2024
@github-actions github-actions bot added fix and removed fix labels Oct 8, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Oct 8, 2024
Merged via the queue into main with commit 8e6b241 Oct 8, 2024
35 checks passed
@matthewelwell matthewelwell deleted the fix/edge-identity-alias-search-lstrip branch October 8, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants