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

Add --dry-run to cargo publish #2849

Merged
merged 1 commit into from
Jul 18, 2016
Merged

Add --dry-run to cargo publish #2849

merged 1 commit into from
Jul 18, 2016

Conversation

wezm
Copy link
Member

@wezm wezm commented Jul 11, 2016

This PR picks up where @JustAPerson left off in #1699. I've updated their changes to apply to current master and added tests, including (I think) a test that checks that the upload doesn't actually occur.

The output is as it was before:

output

Closes #1332

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

if !opts.verify && opts.dry_run {
bail!("cannot specify both no verify and dry run \
simultaneously");
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you clarify on what we're preventing with this check? I could imagine --dry-run also being done to check the *.crate manually without actually performing a build being a use case

Copy link
Member Author

Choose a reason for hiding this comment

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

It was in the original PR. My guess is that it's not a full dry run if the verification step isn't run. Combining --no-verify and --dry-run works fine with the guard removed so I can remove it if you like.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah thinking back I think this should be ok to remove

@alexcrichton
Copy link
Member

Thanks @wezm! Looks great to me!

cc @rust-lang/tools, other thoughts?

@brson
Copy link
Contributor

brson commented Jul 11, 2016

Just from looking at the screenshot, "warning: Aborting" should not be capitalized.

@nrc
Copy link
Member

nrc commented Jul 11, 2016

Just from looking at the screenshot, "warning: Aborting" should not be capitalized.

Should it be a warning at all? Seems like expected behaviour

@@ -28,6 +29,7 @@ Options:
--no-verify Don't verify package tarball before publish
--allow-dirty Allow publishing with a dirty source directory
--manifest-path PATH Path to the manifest of the package to publish
--dry-run Performs all checks without uploading
Copy link
Member

Choose a reason for hiding this comment

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

nit: Perform, not Performs

@wezm
Copy link
Member Author

wezm commented Jul 11, 2016

Just from looking at the screenshot, "warning: Aborting" should not be capitalized.

Should it be a warning at all? Seems like expected behaviour

I wondered about that. Perhaps the Uploading step could looks follows when it's a dry run:

Uploading tmp v0.1.0 (file:///Users/wmoore/Source/cargo/tmp) -- dry run

Although that would be fairly easy to miss.

@alexcrichton
Copy link
Member

I vaguely remember that s3cmd'd --dry-run option prints out warning, so it doesn't seem all that too out of the ordinary for me

@wezm
Copy link
Member Author

wezm commented Jul 12, 2016

Ok folks what do you need from me to get this over the line?

@bors
Copy link
Collaborator

bors commented Jul 13, 2016

☔ The latest upstream changes (presumably #2867) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton
Copy link
Member

Let's take out the extra check and leave the UI as-is for now, we can always tweak later and it's unfortunately not easy right now to have something vastly different than this.

@wezm
Copy link
Member Author

wezm commented Jul 15, 2016

Ok

  • updated to apply cleanly to current master
  • remove mutual exclusion of --no-verify and --dry-run

Should be good to go.

@alexcrichton
Copy link
Member

Thanks! Could you also squash the commits as well? Other than that looks good to go to me.

Squashed commit of the following:

commit deed1d7b99c1cd142f7782d3b3b782d949e1f71f
Author: Wesley Moore <[email protected]>
Date:   Fri Jul 15 13:35:01 2016 +1000

    Remove --dry-run and --no-verify mutual exclusion

commit 8a91fcf2a1aa3ba682fee67bb5b3e7c2c2cce8ef
Merge: 0c0d057 970535d
Author: Wesley Moore <[email protected]>
Date:   Fri Jul 15 13:30:38 2016 +1000

    Merge remote-tracking branch 'upstream/master' into publish_dry_run

commit 0c0d0572533599b3c0e42797a6014edf480f1dc2
Author: Wesley Moore <[email protected]>
Date:   Tue Jul 12 08:03:15 2016 +1000

    Improve grammar in --dry-run option

commit a17c1bf6f41f016cafdcb8cfc58ccbe34d54fbb8
Author: Wesley Moore <[email protected]>
Date:   Mon Jul 11 14:17:41 2016 +1000

    Add test for passing no-verify and dry-run to publish

commit 284810cca5df3268596f18700c0247de2f621c98
Author: Wesley Moore <[email protected]>
Date:   Mon Jul 11 14:51:38 2016 +1000

    Add test for publish --dry-run

commit 8514e47fbce61c20b227815887a377c25d17d004
Merge: 2b061c5 ef07b81
Author: Wesley Moore <[email protected]>
Date:   Mon Jul 11 08:27:10 2016 +1000

    Merge branch 'publish_dry_run' of github.com:JustAPerson/cargo into publish_dry_run

commit ef07b81
Author: Jason Priest <[email protected]>
Date:   Tue Jun 9 23:11:51 2015 -0500

    Improve publish `--dry-run`

    Catch a few more errors by aborting midway through transmit().

commit 0686fb0
Author: Jason Priest <[email protected]>
Date:   Tue Jun 9 14:38:58 2015 -0500

    Teach publish the `--dry-run` flag

    Closes rust-lang#1332
@wezm
Copy link
Member Author

wezm commented Jul 17, 2016

All squashed now

@alexcrichton
Copy link
Member

@bors: r+ c05a5b4

Thanks!

@alexcrichton alexcrichton added the relnotes Release-note worthy label Jul 18, 2016
@bors
Copy link
Collaborator

bors commented Jul 18, 2016

⌛ Testing commit c05a5b4 with merge f2cf284...

bors added a commit that referenced this pull request Jul 18, 2016
Add --dry-run to cargo publish

This PR picks up where @JustAPerson left off in #1699. I've updated their changes to apply to current master and added tests, including (I think) a test that checks that the upload doesn't actually occur.

The output is as it was before:

![output](https://cloud.githubusercontent.com/assets/21787/16720362/f7ea710e-4778-11e6-8163-65f3978bb7ae.png)

Closes #1332
@bors
Copy link
Collaborator

bors commented Jul 18, 2016

☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64
Approved by: alexcrichton
Pushing f2cf284 to master...

@bors bors merged commit c05a5b4 into rust-lang:master Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Release-note worthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants