Skip to content

CI version bump check can get confused when PR is behind master #12692

@ehuss

Description

@ehuss

The check-version-bump check generates an error in the following case:

  1. Contributor creates a branch.
  2. Some PR merges that modifies a crate, for example bumping cargo-credential's version number.
  3. Contributor submits their PR, where its base is before step 2 is merged.

This causes an error like:

   BumpCheck base commit `819fa73b2dd86e32bf01a7317aec0fa0a447c871`
   BumpCheck head commit `c9262bd58021cd3bcca101f68bc3a9efbb57cb70`
   BumpCheck compare against `crates-io`
    Updating crates.io index
   BumpCheck compare against `9c4383fb55986096b414d98125421ab87b5fd642`
error: Detected changes in these crates but no version bump found:
  cargo-credential@0.4.0
  cargo-credential-1password@0.4.0

I think the issue is that the diff is not using a "symmetric difference" between base and head. In the example above, base is the latest master (with the changes to cargo-credential) and head is the tip of my branch (which is missing those changes). The check is doing the equivalent of git diff 819fa73b2dd86e32bf01a7317aec0fa0a447c871 c9262bd58021cd3bcca101f68bc3a9efbb57cb70, which pulls in all changes that have happened on master since the branch was created. I think a solution is to use a symmetric diff (with git's ... syntax), but AFAIK libgit2 does not support that. So I'm not sure how to solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-infrastructureArea: infrastructure around the cargo repo, ci, releases, etc.E-easyExperience: EasyS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions