Repository navigation
Conversation
backchecks_report_settings passed `drop_duplicates` and `backcheck_goal`, which BackcheckSettings silently ignored, so duplicates were always dropped and the target was always 10. Use the model field names, and save the target under `backcheck_target_percent` so it reloads. Closes #299 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename `backcheck_goal` to `backcheck_target_percent` so the local matches the BackcheckSettings field it feeds, and note in the changelog that targets saved under the old key are ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The target cannot persist because its save callback still activates the old session-state key.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes backcheck settings field mapping so duplicate handling and target percentages reach BackcheckSettings.
Changes:
- Uses the correct model field names.
- Persists the target under its model field name.
- Adds regression tests and changelog documentation.
| File | Description |
|---|---|
src/datasure/checks/backchecks/settings_ui.py |
Corrects settings mapping and persistence key. |
tests/checks/backchecks/test_settings_ui.py |
Tests non-default setting propagation. |
CHANGELOG.md |
Documents the fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
save_check_settings only writes when `backchecks_<key>` is set in session state. The key is now `backcheck_target_percent`, but the widget callback still set `backchecks_backcheck_goal`, so the target was never saved. Test the round trip through the real save guard instead of mocking the save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Pull Request Summary 🚀
What does this PR do? 📝
Makes the backcheck duplicate-handling option and target % chosen in the settings panel actually take effect. Closes #299.
Why is this change needed? 🤔
BackcheckSettingsignores unknown keywords, so both values fell back to their defaults:How was this implemented? 🛠️
backchecks_report_settings.backcheck_target_percentsoload_default_backchecks_settingsreloads it. Targets saved under the oldbackcheck_goalkey were never applied and are now ignored (noted in the CHANGELOG).backcheck_goallocal tobackcheck_target_percentso it matches the field it feeds.Not done:
extra="forbid"onBackcheckSettings(suggested in the issue). The model is also built from dicts that legitimately carry extra keys, so forbid would raise errors:string_case_option,enum_bcer_stats_view, …) merged inload_default_backchecks_settingsbackchecker_teamfromoutput_view_template.py, passed toBackcheckSettings(**config)inreport_ui.pyFollow-ups found during review (out of scope, planned in #318):
#318 (7 of 13 in the stack, after #300) redesigns the backcheck target metrics and covers all three:
checks/backchecks/readsbackcheck_target_percent. The value now arrives correctly but still has no visible effect. Backchecks: track progress against the backcheck target #318 adds on-track coverage against the target and progress towards the expected total.backcheck_target_percent=Nonefrom the page config raises aValidationErrorwhenBackcheckSettings(**config)builds the settings (the model field is a plainint). Backchecks: track progress against the backcheck target #318 makes the field accept "not set" and falls back to 10% with a warning.How to test or reproduce ? 🧪
uv run python -m pytest tests/checks/backchecks/test_settings_ui.py just testNew tests in
tests/checks/backchecks/test_settings_ui.py:test_report_settings_keeps_selected_duplicate_option'drop' == 'last'test_report_settings_keeps_selected_target_percent10 == 35test_render_tracking_options_saves_under_model_field_name{'backcheck_goal': 35}Full suite: 3511 passed, 6 skipped. Existing
test_compute.pytests already cover howfirst/last/dropchange the results.Manual: in a backchecks page, choose Keep Last Entry and set a non-default target. Duplicates are now kept rather than dropped, and the target persists after a reload.
Merge risk: low and easy to undo (revert the commits). It affects only the backcheck report: projects whose saved settings say
firstorlastwill now keep duplicate IDs instead of dropping them, which changes the backcheck counts users see.Screenshots (if applicable) 📷
N/A. The settings panel looks the same; only the values passed through it change.
Checklist ✅
Reviewer Emoji Legend
:code::smiley::+1::100:...and I want the author to know it! This is a way to highlight positive parts of a code review.
:star: :star: :star:And I am providing reasons why it needs to be addressed as well as suggested improvements.
:star: :star:And I am providing suggestions where it could be improved either in this PR or later.
:star:...and consider this a suggestion, not a requirement.
:question:This should be a fully formed question with sufficient information and context that requires a response.
:memo::pick:This does not require any changes and is often better left unsaid. This may include stylistic, formatting, or organization suggestions and should likely be prevented/enforced by linting if they really matter
:recycle:Should include enough context to be actionable and not be considered a nitpick.
🤖 Generated with Claude Code