ayon-backend icon indicating copy to clipboard operation
ayon-backend copied to clipboard

Settings: Preserve overrides when copying settings

Open martastain opened this issue 9 months ago • 0 comments

Story

When settings are copied from a different addon version, settings are processed en-bloc instead of overrides only. That prevents the copy settings dialog from displaying a pinned value if it matches the target model default value.

To reproduce

Steps to reproduce the behavior:

  1. Pin a default value in staging
  2. Open the copy settings dialog to copy settings from staging to production
  3. Pinned value won't show

Expected behavior

  • A pinned value should be displayed in the settings copy dialog.
  • An option to mark the value as pinned should be added directly to the settings update payload

Environment

  • Server version: 1.1.0

Additional context

The main caveat is the editor step - the settings editor does not send information about what fields are overridden to the server. Instead, it sends the complete settings and the override level is determined server side.

The first step has to be to return overrides only from the convert_settings function, that way, we'll know which fields have overrides.

Copy settings dialog MAY skip the editing step and copy overrides directly to the target, which would preserve pinned overrides, but in order to maintain the "push to editor" step, we need a way to send explicit overrides to the server.

Actionable steps

  • [x] https://github.com/ynput/ayon-backend/pull/178
  • [x] Copy setting dialogs must not compare values :heavy_check_mark:
  • [x] https://github.com/ynput/ayon-frontend/pull/403
  • [x] Backend must accept additional metadata in the payload (something like __pinned_paths__ = list[list[str]])

martastain avatar May 09 '24 17:05 martastain