Skip to content

Add minimum value for wiki page size limit

Summary

The following discussion from !36729 (merged) should be addressed:

  • @alexkalderimis started a discussion: (+4 comments)

    Should we add a minimum value for the application setting, which we validate before setting? Accidentally setting this to 10 in the mistaken belief that it represented megabytes, but in fact getting a wiki page size limit of 10 bytes would break the wiki for most valid uses. I seems there ought to be a floor on this value.

    Thoughts, @toupeira ?

Improvements

Add a minimum value to our Rails validation, something like 1KB should be sensible.

Involved components

  • app/models/application_setting.rb
  • doc/administration/wikis/index.md
  • doc/api/settings.md

Backlog Refinement by @alexkalderimis:

Documentation needed:

Yes, for site administration we need to document the relevant limits.

Test Activity Planned:

Unit test for validation: verify that the limit cannot be set below a given level (this is editing a spec)

Security Tests Planned:

None

Explanation for Approach to be taken:

Change the current validation and potentially DB column constraint

MR Breakdown:

  • Change validation (and potentially DB column constraint)

Weight Estimate: 1


Backlog Refinement by @.luke:

Documentation needed:

Yes, as in the issue description:

  • doc/administration/wikis/index.md
  • doc/api/settings.md

Test Activity Planned:

Validation test of ApplicationSetting

Explanation for Approach to be taken:

Add a validation to ApplicationSetting. I'm expecting because the property was added so recently, and it's unlikely that people have set it to less than 1.kilobyte that we can write this change with the expectation that no one has set it lower.

MR Breakdown:

  • Add validation to ApplicationSetting
  • Docs

Weight Estimate:

1


Backlog Refinement by @toupeira:

Documentation needed: Update the mentioned docs.

Test Activity Planned: Update validation specs.

Security Tests Planned: None

Explanation for Approach to be taken:

MR Breakdown: 1 MR

Weight Estimate: 1

Backlog RefinementKnowledge

Edited by Alex Kalderimis