-
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
Special handling for npm @types
#519
Comments
Isn't this the type of cross-package dependency that should be described using peerDependencies? Because I'm thinking how to add a feature so that Renovate doesn't "break" peerDependencies and this sounds like the same type of thing. |
I checked
This seems like two mistakes in the publishing:
That said, I am not against practical solutions to real problems, and if publishers do a bad job then that's indeed a "real problem" for users like yourself. But before doing such hacks I really want to make sure I understand everything 100% first. |
By the way, one of the most common plugin packages I've seen is |
Here's the
I think they all support eslint 4.x too - I need to check that before merging the eslint 4.x PR. So for eslint I definitely think peerDependencies is the way to handle it (but we don't handle it yet..) |
This is true, but for
Agree, but they currently are not able to do such things, I may raise an issue there later.
|
It still seems a little hacky to me, but I'm willing to consider it if there's no other solution. So for |
Matching both major and minor would be better, but yeah, thanks for considering this suggestion. Renovate is the best tool I've never seen before, I used to use Greenkeeper but it always makes a lot of PR and I have to merge them one by one manually, which is annoying, renovate's auto-merging save my life, I just wake up and "WOW, they're already updated ❤️ ", thanks again for the great tool. 👍 |
OK, if I implement something like this then we should at least do it "right" and make it work for all cases. Something like a "followMajor", "followMinor" and "followPatch" idea could work. But I am still thinking how to implement this cleanly. Q1: It sounds like you couldn't add a regex-based rule for all Q2: Do these need to be upgraded together? e.g. let's say that Q3. I assume there must be people who are installing |
A1: The A2: It seems that's based on the package, if they follow the backward compatibility, upgrading them separately is fine, otherwise it might need to upgrade together. And it seems currently is not able to group them using some "mapping" matching. (e.g. group A3: In that case, |
@ikatyang I would like to revisit this issue, specifically for
As I am not a typescript user myself, I don't really understand it deeply. For TS users, do you usually wait for an update to |
BTW I'm thinking one quick hack can simply be for me to change the way branchName is constructed for |
I looked here: https://github.com/ikatyang/prettylint/blob/master/package.json Things I notice:
Based on this, it seems really hard to have any "fixed" rules for upgrading or pairing them. Let me know if you can think of any! |
👍
There shouldn't be problems for upgrading
Rules I can think of:
Thanks for revisiting this issue ❤️ |
Although both @ikatyang and @kamal have suggested "generic" approaches to solving this (non-types-specific), and although this is usually the way I like to approach it, I think I may attempt a types-specific feature first and try to get it right. Maybe later if we find another use case we can think of a way to make the configuration more generic. One easy way I can group types together is to change the branchName for types so that instead of What it doesn't automatically do is limit the types package to being in "lock step" with the original, so I still need to think of an elegant way to do that. Would this logic work? "If There are still some challenging edge cases/race conditions to handle though, even if the above works. e.g. imagine you are currently on |
@ikatyang @kamal I wanted to update you on a small improvement made today to how we handle I think - but need to confirm this with some hands-on testing - that it should also improve handling when a types package is available but exceeds your currently installed package:
So I think the next step would be to suppress |
This does not yet solve the problem of minor version pairing, e.g. let's say you are on |
Great work! The logic looks good to me. 👍 Regarding minor versions, I think we can always upgrade P.S. the |
Using peerDependencies has been suggested to types-publisher before: microsoft/types-publisher#13 I think a tool like Renovate wanting to programmatically match the supporting versions is a strong argument that it should be done. Maybe someone from the TS team could chime in here, this would greatly improve the TS ecosystem if we can properly use tools like Renovate with TS projects. @RyanCavanaugh |
@felixfbecker thanks for bringing that to my attention. Having the In the meantime, do you have any real examples of where Renovate proposed upgrading a |
@felixfbecker can you bring me up to speed on this? |
@types
I think we can finally achieve this using #11092 and the concept of groupPreference=parentRepo |
@rarkins Will grouped packages automatically pin to the same version? In my understanding Renovate would just group available updates into the same PR but there is not logical connection between the packages' version. The result would be the same as now (though more sophisticated) where |
Has there been any movement on this recently? It would be really nice to have. |
I would love this! Here's my current situation: Last week Renovate proposed this merge request:
I didn't want any of those because they don't match the major version of the packages I'm using. I also have Today I have a new merge request:
As you can see only one package changed versions. Here are the issues as far as I can see them:
I'll dig through the documentation and see if I can find a more explicit way of telling the Renovate bot to ignore these type packages until the normal packages are updated. Thanks! |
Please raise a configuration discussion, it looks like you're maybe grouping the types packages major updates unnecessarily |
I see we're using "extends": ["group:definitelyTyped"], so I guess that explains the behaviour in the first bullet point. I'll remove that to get more normal behaviour. And maybe this issue will handle the other three once it's resolved. Thanks! |
I don't have a good answer for this, butwould a possible implementation be a template based approach (with maybe a built in preset) ala regexManagers? Absolutely terrible pseudo code and I'm not sure how it would workout in reality but something like: {
matchPackageNames: ["@types/my-package"],
peerVersionTemplate: {
peer: "my-package",
// could be a peer template?
// matchPeerString: "@types\/(?<peerName>.*)"
// peerTemplate: "{{peerName}}"
// maybe have peerMatchString ala regexManager.matchStrings to capture versions,
// but default to semver parsing
versionTemplate: "^{{major}}.{{minor}}.0"
}
} Would probably break down on edge cases though since it requires an exact peer version and specific versioning scheme 😅 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
This is a common usage for plugin-like packages, the plugin package's version respect to target package version, for example:
Case 1
1.2.3
1.2.x
,1.x
, etc.Case 2
I'm using
gulp@3.x
but there is@types/gulp@4.x
available, which is not compatible with target package, I'd like to not upgrade@types/gulp
untilgulp
is upgraded.@types/xxx
(published by official BOT), and its version are same as target package's MAJOR.MINOR version.Option may looks something like:
The text was updated successfully, but these errors were encountered: