fix MPP-4559: feat(masks): make free mask limit configurable per environment#6280
fix MPP-4559: feat(masks): make free mask limit configurable per environment#6280groovecoder wants to merge 1 commit intomainfrom
Conversation
640e18f to
f4430d2
Compare
jwhitlock
left a comment
There was a problem hiding this comment.
This may go beyond the scope of MPP-4559, which only covered updating the mask limit on the API side. This looks more like it is getting into the Relay Dashboard work, which would include e2e tests in MPP-4563.
Since this is mostly frontend code, I'm commenting rather than approving or requesting changes
frontend/src/config.ts
Outdated
| emailSizeLimitNumber: 10, | ||
| emailSizeLimitUnit: "MB", | ||
| maxFreeAliases: 5, | ||
| maxFreeAliases: 50, |
There was a problem hiding this comment.
I'm concerned this could ship the new mask limit when it goes to production. Is product OK with that, or did they want to coordinate across clients (Firefox integration, add-on)
There was a problem hiding this comment.
I introduced a new waffle flag increased_free_mask_limit to control whether the app will use the MAX or INCREASED_MAX value.
| // Note: Set to 5 for test performance. Production default is 50 (see runtimeData-default.ts), | ||
| // but tests use 5 to avoid creating 49 aliases to trigger limit-related UI. | ||
| MAX_NUM_FREE_ALIASES: 5, | ||
| }; |
|
ran unit test suite, looks like this PR also covers MPP-4571 |
| const maxFreeAliases = runtimeData.MAX_NUM_FREE_ALIASES; | ||
| const showAtMaskCount = maxFreeAliases - 1; | ||
|
|
||
| if ( |
There was a problem hiding this comment.
this work covers MPP-4572
only question i have for product/UX - do we want this to pop up maybe for the 25 mask mark? or is waiting until 49 still an appropriate use for this component?
|
Overall this looks good to me, it does cover several of the frontend tickets relating to the mask limit expansion initiative - MPP-4570, MPP-4571 and MPP-4572 only thing i would double check (and maybe this is something youve already considered looking at the PR)
it looks like if its not set in Django, that you are using the setting in the frontend config.ts file, if thats intentional i'd say it looks good to me (and makes the most use of the backend api value) |
|
This looks good, but I'm a bit worried about this line in the add-on being hardcoded: It would be good to get a timeline + sequence of the rollout strategy that takes into account the different Relay clients. If we change the frontend default from |
f4430d2 to
0b73e52
Compare
…ronment Backend exposes `MAX_NUM_FREE_ALIASES` via `runtime_data` endpoint. Frontend fetches the value and falls back to hardcoded 5. Components use runtime data instead of static config. Waffle flag "increased_free_mask_limit" controls which limit applies. Two environment variables set the values: - MAX_NUM_FREE_ALIASES (default: 5) - INCREASED_MAX_NUM_FREE_ALIASES (defaul: 50) Dev and stage can now set higher limits without rebuilding frontend. Single build works across all environments. Each environment can run with MAX or INCREASED_MAX via waffle flag.
0b73e52 to
021e257
Compare
|
I introduced a new waffle flag This way, we can merge this code, and set the env var and waffle flag in dev & stage servers:
For the add-on, here's a first draft PR to make it also pull from the |
joeherm
left a comment
There was a problem hiding this comment.
With the waffle-flag and add-on work this LGTM.
|
@vpremamozilla, re:
Yes that's intentional. Your comment made me realize that |
This PR fixes MPP-4559.
How to test:
MAX_NUM_FREE_ALIASESenv var to a new number (e.g.,10)cd frontend && npm run buildcd .. && python manage.py collectstaticpython manage.py runserverMAX_NUM_FREE_ALIASESenv var to a new higher number (e.g.,15)l10n changes have been submitted to the l10n repository, if any.I've added or updated relevant docs in the docs/ directory.All UI revisions follow the coding standards, and use Protocol / Nebula colors where applicable (see/frontend/src/styles/colors.scss).