Skip to content

Let config actions mark themselves as destructive - #504

Merged
marcelveldt merged 1 commit into
mainfrom
destructive-config-action
Dec 2, 2026
Merged

marcelveldt merged 1 commit into
mainfrom
destructive-config-action

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

What does this implement/fix?

Some config actions wipe data the user cannot get back (for example "Reset library database"), yet a client cannot tell them apart from harmless ones, so they run on a single click. This adds a flag so clients can ask for confirmation first.

  • New destructive field on ConfigEntry (default False)
  • Round-trip test

Related issue (if applicable):

  • frontend companion: confirmation dialog and destructive style for these buttons (PR follows); the server sets the flag on reset_db after the next models release

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • 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

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • Any consumer of a changed model is updated, and the companion PR in music-assistant/server is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.

@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley review

@github-actions github-actions Bot added the maintenance Code readability, documentation or other change to maintain the codebase label Dec 2, 2026

@Bot-MArley Bot-MArley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note

This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.

Thanks @marcelveldt! This adds a destructive flag (default False) to ConfigEntry, plus a round-trip test, so clients can ask for confirmation before running actions like "Reset library database".

It looks good: the field is handled like advanced and requires_reload, nothing else in the models lists the fields one by one, and an older client simply ignores the new key. No changes requested.

One small thing, not blocking: the PR body ticks "Maintenance / chore", but a new client-facing field fits "New feature" or "Enhancement" better, since that box drives the label and the release notes.

It's still a draft, so it's waiting for you to mark it ready for review, and then for a maintainer to merge.

@marcelveldt
marcelveldt marked this pull request as ready for review December 2, 2026 08:44
@marcelveldt
marcelveldt merged commit d3f7690 into main Dec 2, 2026
11 checks passed
@marcelveldt
marcelveldt deleted the destructive-config-action branch December 2, 2026 08:44
n-gras pushed a commit to n-gras/server that referenced this pull request Dec 2, 2026
Update music-assistant-models to version
[1.1.257](https://github.com/music-assistant/models/releases/tag/1.1.257)


## 🚀 Features and enhancements

- Tell clients whether crossfade can be switched on for a queue (by
@marcelveldt in
[music-assistant#506](music-assistant/models#506))

## 🧰 Maintenance and dependency bumps

- Document the multiline format of a string config entry (by
@marcelveldt in
[music-assistant#505](music-assistant/models#505))
- Let config actions mark themselves as destructive (by @marcelveldt in
[music-assistant#504](music-assistant/models#504))


## 🙇 Contributors

@marcelveldt

Co-authored-by: musicassistant-bot[bot] <304008617+musicassistant-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Code readability, documentation or other change to maintain the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants