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

fix(hex/mix): stop suffixing versions with == by default #32539

Closed

Conversation

kivra-pauoli
Copy link
Contributor

@kivra-pauoli kivra-pauoli commented Nov 14, 2024

Changes

Semantic versions (not ranges) in mix.exs files stop getting suffixed with == , by default.

Context

0c06a23#diff-5050def58eaa9d548349c16252d28f932eb05401d5981e867392517f18c18847R80 introduced == as an always-present suffix to hex versions (Hex and Git alike). The problem that comes with this (up until now we'd been updating our PRs "by hand") is that e.g. a dependency like {:k_lib, git: "[email protected]:k/k_lib.git", tag: "v0.0.1"} gets updated to {:k_lib, git: "[email protected]:k/k_lib.git", tag: "== v0.0.2"} which is not valid Mix syntax.

I was looking at the code and trying to do this optionally but I can't seem to find (does it exist?) a proper option... if I could pass something from mix to hex then I could use that to optionally add the == , keeping previous behaviour but allowing for the bug fix.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@kivra-pauoli kivra-pauoli changed the title hex/mix: stop suffixing versions with == by default fix: hex/mix: stop suffixing versions with == by default Nov 14, 2024
@kivra-pauoli kivra-pauoli changed the title fix: hex/mix: stop suffixing versions with == by default fix(hex/mix): stop suffixing versions with == by default Nov 14, 2024
@kivra-pauoli
Copy link
Contributor Author

We could also do

    if (currentValue.startsWith("== ") && npm.isVersion(newSemver)) {
      newSemver = `== ${newSemver}`;
    }

or similar, where the == would only be added if it was there in the first place, which would also be less surprising.

@rarkins rarkins added the auto:discussion-first This PR needs to be preceded by a GitHub Discussion label Nov 14, 2024
Copy link
Contributor

Please create a GitHub Discussion before continuing with this PR.

Thank you for your PR, but we need to discuss the requirements and implementation first.

The maintainers believe that there is a lack of - or misalignment of - requirements about this PR. We need to discuss the requirements and implementation first so that you don't write code that won't be merged.

This PR will be closed for now to avoid confusion, but you can reopen it after the discussion has been resolved.

Thanks, the Renovate team

@github-actions github-actions bot closed this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:discussion-first This PR needs to be preceded by a GitHub Discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants