Skip to content

Automation more#2705

Merged
david-a-wheeler merged 7 commits intomainfrom
automation_more
Feb 15, 2026
Merged

Automation more#2705
david-a-wheeler merged 7 commits intomainfrom
automation_more

Conversation

@david-a-wheeler
Copy link
Collaborator

No description provided.

david-a-wheeler and others added 7 commits February 14, 2026 22:53
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>
@david-a-wheeler
Copy link
Collaborator Author

Improve/clarify automation.

In particular, the fields we use to identify highlighted/overridden fields need clearly different names from the automation proposals.

@david-a-wheeler david-a-wheeler merged commit b601290 into main Feb 15, 2026
8 checks passed
@david-a-wheeler david-a-wheeler deleted the automation_more branch February 15, 2026 16:55
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.

1 participant