-
Notifications
You must be signed in to change notification settings - Fork 40
feat: added --dry-run to wkg publish
#210
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
Changes from all commits
f11f411
b1fe7c6
dec04ff
5958120
d9698be
feba4ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ pub struct Config { | |
| impl Config { | ||
| /// Loads a configuration file from the given path. | ||
| pub async fn load_from_path(path: impl AsRef<Path>) -> Result<Config> { | ||
| tracing::info!(path = %path.as_ref().display(), "loading wkg config file"); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is unfortunate that the tracing deps has to be added for this line but it was particularly valuable to have visibility in what file actually gets resolved here. |
||
| let contents = tokio::fs::read_to_string(path) | ||
| .await | ||
| .context("unable to load config from file")?; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -530,7 +530,8 @@ impl<'a> DependencyResolver<'a> { | |||||||||||||
| } else { | ||||||||||||||
| let versions = | ||||||||||||||
| load_package(&mut self.packages, &self.client, dependency.package.clone()) | ||||||||||||||
| .await? | ||||||||||||||
| .await | ||||||||||||||
| .with_context(|| format!("package: {}", dependency.package.clone()))? | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like a dupe with the next line?
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought so too, but if you look, the next line is actually an option because wasm-pkg-tools/crates/wasm-pkg-core/src/resolver.rs Lines 601 to 605 in feba4ca
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah confusing! |
||||||||||||||
| .with_context(|| { | ||||||||||||||
| format!( | ||||||||||||||
| "package `{name}` was not found in component registry", | ||||||||||||||
|
|
||||||||||||||
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.
Totally fine if you don't want to make this change but for dry runs I've found it can be nice to model them as an error variant, e.g.
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.
I'm following
cargo publish --dry-runlogic as much as possible and they seem to throw an exit code of zero.I also use cargo publish dry runs as CI steps that would abort on exit code so this would cause issues if one wanted to check that a current commit/PR would be able to publish.
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.
Yeah you would catch the varient down-stack and exit 0. Anyway definitely not a blocker.