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

Using rez versioning regex in renovate #1110

Closed
viceice opened this issue Jul 29, 2021 · 7 comments
Closed

Using rez versioning regex in renovate #1110

viceice opened this issue Jul 29, 2021 · 7 comments

Comments

@viceice
Copy link

viceice commented Jul 29, 2021

Hi, I'm a maintainer of the renovate bot and we have a community contribution at renovatebot/renovate#10930 to integrate your rez versioning scheme.

For this we need some parts of your versioning regexes. Are we allowed to do so?

@nerdvegas
Copy link
Contributor

Hey,

I certainly don't mind personally, but I suppose it's a matter of determining what you're able to do given both our licenses (GNU GPL3 for me, GNU AGPL3 for you).

It looks like you're ok though: https://en.wikipedia.org/wiki/Affero_General_Public_License#Compatibility_with_the_GPL

If all you need to do is grab some regexes, I would just do that, and include a comment linking to the rez project.

Cheers
Allan

@viceice
Copy link
Author

viceice commented Jul 30, 2021

Thanks for info

@viceice viceice closed this as completed Jul 30, 2021
@skral
Copy link
Contributor

skral commented Aug 2, 2021

Hi @nerdvegas,

Long time no see. Hope you're well.

Opening this issue again. After some discussion on the PR using the regular expressions, the consensus is that copying the code with a simple comment won't be good enough to be license compatible, unfortunately. Ideally the original author of the regular expressions, you, can provide a license to use them. Creating a simple PR with the regular expressions and signing the CLA will do exactly that.

Any possibility you are willing to help us out here some more and commit that PR (non-functional) with just the regular expressions and sign the CLA for the renovate bot project? That way we can get renovate to understand rez versioning right away.

I am including steps to help make this as easy as possible:

  1. Fork renovate bot
  2. Create lib/versioning/rez/index.ts
  3. Include the following text:
    version_range_regex = (
        # Match a version number (e.g. 1.0.0)
        r"   ^(?P<version>{version_group})$"
        "|"
        # Or match an exact version number (e.g. ==1.0.0)
        "    ^(?P<exact_version>"
        "        =="  # Required == operator
        "        (?P<exact_version_group>{version_group})?"
        "    )$"
        "|"
        # Or match an inclusive bound (e.g. 1.0.0..2.0.0)
        "    ^(?P<inclusive_bound>"
        "        (?P<inclusive_lower_version>{version_group})?"
        "        \.\."  # Required .. operator
        "        (?P<inclusive_upper_version>{version_group})?"
        "    )$"
        "|"
        # Or match a lower bound (e.g. 1.0.0+)
        "    ^(?P<lower_bound>"
        "        (?P<lower_bound_prefix>>|>=)?"  # Bound is exclusive?
        "        (?P<lower_version>{version_group})?"
        "        (?(lower_bound_prefix)|\+)"  # + only if bound is not exclusive
        "    )$"
        "|"
        # Or match an upper bound (e.g. <=1.0.0)
        "    ^(?P<upper_bound>"
        "        (?P<upper_bound_prefix><(?={version_group})|<=)?"  # Bound is exclusive?
        "        (?P<upper_version>{version_group})?"
        "    )$"
        "|"
        # Or match a range in ascending order (e.g. 1.0.0+<2.0.0)
        "    ^(?P<range_asc>"
        "        (?P<range_lower_asc>"
        "           (?P<range_lower_asc_prefix>>|>=)?"  # Lower bound is exclusive?
        "           (?P<range_lower_asc_version>{version_group})?"
        "           (?(range_lower_asc_prefix)|\+)?"  # + only if lower bound is not exclusive
        "       )(?P<range_upper_asc>"
        "           (?(range_lower_asc_version),?|)"  # , only if lower bound is found
        "           (?P<range_upper_asc_prefix><(?={version_group})|<=)"  # <= only if followed by a version group
        "           (?P<range_upper_asc_version>{version_group})?"
        "       )"
        "    )$"
        "|"
        # Or match a range in descending order (e.g. <=2.0.0,1.0.0+)
        "    ^(?P<range_desc>"
        "        (?P<range_upper_desc>"
        "           (?P<range_upper_desc_prefix><|<=)?"  # Upper bound is exclusive?
        "           (?P<range_upper_desc_version>{version_group})?"
        "           (?(range_upper_desc_prefix)|\+)?"  # + only if upper bound is not exclusive
        "       )(?P<range_lower_desc>"
        "           (?(range_upper_desc_version),|)"  # Comma is not optional because we don't want to recognize something like "<4>3"
        "           (?P<range_lower_desc_prefix><(?={version_group})|>=?)"  # >= or > only if followed by a version group
        "           (?P<range_lower_desc_version>{version_group})?"
        "       )"
        "    )$"
    ).format(version_group=version_group)
  1. Create a PR
  2. Sign CLA

This is purely your choice, of course. Let us know if you have any questions or concerns we can help with.

Cheers,
Sebastian

P.S.: Here is the original thread about the license related concerns.

@nerdvegas
Copy link
Contributor

nerdvegas commented Aug 2, 2021 via email

@skral
Copy link
Contributor

skral commented Aug 11, 2021

Hi Allan (@nerdvegas),

That's great. Thank you.

Cheers,
Sebastian

@nerdvegas
Copy link
Contributor

nerdvegas commented Sep 7, 2021 via email

@nerdvegas
Copy link
Contributor

nerdvegas commented Sep 7, 2021 via email

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

3 participants