Skip to content

Move to TOML configuration for plugin configurations#1422

Merged
katiewasnothere merged 2 commits intoapple:mainfrom
noah-thor:toml-plugin-config
Apr 17, 2026
Merged

Move to TOML configuration for plugin configurations#1422
katiewasnothere merged 2 commits intoapple:mainfrom
noah-thor:toml-plugin-config

Conversation

@noah-thor
Copy link
Copy Markdown
Contributor

This change migrates plugin config format away from using JSON to use TOML.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Context within #1336

We're looking to improve the user experience and overall functionality of setting defaults for container to better enable future use cases.

Today container uses macOS's UserDefaults to configure settings needed at runtime. As mentioned in #608, UserDefaults may be idiomatic for macOS, but they apply globally to all sessions and do not handle representing complex, hierarchical data well. Additionally, we currently have two ways of setting these defaults, either directly with macOS's defaults command or through container system property.

#608 proposes moving to use environment variables in place of UserDefaults. However, we do not believe this is sufficient. Environment variables are not in a consistent location, are not sourced from data, and also do not handle representing complex, hierarchical data well.

As part of this migration to TOML for user settings we want to also move plugin settings to use TOML so that we can have a singular file format for container configurations.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@noah-thor noah-thor force-pushed the toml-plugin-config branch from 5089f59 to 2ebf148 Compare April 15, 2026 20:17
@katiewasnothere katiewasnothere self-requested a review April 15, 2026 21:11
Comment thread Sources/ContainerPlugin/PluginConfig.swift Outdated
@noah-thor noah-thor force-pushed the toml-plugin-config branch from 2ebf148 to 7163991 Compare April 15, 2026 22:42
Comment thread Sources/ContainerPlugin/PluginFactory.swift Outdated
Comment thread Sources/ContainerPlugin/PluginFactory.swift Outdated
return url
}
}
return nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe throw notFound instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It more or less conforms to the previous contract, in which create returns Plugin?. If we want to use ContainerizationError.notFound we will have to add Containerization as a dependency of ContainerPlugin.

This comment was marked as spam.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We'd only need to import ContainerizationError as a dependency, which is already used elsewhere in the same package

import ContainerizationError

@noah-thor noah-thor force-pushed the toml-plugin-config branch 2 times, most recently from c16916d to 7838f9d Compare April 16, 2026 17:21
This change migrates plugin config format away from using JSON to use TOML.
- Addresses the plugin portion of discussion apple#1336
@noah-thor noah-thor force-pushed the toml-plugin-config branch from 7838f9d to cf3d2b2 Compare April 16, 2026 19:37
Copy link
Copy Markdown
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

Small request but otherwise LGTM

@katiewasnothere katiewasnothere merged commit 9be1020 into apple:main Apr 17, 2026
3 checks passed
@noah-thor noah-thor deleted the toml-plugin-config branch April 21, 2026 22:53
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.

3 participants