-
Notifications
You must be signed in to change notification settings - Fork 2.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Update github hashes in npm package.json files #5640
Comments
We don't plan to support this automatically, because there's too many ways such PRs could be wrong/unwelcome. We assume most people will use a GitHub dependency instead of npm for a good reason, and we may not know it.
This is possible. Can you collect the possible syntaxes that would need to be supported? |
at the begin:
at the end:
|
How could Renovate know what to upgrade
Adding a commit hash to a URL that doesn't have one is a good idea, but definitely something we'd want people to opt into. We refer to updating digests as "digest updating" and adding digests as "digest pinning" btw. |
it wasn't a good example, the hash should be updated only if there's already a hash |
Phase 1: If a hash exists then update it |
I have this same need. In my case, I don't need support for commit hash but only the branch name at the end of the URL, which might not be the default one. I started to look on how to support this kind of dependency and we could reuse the |
@m4theushw can you create a reproduction first and show manually what the PR should look like? Then I can advise if a PR would be a good idea. |
Hi there, Help us by making a minimal reproduction repository. Before we can start work on your issue we first need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. To get started, please read our guide on creating a minimal reproduction to understand what is needed. We may close the issue if you (or someone else) have not provided a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment. Good luck, The Renovate team |
@rarkins Here's the reproduction: https://github.com/m4theushw/renovate-git-urls The real application using this dependency is https://github.com/mui-org/material-ui-x/blob/master/package.json#L68 To add support for branch-based git urls, the first step would be to replace the renovate/lib/manager/npm/extract/index.ts Line 326 in 4e69bfa
The next step is to make sure that the
I stopped here but additional steps may be needed. |
Can you manually create the PR you expect? I'm not sure what you're expecting because it's set to a non-versioned branch name |
@rarkins This is the PR we would expect https://github.com/mui-org/material-ui-x/pull/3526/files.
I think that the answer on this one from @piotr-s-brainhub would be the latest git hash commit this branch refers to. |
That's a lockfile only update. Use lockfile maintenance for this. |
@viceice The dependency is not versioned for lockfile maintenance to work. There's a branch name at the end of the URL: |
Lockfile maintenance should work, as renovate simply deletes the lockfile and let yarn re-create, so yarn should resolve to latest commit. Renovate never directly changes the lockfile. |
I added a versioned dependency (lodash in this case) to my test repo and enabled lockfile maintenance. Renovate created two PRs: one to update lodash and another "Lock file maintenance" updating the resolved hash of the git url. The problem is that the lockfile maintenance PR is also updating lodash. Is there a way to update via lockfile maintenance only those dependencies whose a dedicated PR can't be created? Sometimes the update of a single dependency needs intervention to fix the CI and handling all updates at once (in the lockfile maintenance PR) is not feasible. |
@m4theushw I approached it differently in mui/mui-x#3500 |
Any update here? |
A new reproduction is needed here |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Sometimes I have dependencies in my
package.json
defined as a link to a git (GitHub, BitBucket or GitLab) repo, possibly with a branch name or a hash.So it would be nice if renovate allowed me two options:
The text was updated successfully, but these errors were encountered: