Skip to content

Support double progression: gate on top of range and require all sets - #2494

Open
aadishsanghvi wants to merge 1 commit into
wger-project:masterfrom
aadishsanghvi:feat/support-double-progression
Open

Support double progression: gate on top of range and require all sets#2494
aadishsanghvi wants to merge 1 commit into
wger-project:masterfrom
aadishsanghvi:feat/support-double-progression

Conversation

@aadishsanghvi

Copy link
Copy Markdown

Proposed Changes

Support classic double progression in the progression requirements engine:

  1. New max_repetitions and max_weight rules: Read the same log field as their base rule (repetitions, weight) but gate against the top (ceiling) of the prescribed range (states['maxrepetitions'] / states['maxweight']) rather than the bottom.
  2. New all_sets boolean flag: When true, requires at least the prescribed number of sets to be logged and every logged set to satisfy all rules (rather than a single qualifying set being sufficient).
  3. API Validator support: Validates that all_sets is boolean and rejects unknown keys in the requirements dictionary.
  4. Comprehensive regression tests: Added tests covering max_repetitions, max_weight, under-logging, empty logs, partial qualification, extra sets, full double progression lifecycles, and API validation.

Related Issue(s)

Closes #2480

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Code has been formatted to avoid unnecessary diffs (ruff format && isort .)
  • If the feature is big enough or if there are manual steps needed (deployment changes etc.), write a small writeup in CHANGELOG.md

- Add max_repetitions and max_weight requirement rules to gate against the top of prescribed ranges
- Add all_sets flag to ConfigRequirements requiring all prescribed sets to qualify
- Extend API validators to check all_sets boolean and reject unknown requirement keys
- Add regression and lifecycle tests in test_slot_entry, test_change_config_model, and test_api_validators
- Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support double progression: gate on the top of the rep range and require all sets to qualify

1 participant