Skip to content

Add setup flow primitives - #324

Merged
marcelveldt merged 2 commits into
mainfrom
setup-flow-primitives
Jul 23, 2026
Merged

marcelveldt merged 2 commits into
mainfrom
setup-flow-primitives

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

Groundwork for the new interactive setup flows: splitting provider/player setup (credentials, OAuth, pairing) from the regular config options. Purely additive, so the current server release keeps working against this package.

  • New SetupFlowStep model + FlowStepType enum: the typed steps (form / external / progress / finish / abort) a running setup flow serves to clients, with server-side translation resolution
  • New ConfigEntryType.IMAGE: presentational image (data-URI) inside forms, e.g. pairing QR codes or illustrations
  • New SETUP_FLOW_UPDATED event to push flow step updates to clients
  • New setup_data on ProviderConfig/PlayerConfig: storage for values collected by setup flows — persisted, but never exposed over the API

@marcelveldt marcelveldt added the new-feature This implements a complete new feature label Jul 23, 2026
@marcelveldt
marcelveldt requested a review from Copilot July 23, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds foundational model-layer primitives to support interactive provider/player setup flows (forms, OAuth/external steps, progress, finish/abort), plus supporting config schema extensions and tests, while keeping existing consumers working.

Changes:

  • Introduces SetupFlowStep (with translation-aware serialization) and FlowStepType for typed setup-flow steps.
  • Adds ConfigEntryType.IMAGE as a UI-only/presentational entry type.
  • Adds persisted-but-API-hidden setup_data to ProviderConfig and PlayerConfig, plus a new SETUP_FLOW_UPDATED event type.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_setup_flow.py Adds coverage for SetupFlowStep shapes and translation resolution behavior.
tests/test_config_entries.py Adds coverage for IMAGE entries and setup_data persistence vs API exposure.
music_assistant_models/setup_flow.py Implements SetupFlowStep model and translation-aware to_dict() output.
music_assistant_models/enums.py Adds FlowStepType, ConfigEntryType.IMAGE, and EventType.SETUP_FLOW_UPDATED.
music_assistant_models/config_entries.py Wires up IMAGE as UI-only and adds setup_data handling to provider/player configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread music_assistant_models/setup_flow.py Resolved
@marcelveldt
marcelveldt merged commit 2077e20 into main Jul 23, 2026
3 checks passed
@marcelveldt
marcelveldt deleted the setup-flow-primitives branch July 23, 2026 22:45
github-actions Bot pushed a commit to music-assistant/server that referenced this pull request Jul 23, 2026
Update music-assistant-models to version
[1.1.169](https://github.com/music-assistant/models/releases/tag/1.1.169)


- Add setup flow primitives (by @marcelveldt in
[#324](music-assistant/models#324))

## 🚀 Features and enhancements

- Add ConvolutionFilter and High/Low DSP filter types (by @OzGav in
[#319](music-assistant/models#319))


## 🙇 Contributors

@marcelveldt, @OzGav and @claude

Co-authored-by: marcelveldt <[email protected]>
marcelveldt added a commit to music-assistant/server that referenced this pull request Jul 24, 2026
# What does this implement/fix?

Groundwork for the new interactive setup flows: a server-driven flow
engine that replaces the action-based config-entry workarounds for
provider/player setup (credentials, OAuth, pairing) — with a clear begin
and end, multiple steps, progress and proper cancellation. Purely
additive: nothing changes yet for existing providers or clients.

- New `SetupSession`: a provider authors its setup as one plain
coroutine (`run_setup(session)` in `providers/<domain>/setup_flow.py`)
using awaitable `form()` / `external()` / `progress_until()` steps,
optional step deadlines and clean abort/cleanup semantics
- New api commands: `config/providers/setup`,
`config/providers/reconfigure` (also covers re-authentication) and
`config/players/setup`, plus `config/flows/submit|get|abort`; step
changes are pushed via the new `SETUP_FLOW_UPDATED` event
- Providers that need no setup input are created immediately, so the
add-provider path is uniform for all providers
- Values collected by flows land in the new `setup_data` config section:
encrypted at rest and never exposed over the API
- Options saves no longer drop stored values that have no config entry
(ports the player-config preservation guard to provider configs)

**Related:** music-assistant/models#324 (shipped in models 1.1.169)

## Types of changes

- [ ] Bugfix (non-breaking change which fixes an issue) — `bugfix`
- [x] New feature (non-breaking change which adds functionality) —
`new-feature`
- [ ] Enhancement to an existing feature — `enhancement`
- [ ] New music/player/metadata/plugin provider — `new-provider`
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected) — `breaking-change`
- [ ] Refactor (no behaviour change) — `refactor`
- [ ] Documentation only — `documentation`
- [ ] Maintenance / chore — `maintenance`
- [ ] CI / workflow change — `ci`
- [ ] Dependencies bump — `dependencies`

## Checklist

- [x] The code change is tested and works locally.
- [x] `pre-commit run --all-files` passes.
- [x] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
- [x] For changes to shared models, the companion PR in
`music-assistant/models` is linked.
- [ ] For changes affecting the UI, the companion PR in
`music-assistant/frontend` is linked.
- [x] I have read and complied with the project's [AI
Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md)
for any AI-assisted contributions.
- [ ] I have raised a PR against the documentation repository targeting
the main or beta branch as appropriate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature This implements a complete new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants