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

feat: allow feature value size to be configured per installation #4446

Merged
merged 11 commits into from
Sep 27, 2024

Conversation

rolodato
Copy link
Member

@rolodato rolodato commented Aug 1, 2024

Based on a customer request, this PR allows the limit on the size of feature values to be configurable per installation using the FEATURE_VALUE_LIMIT environment variable.

Copy link

vercel bot commented Aug 1, 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 Sep 13, 2024 3:52pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Sep 13, 2024 3:52pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Sep 13, 2024 3:52pm

@github-actions github-actions bot added api Issue related to the REST API testing labels Aug 1, 2024
Copy link
Contributor

github-actions bot commented Aug 1, 2024

Docker builds report

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

Copy link
Contributor

github-actions bot commented Aug 1, 2024

Uffizzi Preview deployment-55632 was deleted.

@rolodato rolodato force-pushed the feat/increase-feature-value-size-limit branch from 6ef8575 to f441dd2 Compare August 1, 2024 22:50
@github-actions github-actions bot added testing and removed testing labels Aug 1, 2024
@rolodato rolodato marked this pull request as ready for review August 1, 2024 23:00
@rolodato rolodato requested a review from a team as a code owner August 1, 2024 23:00
@rolodato rolodato requested review from khvn26 and removed request for a team and khvn26 August 1, 2024 23:00
@github-actions github-actions bot added testing and removed testing labels Aug 1, 2024
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.17%. Comparing base (603889c) to head (8857ea8).
Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4446      +/-   ##
==========================================
+ Coverage   97.16%   97.17%   +0.01%     
==========================================
  Files        1160     1164       +4     
  Lines       40123    40280     +157     
==========================================
+ Hits        38986    39143     +157     
  Misses       1137     1137              

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

@matthewelwell matthewelwell marked this pull request as draft August 27, 2024 16:49
@matthewelwell matthewelwell marked this pull request as ready for review August 27, 2024 16:49
@github-actions github-actions bot added testing and removed testing labels Aug 28, 2024
@github-actions github-actions bot added testing and removed testing labels Sep 9, 2024
@github-actions github-actions bot added testing and removed testing labels Sep 10, 2024
@github-actions github-actions bot added testing and removed testing labels Sep 10, 2024
@matthewelwell matthewelwell requested review from a team and gagantrivedi and removed request for a team September 10, 2024 18:00
@matthewelwell matthewelwell changed the title test: increase feature limit size to 2 MB feat: allow feature value size to be configured per installation Sep 10, 2024
@github-actions github-actions bot added feature New feature or request and removed testing labels Sep 10, 2024

dependencies = [
('features', '0064_fix_feature_help_text_typo'),
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the sqlmigrate for this and the other migration

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here they are without setting the environment variable:

❯ python manage.py sqlmigrate features 0065
BEGIN;
--
-- Alter field initial_value on feature
--
-- (no-op)
--
-- Alter field initial_value on historicalfeature
--
-- (no-op)
--
-- Alter field string_value on featurestatevalue
--
-- (no-op)
--
-- Alter field string_value on historicalfeaturestatevalue
--
-- (no-op)
COMMIT;
❯ python manage.py sqlmigrate multivariate 0008
BEGIN;
--
-- Alter field string_value on historicalmultivariatefeatureoption
--
-- (no-op)
--
-- Alter field string_value on multivariatefeatureoption
--
-- (no-op)
COMMIT;

... and with the environment variable

❯ export FEATURE_VALUE_LIMIT=2000000
❯ python manage.py sqlmigrate features 0065
BEGIN;
--
-- Alter field initial_value on feature
--
ALTER TABLE "features_feature" ALTER COLUMN "initial_value" TYPE varchar(2000000);
--
-- Alter field initial_value on historicalfeature
--
ALTER TABLE "features_historicalfeature" ALTER COLUMN "initial_value" TYPE varchar(2000000);
--
-- Alter field string_value on featurestatevalue
--
ALTER TABLE "features_featurestatevalue" ALTER COLUMN "string_value" TYPE varchar(2000000);
--
-- Alter field string_value on historicalfeaturestatevalue
--
ALTER TABLE "features_historicalfeaturestatevalue" ALTER COLUMN "string_value" TYPE varchar(2000000);
COMMIT;
❯ python manage.py sqlmigrate multivariate 0008
BEGIN;
--
-- Alter field string_value on historicalmultivariatefeatureoption
--
ALTER TABLE "multivariate_historicalmultivariatefeatureoption" ALTER COLUMN "string_value" TYPE varchar(2000000);
--
-- Alter field string_value on multivariatefeatureoption
--
ALTER TABLE "multivariate_multivariatefeatureoption" ALTER COLUMN "string_value" TYPE varchar(2000000);
COMMIT;

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Sep 13, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Sep 27, 2024
Merged via the queue into main with commit c28f6f1 Sep 27, 2024
35 checks passed
@matthewelwell matthewelwell deleted the feat/increase-feature-value-size-limit branch September 27, 2024 08:39
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 feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants