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

env variables for ACTION_HISTORY limits #1262

Merged
merged 7 commits into from
Oct 17, 2024

Conversation

fflorent
Copy link
Collaborator

@fflorent fflorent commented Oct 15, 2024

Context

Partial fix of #1121

As a self-hoster, I want to be able to parameterize ACTION_HISTORY max sizes (both as rows and as disk space)

Proposed solution

Introduce 2 env variables to make those limits configurable.

I made these two values require to be strictly positive.

Also I introduced check for minimum values (minValue) and for the maximum values (maxValue) for AppSettings.readInt() / AppSettings.requireInt() and took the opportunity to force the timeout for OIDC to be positive.

Also as I introduced some changes in AppSettings, I started testing this module. I felt like it would take some time to test everything, so I start small with this test and only test properly the methods related to integers (readInt and requireInt).

Related issues

Fixes #1121

Has this been tested?

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this is not relevant here
  • 🙋 no, because I need help

@fflorent fflorent changed the title Issue1121 env variables for ACTION_HISTORY limits Oct 15, 2024
@fflorent fflorent added the anct label Oct 15, 2024
README.md Outdated Show resolved Hide resolved
@fflorent fflorent force-pushed the issue1121 branch 2 times, most recently from b079a17 to 65478d9 Compare October 15, 2024 17:27
fflorent and others added 2 commits October 15, 2024 19:33
AppSettings seems more future-proof and already raises error when passed
value is not a number. We also introduce minValue and maxValue so we can
constraint the configured value to be within a certain range and avoid
erratic behavior when the value has not been expected.
Co-authored-by: Vincent Viers <[email protected]>
Copy link
Collaborator

@vviers vviers left a comment

Choose a reason for hiding this comment

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

LGTM except for 1 typo

app/server/lib/ActionHistoryImpl.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@hexaltation hexaltation left a comment

Choose a reason for hiding this comment

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

Please correct the value of 100GB to 1GB as suggested by @vviers
for GRIST_ACTION_HISTORY_MAX_BYTES

Thank you for the tests :)

Copy link
Collaborator

@hexaltation hexaltation left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@paulfitz paulfitz left a comment

Choose a reason for hiding this comment

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

Excellent, thanks, and especially appreciate the AppSettings tests.

@paulfitz paulfitz merged commit 30e2cc4 into gristlabs:main Oct 17, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Automatically prune history of a document
4 participants