-
Notifications
You must be signed in to change notification settings - Fork 78
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
[WIP] Implement config v0 -> v1 migration. #1653
base: main
Are you sure you want to change the base?
Conversation
ce26547
to
9a7d939
Compare
This is currently based off #1661. When that gets merged, I'll rebase off |
9a7d939
to
8670bcb
Compare
bd40eca
to
101bc69
Compare
The various TODO:
|
We were discussing This is the interactive portion of Unlike most of the rest of Because this code is working from and generating a For each bit of user-selectable config, we use the dialoguer crate to prompt the user for their input unless the user passed the |
4f99c57
to
9f39ac6
Compare
It's perfectly valid for package config to be missing; rather than an error case, this just indicates that there's no package-specific config. The previous rendition of the config code handled this by initializing the config to a default value if not specified.
…ommonInstallerLayer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment on the as-yet incomplete items in init.rs
, just to track them, along with a couple of things to keep an eye on testing.
Aside from the remaining init.rs
changes, I think the only other remaining work is in the tests. All of our tests are written in the old config format, and are specifically using Cargo.toml
, so they need to be updated to use dist-workspace.toml
in the new config format in order to pass.
// FIXME: when there is more than one option this should be a proper | ||
// multiselect like the installer selector is! For now we do | ||
// most of the multi-select logic and then just give a prompt. | ||
let known = &[CiStyle::Github]; | ||
/*let known = &[CiStyle::Github]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section with the complex "known styles" logic either needs to be uncommented out or deleted. Since we currently don't have any non-GitHub CI options, deletion seems reasonable at this point.
// Enable installer backends (if they have a CI backend that can provide URLs) | ||
// FIXME: "vendored" installers like msi could be enabled without any CI... | ||
let has_ci = meta.ci.as_ref().map(|ci| !ci.is_empty()).unwrap_or(false); | ||
//let has_ci = meta.ci.as_ref().map(|ci| !ci.is_empty()).unwrap_or(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to clear up whether this commented-out version can simply be deleted or not, given the version below.
@@ -733,37 +773,40 @@ fn get_new_dist_metadata( | |||
InstallerStyle::Npm, | |||
InstallerStyle::Homebrew, | |||
InstallerStyle::Msi, | |||
// Pkg intentionally left out because it's currently opt-in only. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to be added in #1381, but it needs to be rewritten in the style of this new code.
Ok(meta) | ||
} | ||
|
||
/// Update a workspace toml-edit document with the current DistMetadata value | ||
pub(crate) fn apply_dist_to_workspace_toml( | ||
workspace_toml: &mut toml_edit::DocumentMut, | ||
workspace_kind: WorkspaceKind, | ||
meta: &DistMetadata, | ||
_workspace_kind: WorkspaceKind, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably remove this param entirely now!
} = &meta; | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section needs to be uncommented and reimplemented for the new structure.
|
||
apply_installers_common(npm_table, &npm.common); | ||
|
||
// TODO: similar to shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl missing here.
|
||
apply_installers_common(powershell_table, &powershell.common); | ||
|
||
// TODO: similar to shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl missing here.
|
||
apply_installers_common(shell_table, &shell.common); | ||
|
||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl missing here.
|
||
apply_optional_value( | ||
pkg_table, | ||
"install_location", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: this one is still kebab-case.
"install_location", | |
"install-location", |
panic!("Expected [dist.publishers] to be a table"); | ||
}; | ||
|
||
// ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl missing here.
Required functionality for this PR:
dist migrate
move v0 to v1do_migrate_from_v0()
actually copy workspace members to the new configuration.dist init
use v1dist init
load v1dist plan
(and other commands) gives an actionable error for v0 configsCurrent state (2025-01-10):