Merged
Conversation
We need to merge the data we have, not replace it. Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
We had been using lists for these types, but really that should be hashes. Fix the data type, which simplifies and clarifies quite a bit. Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Change external query string parameters from 'overridden' and 'automated' to 'overridden_fields_list' and 'automated_fields_list' to clarify that these are comma-separated lists of field names, not the full field data. This distinguishes them from the internal @overridden_fields and @automated_fields instance variables (which contain hashes with full metadata) and reduces risk of naming conflicts with future criteria names. Changes: - Update params[:overridden] to params[:overridden_fields_list] - Update params[:automated] to params[:automated_fields_list] - Update redirect URLs to use new parameter names - Add tests verifying automated_fields_list highlights fields with robot icon - Add tests verifying overridden_fields_list parameter works correctly Co-authored-by: David A. Wheeler <dwheeler@dwheeler.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Extract merge logic into a dedicated merge_field_lists method that
explicitly handles merging URL parameter field lists (with empty {}
values) with existing field data (which may have rich metadata like
old_value, new_value, and explanation).
The method ensures that:
- Rich metadata from automation always takes priority
- URL params can add new fields for highlighting
- Empty existing_fields returns just the URL fields
- Empty URL params returns existing fields unchanged
This makes the merge intent clearer and prevents accidental loss of
metadata when combining field lists from different sources.
Changes:
- Add merge_field_lists helper method with clear documentation
- Replace inline merge with call to new helper
- Add comprehensive tests for all merge scenarios:
* Preserving rich metadata from existing fields
* Adding new fields from URL params
* Handling nil existing fields
* Handling empty URL params
Co-authored-by: David A. Wheeler <dwheeler@dwheeler.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Update test expectation from 'automated=' to 'automated_fields_list=' to match the renamed query parameter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Update test assertions and comments to use the new parameter names: - automated= -> automated_fields_list= - overridden= -> overridden_fields_list= This fixes the failing UsersManipulateProjectTest test and updates a comment in ProjectsControllerTest. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Collaborator
Author
|
Improve/clarify automation. In particular, the fields we use to identify highlighted/overridden fields need clearly different names from the automation proposals. |
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.
No description provided.