Skip to content

Move UsageStore logic to using Grid quota counting instead of RCS emails - #4890

Open
junyuanxue wants to merge 1 commit into
mainfrom
08-25-move_usagestore_logic_to_using_grid_quota_counting_instead_of_rcs_emails
Open

Move UsageStore logic to using Grid quota counting instead of RCS emails#4890
junyuanxue wants to merge 1 commit into
mainfrom
08-25-move_usagestore_logic_to_using_grid_quota_counting_instead_of_rcs_emails

Conversation

@junyuanxue

@junyuanxue junyuanxue commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What does this change?

This PR moves the logic behind supplier usage status / summary within UsageStore over to using the new quota counting logic, instead of relying on parsing emails from RCS.

  • As UsageStore no longer requires fetching from S3, I've made it no longer inheriting from BaseStore. However as it still maintains an in-memory store of over-quota agencies (to be used for the is:under-quota search filter), it still needs a scheduler that refreshes the store on an interval.
  • I've changed the exceeded logic from > to >=, as we should start surfacing warning when the quota is full, not just exceeded. This is confirmed by the behaviours below. The wording 'exceeded' is a bit misleading, but as it's used quite extensively, I've refrained from not changing it everywhere.

How should a reviewer test this change?

  • I have set the Getty quota in TEST to a very low number in S3, so Getty quota would be full in TEST
  • Run the Grid locally with --use-TEST flag
  • On launching the Grid you should see some images with the red square with arrow icon indicating they're from a supplier that's hit their quota:
Screenshot 2026-08-26 at 15 47 13
  • Click into one of those images, you should see another warning:
Screenshot 2026-08-26 at 15 47 28
  • If you search with the is:under-quota filter, the images with the arrow icon should disappear:
Screenshot 2026-08-26 at 16 32 08
  • The /quotas page will look like this. Again 4/4 is not exactly 'exceeded', but the alternative is 'quota not full' and I don't think having a 3rd 'quota full' indicator is necessary or particularly useful
Screenshot 2026-08-26 at 15 48 51

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

@junyuanxue junyuanxue added the feature Departmental tracking: work on a new feature label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

@junyuanxue
junyuanxue force-pushed the 08-25-move_usagestore_logic_to_using_grid_quota_counting_instead_of_rcs_emails branch from 35ab670 to 18941b0 Compare August 26, 2026 13:10
@junyuanxue
junyuanxue force-pushed the 08-25-move_usagestore_logic_to_using_grid_quota_counting_instead_of_rcs_emails branch from 18941b0 to a65e9d8 Compare August 26, 2026 14:49
@junyuanxue
junyuanxue marked this pull request as ready for review August 26, 2026 15:22
@junyuanxue
junyuanxue requested a review from a team as a code owner August 26, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

donotmerge feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant