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

Publish after all local/remote source changes #103

Closed
ryankurte opened this issue Apr 10, 2019 · 6 comments
Closed

Publish after all local/remote source changes #103

ryankurte opened this issue Apr 10, 2019 · 6 comments

Comments

@ryankurte
Copy link

hi hi,

thanks for making such a useful crate!

i think the order in which things are published is incorrect, leading to less than ideal package states on failure (as i discovered here.

for example, running cargo release with a protected master branch results in:

  • the cargo.toml version being bumped (success)
  • the changes being committed locally (success)
  • the cargo package being pushed to crates.io (success)
  • the repository being pushed to master (failure)

leaving the project with a published version on crates.io, without the matching source code.

i propose that the ordering be changed to:

  • bump cargo.toml version
  • commit local changes
  • tag local changes
  • push changes to remote
  • push tag to remote
  • publish to crates.io

so that if any of the source-related stages fail, the crate will not be published to crates.io.

@epage
Copy link
Collaborator

epage commented Apr 10, 2019

I've actually had the opposite experience with my manual releases and I've been looking forward to cargo-release's order (haven't switched yet; working on the features I need).

My problem is there have been times where my cargo publish has failed (particularly when first creating a crate) but I've already pushed my commits/tags so I update the version number again with my changes and try again.

So ideally we find a way to satisfy both use cases.

@epage
Copy link
Collaborator

epage commented Apr 10, 2019

for example, running cargo release with a protected master branch results in:

How protective is your master? The most basic is no force-push but I'm assuming there is more here, like no pushing at all.

Are you manually pushing to a branch to then create a PR? How do you propagate tags?

I'm wondering

  • if other features might be needed for this case. For example, we support customizing the remote but not the branch.
  • If there are ways to improve my workflow because I currently push directly to upstream/master because that is the only way I know of to get tags handled.

@ryankurte
Copy link
Author

ooh, interesting~!

our usual release process uses bors, so you create a release branch with the cargo version update, merge that, then publish from master (and tag anywhere along the way).

which, thinking about more, it, may be too specific of a use case for this to work perfectly / maybe is better managed manually...

@epage
Copy link
Collaborator

epage commented Apr 10, 2019

cargo-release can still help in automating your process. You can disable publish and still rely on cargo-release to bump the version, run regexes, create the commit, etc.

And like I said, it might be reasonable to support changing what branch we push to, making it so you don't need to disable the push feature of cargo-release.

@epage
Copy link
Collaborator

epage commented Apr 27, 2019

@sunng87 from #101

The default behaviour is for the case that when release failed, for example, an error on cargo publish, the version is already bumped and we have a way to rerun cargo-release. Otherwise, it makes more sense to use patch by default.

To fix the rerun issue, also mentioned in #103 , I am going to add a transaction log file like maven release, so we can always rerun the failed process.

I find it odd that the default behavior is for resuming. In my mind, that should be explicit, with maybe calling the option resume with patch being the default.

EDIT: A transaction log seems like it could also be brittle (had problems in other tools with similar files). If maven makes it work, then maybe I'm overly concerned.

@epage epage changed the title Incorrect publish ordering (?) Pub Aug 12, 2021
@epage epage changed the title Pub Publish after all local/remote source changes Aug 12, 2021
@epage
Copy link
Collaborator

epage commented Oct 14, 2022

For this request for its own sake, I'm going to reject this.

For bors workflows, I'm closing in favor of issues like #119 and #528 to further discuss it

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants