-
Notifications
You must be signed in to change notification settings - Fork 67
fix: pin to a specific version of @octokit/types
#520
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
Conversation
|
I'm very open to feedback on this PR. I could definitely be missing something, but it looks like it will fix some undesirable behaviour that is causing issues for users. |
@octokit/types@octokit/types
|
You'll need to update the |
|
I believe that this should update the |
Yes, I think you should commit the change |
…he update task When the `@octokit/types` package is updated, we run the "update" workflow in GitHub Actions to update this code and push a PR. At the moment, we're seeing fairly regular bugs affecting this plugin (e.g. octokit/types.ts#426) where it is used with an incompatible version of `@octokit/types`, so new types that have been introduced are not there. The reality is that this plugin is only guaranteed to work with a specific version of the types. If you end up updating this plugin but not the types (which is what npm will do naturally), they can be out of sync. This doesn't only apply to what might seem like major version "breaking changes" to the types. If the types introduce a new endpoint, and you haven't upgraded, then this package will be broken because it will refer to that endpoint without the types being present. This tweaks the "update" task so it sets in the `package.json` an *exact* version of `@octokit/types` which should be used. This ensures that it is used with a compatible version that does not generate errors.
daddd0a to
1decd3b
Compare
|
@wolfy1339 Done, and ready for re-review ✨ |
@octokit/types@octokit/types
|
🎉 This PR is included in version 6.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
This is not a good idea. We have |
Interesting! Do you think we should revert this, in that case? Perhaps I was a little too hasty to merge this, but it's not too late to change our minds. Should we instead have a special step of updating the I didn't know that it was possible to end up with multiple versions in the same project - how does that happen?
Is it definitely true that "Installing with @octokit/types@latest already sets the minimum required version"? If that is the case, then I don't understand how issues like octokit/types.ts#426 can happen. It seems like npm was sticking with an older version, and the user had to manually update the |
|
This is a quick list of packages using
If you have a combination of these in your dependencies, of which you already have if you use The problem of multiple |
|
Thanks for explaining! I assumed npm would use “strictest wins” in the case where multiple packages have the same dependency with different versions, but it sounds like it allows multiple versions instead. That seems like a good reason not to do what I’ve done here! I am wondering if there is a solution to the problem though. |
|
This is an interesting discussion. Would While we don't reach that point: Adding Considering |
|
I have now reverted this, but I still think we should continue this conversation - as much as I can't contribute much as a JavaScript noob! |
When the
@octokit/typespackage is updated, we run the "update" workflow in GitHub Actions to update this code and push a PR.At the moment, we're seeing fairly regular bugs affecting this plugin (e.g. octokit/types.ts#426) where it is used with an incompatible version of
@octokit/types, so new types that have been introduced are not there.The reality is that this plugin is only guaranteed to work with a specific version of the types. If you end up updating this plugin but not the types (which is what npm will do naturally), they can be out of sync.
This doesn't only apply to what might seem like major version "breaking changes" to the types. If the types introduce a new endpoint, and you haven't upgraded, then this package will be broken because it will refer to that endpoint without the types being present.
This tweaks the "update" task so it sets in the
package.jsonan exact version of@octokit/typeswhich should be used. This ensures that it is used with a compatible version that does not generate errors.