apple / apple/container

[Request]: Use environment variables as system property source instead of UserDefaults.

Open
#608 0 comments 0 reactions 1 assignee Claimed by @katiewasnothere View on GitHub
help wanted next ux
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### Feature or enhancement request details

While UserDefaults are idiomatic for macOS, they apply globally to all sessions, and in some cases session-level control of a property may be desirable.

Environment variables are idiomatic for Unix/Linux developer tools and can apply globally (rc/profile files) and per session.

For this reason we should consider replacing UserDefaults with environment variables. While we could include both as property sources, it results in needless complexity and could create confusing scenarios.

We'd need to look at the variables we have and see which could be problematic if changed per session. Some variables are used only in helpers so the values they use would be established when the helper starts and immutable afterward (whereas a UserDefault could be updated while a helper runs).

It'd be great to get some opinions on this before proceeding. I was thinking that ideally we'd have a system for defining system properties, where each property is enumerable, generic, validated, type-safe, and defines a chain of command for its backing store.

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.