-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Git tags when packaging #841
Comments
I don't have much to add to this except 1) yes please, and 2) version_tag should not be prefixed with v; this is a left over from pre-2.0 of semver and no longer part of the spec. |
I don't think cargo should push. |
@steveklabnik how important is the push tag step? @bluss doesnt think it should push. I have auto tagging configurable via cargo config. Its not clear to me yet on how to push tags via libgit2-rs. Also should the config live in the cargo toml so its project wide? I thought Cargo.toml was loaded in the config object but my test say otherwise. https://github.com/rust-lang/cargo/compare/master...sbeckeriv:git-auto-tag-841?expand=1 let me know your thoughts/concerns/comments. |
Just thought I'd mention that I use an inverse workflow, I tag (with PGP signature) and use that as a trigger that the CI service should publish that commit to crates.io. I feel it comes closer to ensuring reproducible builds, the exact build steps taken (modulo the setup of the CI container) are specified in the If this auto-tagging is configurable that would ensure this workflow still works, I'm not sure if there's any other way that this could interact better/worse with it. |
Dearest reviewer, This is part of rust-lang#841 which is about the publishing and tagging flow. This pull request just prevents publishing with uncommitted or untracked files. I have included a flag for turning this off. There are two new test. More details about the full flow at rust-lang#2443 . I plan on doing more work on the flow, however, I felt this was useful enough to do stand alone. When I tried the flow before I was doing to much at once. Thanks! Becker [Updated] Moved from config to flag Using open_ext to sub crates Include the file names in error message include flag in error Move to discover off of open_ext formatting
Dearest reviewer, This is part of rust-lang#841 which is about the publishing and tagging flow. This pull request just prevents publishing with uncommitted or untracked files. I have included a flag for turning this off. There are two new test. More details about the full flow at rust-lang#2443 . I plan on doing more work on the flow, however, I felt this was useful enough to do stand alone. When I tried the flow before I was doing to much at once. Thanks! Becker [Updated] Moved from config to flag Using open_ext to sub crates Include the file names in error message include flag in error Move to discover off of open_ext formatting cut back on unwraps rework file check logic with a bail
Prevent packaging a crate if any files are dirty This commit alters Cargo's behavior to prevent publishing a crate by default if any files in that crate are determined to be dirty, that is either modified or not part of the working tree. This can prevent common mistakes like many listed in #2063 and enables features like #841. Closes #1597 Closes #2063
Automatic tagging and pushing to the repo do raise some design questions. A possibly simpler solution is to check that a tag exists before publishing. This should be done over here: cargo/src/cargo/ops/cargo_package.rs Line 174 in 541e990
That can be extended later with an opt-in ‘—tag’ flag later, and could probably be made a default after edition switch? Code for that should probably go either in that cargo_package.rs file, or here: cargo/src/cargo/ops/registry.rs Line 45 in 541e990
I don’t feel like adding taggging by default would work without opt-in at this moment, due to backwards compatibility requirements. |
This is available through https://github.com/sunng87/cargo-release. Are we still interested in this being in cargo proper? |
I very much am! I think being "standard" here is very helpful. |
We discussed this in the team meeting today in favor of closing this. While we understand the desire for releases to follow best-practices, like tagging, we felt this shouldn't belong in a more purpose-focused command like |
Inspired by rust-lang#841 and conversations at RustConf. At RustConf, someone was talking to me about the lack or inconsistent use of best practices within the crate ecosystem. We have a challenge of needing to help users get up and going who can't research every last decision while not over-encouraging the status quo, leading to stagnation. I do have a bias in this conversation as the maintainer of one of these tools which is why I decided to pick an ordering without judgement. I picked alphabetical ordering before sorting and realizing this puts my own crate first.
Inspired by rust-lang#841 and conversations at RustConf. At RustConf, someone was talking to me about the lack or inconsistent use of best practices within the crate ecosystem. We have a challenge of needing to help users get up and going who can't research every last decision while not over-encouraging the status quo, leading to stagnation. I do have a bias in this conversation as the maintainer of one of these tools which is why I decided to pick an ordering without judgement. I picked alphabetical ordering before sorting and realizing this puts my own crate first.
docs(ref): Establish publish best practices Inspired by #841 and conversations at RustConf. At RustConf, someone was talking to me about the lack or inconsistent use of best practices within the crate ecosystem. We have a challenge of needing to help users get up and going who can't research every last decision while not over-encouraging the status quo, leading to stagnation. The list of tools included was based on a mixture of - Download counts - Word of mouth exposure - Unique aspects covered - Maturity I do have a bias in this conversation as the maintainer of one of these tools which is why I decided to pick an ordering without judgement. I picked alphabetical ordering before sorting and realizing this puts my own crate first.
Bundler does some cool git stuff when publishing a package[1]. Conceptually, with
cargo
commands instead, and with error handling and rollback elided, it does this:(
version
is like1.2.3
andversion_tag
is likev1.2.3
)Having the tags automatically created at the same commit as was released, plus ensuring that what's on github/whatever is the same as what's on crates.io would be pretty great.
1: https://github.com/bundler/bundler/blob/master/lib/bundler/gem_helper.rb#L47-L50
The text was updated successfully, but these errors were encountered: