Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config versioning #128

Closed
chicoxyzzy opened this issue Jan 30, 2023 · 0 comments
Closed

Config versioning #128

chicoxyzzy opened this issue Jan 30, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request P2 Low priority

Comments

@chicoxyzzy
Copy link
Member

chicoxyzzy commented Jan 30, 2023

We can add versioning to the config, so when people update the version of ssc and run it, we can know the version of config.ini is not compatible with the version of ssc and throw a readable error and maybe even provide an update script.

I think we can add an ungrouped field like this:

[config]
revision: 20220130

[build]
# ...

[meta]
# ...

Then,

  • if ssc wants a newer version of config, we print something like Current version of config is outdated and not compatible with your version of 'ssc'
  • if ssc version is too old, we print Current version of config is newer than installed 'ssc' can use. Please update your version of 'ssc'.

Automatic updates

We can add something like ssc config update to automatically update the config version

"Migrations" should provide the change for every field in such manner

// from non-versioned to 20220130

// [] build -> [build] script; identity
// [] env -> [build] env; identity
// [] executable -> x
// [] flags -> [build] flags; identity
// [] headless -> [build] headless; identity
// [] name -> [build] name; identity
// [] input -> [build] input; identity
// [] output -> [build] output; identity
// [] bundle_identifier -> [meta] bundle_identifier; identity
// [] copyright -> [meta] copyright; identity
// [] description -> [meta] description; identity
// [] file_limit -> [meta] file_limit; identity
// [] lang -> [meta] lang; identity
// [] maintainer -> [meta] maintainer; identity
// [] title -> [meta] title; identity
// [] version -> [meta] version; identity

Left value is a current value which we should move or delete
Right value is a new field and optional mapping function when we need to change a value (the mapping function isstd::identity by default)

This way we can create a chain of transformations for each config field for any old version to the latest version

Comments above reflect the recent changes made in #124

@chicoxyzzy chicoxyzzy added the enhancement New feature or request label Jan 30, 2023
@lamiazar lamiazar added the P1 High priority label Aug 21, 2023
@chicoxyzzy chicoxyzzy added P2 Low priority and removed P1 High priority labels Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 Low priority
Projects
None yet
Development

No branches or pull requests

2 participants