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: various fixes for API usage alerting / billing #4158

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented Jun 13, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

This PR fixes 3 issues found when running through the test script for the API usage alerting / billing (see script here).

The 3 issues fixed are:

  1. The identifier used for retrieving flags from Flagsmith used the organisation name, which can include spaces and therefore was not valid. This PR removes the organisation name altogether because it's not needed and, in fact, would have caused issues if orgs changed their name.
  2. The task to update influx data in the sales dashboard was broken due to a KeyError because the range bucket mappings needed updating to account for the new date_start logic when querying Influx.
  3. get_client method is currently failing in the task processor since none of the required environment variables are set. I've added these environment variables in now.

How did you test this code?

Updated existing test cases

Copy link

vercel bot commented Jun 13, 2024

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

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jun 13, 2024 4:20pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jun 13, 2024 4:20pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jun 13, 2024 4:20pm

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

github-actions bot commented Jun 13, 2024

Uffizzi Preview deployment-53029 was deleted.

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.50%. Comparing base (20fb43e) to head (fb7a4bf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4158   +/-   ##
=======================================
  Coverage   96.50%   96.50%           
=======================================
  Files        1177     1177           
  Lines       38191    38198    +7     
=======================================
+ Hits        36856    36863    +7     
  Misses       1335     1335           

☔ 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 Jun 13, 2024
@matthewelwell matthewelwell changed the title fix: flagsmith organisation identifier and range bucket mappings fix: various fixes for API usage alerting / billing Jun 13, 2024
@matthewelwell matthewelwell marked this pull request as ready for review June 13, 2024 16:21
@github-actions github-actions bot added fix and removed fix labels Jun 13, 2024
@matthewelwell matthewelwell requested a review from zachaysan June 13, 2024 16:58
@zachaysan zachaysan added this pull request to the merge queue Jun 13, 2024
Merged via the queue into main with commit 9a6e335 Jun 13, 2024
31 checks passed
@zachaysan zachaysan deleted the fix/api-usage-alerting-billing-fixes branch June 13, 2024 18:44
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