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

feat(conan): add revisions support #16871

Merged
merged 17 commits into from Aug 11, 2022

Conversation

segretil
Copy link
Contributor

Changes

This adds basic support for conan revisions using digests. When a package has a revision and is updated, the revision will also get updated.
This:

- cairo/1.17.2@_/_#aff2d03608351db075ec1348a3afc9ff
+ cairo/1.17.4@_/_#aff2d03608351db075ec1348a3afc9ff

will become this:

- cairo/1.17.2@_/_#aff2d03608351db075ec1348a3afc9ff
+ cairo/1.17.4@_/_#51627b399b12479e23cc7958a33fb5eb

However I did not find how to update the revision when there is no new version. For example, I would like changes that can look like this:

- opus/1.3.1@_/_#6d2446ed5a38e86a3bb304db3ffb3e01
+ opus/1.3.1@_/_#5132ab8db7b69dd8e26466e0b3b017dd

I know it is possible since you update digests in dockerfiles but I did not understand how it worked.

Context

It partially closes #16467

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 tick 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

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a working public repository to demonstrate this new logic?

lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
@segretil
Copy link
Contributor Author

segretil commented Aug 1, 2022

lib/modules/datasource/conan/common.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/common.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/types.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/types.ts Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
@segretil segretil requested a review from viceice August 2, 2022 19:52
@viceice
Copy link
Member

viceice commented Aug 2, 2022

you still don't understand how renovate handles digests. so please do the following:

  • remove the requested digest handling in getReleases
  • implement the getDigest function, so it uses the newValue to fetch the digest matching the release ( follow docker datasource as example)

this allows renovate to

  • add a digest to a version without a digest
  • update the digest to the corresponding version

@segretil
Copy link
Contributor Author

segretil commented Aug 2, 2022

@viceice I pushed what you suggested, and run it on this repository: https://github.com/segretil/-renovate-conan-revisions-get-digest

As you can see segretil/-renovate-conan-revisions-get-digest#1 is wrong, this revision does not exist with this version.
Without this last commit (9f53a90) I obtain this: https://github.com/segretil/renovate-conan-revisions-without-bot/pulls which is exactly what I want.

Do you know why ?

lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/manager/conan/common.ts Show resolved Hide resolved
lib/modules/manager/conan/extract.ts Outdated Show resolved Hide resolved
@segretil
Copy link
Contributor Author

segretil commented Aug 3, 2022

I implemented what you said but I am still getting this unwanted merge request: segretil/-renovate-conan-revisions-get-digest#6

@segretil segretil requested a review from viceice August 3, 2022 17:01
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to remove the current version from packageName, otherwise it will be used wrongly for cache keys

lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
@segretil
Copy link
Contributor Author

segretil commented Aug 3, 2022

It is now working, it seems like the issue happened because of the cache. Thank you for the suggestion !

@segretil segretil requested a review from viceice August 3, 2022 18:09
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
@segretil segretil requested a review from viceice August 9, 2022 06:48
@segretil
Copy link
Contributor Author

Is there something you are still expecting from me @rarkins @viceice ? :)

lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/conan/index.ts Outdated Show resolved Hide resolved
@segretil segretil requested a review from viceice August 11, 2022 17:53
@viceice viceice changed the title feat: add conan revisions feat(conan): add revisions support Aug 11, 2022
@viceice viceice merged commit cedc8e2 into renovatebot:main Aug 11, 2022
@viceice
Copy link
Member

viceice commented Aug 11, 2022

maybe we need to update the digest update commitmessage extra, so the pr and commit messages use revisions instead of digest.

like we do for docker datasource.

@viceice
Copy link
Member

viceice commented Aug 11, 2022

❤️ thanks for the good work and following all those advices

@segretil segretil deleted the feat/add-conan-revisions branch August 11, 2022 19:20
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 32.155.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Conan package revisions
4 participants