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

scripts/check-siblings: Update to work with yarn patch. #771

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

Shayan-To
Copy link
Contributor

@Shayan-To Shayan-To commented Nov 5, 2024

I'm using @sentry/nextjs version 8.27.0, and I cannot update to the latest version because of a bug introduced in the next version. And there was another bug on 8.27.0. So I had to use yarn patch to fix the latter mentioned bug without updating the package.

yarn patch changes the version to something like this: patch:@sentry/nextjs@npm%3A8.27.0#~/.yarn/patches/@sentry-nextjs-npm-8.27.0-0e3a1ce4c2.patch This means that exact version 8.27.0 was used as base and patched.

This PR updates the sibling version check to work with yarn patch versions.

#skip-changelog

`yarn patch` changes the version to something like this:
`patch:@sentry/nextjs@npm%3A8.27.0#~/.yarn/patches/@sentry-nextjs-npm-8.27.0-0e3a1ce4c2.patch`
This means that exact version `8.27.0` was used as base and patched.
@@ -68,7 +68,7 @@ function ValidateSentryPackageParameters(packages) {
if (installedVersion.split('@').length === 2) {
errorMessages.push("You must specify the version to the package " + installedVersion + ". ( " + installedVersion + "@" + siblingVersion + ")");
}
else if (!installedVersion.endsWith(siblingVersion)) {
else if (!installedVersion.endsWith(siblingVersion) && !installedVersion.includes('%3A' + siblingVersion + '#')) {
Copy link
Contributor Author

@Shayan-To Shayan-To Nov 5, 2024

Choose a reason for hiding this comment

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

I'm not sure if this is correct. I'm using yarn 4.3.1, and it's not setting npm_config_argv environment variable, and I don't know the exact syntax of it.

@lucas-zimerman
Copy link
Collaborator

lucas-zimerman commented Nov 5, 2024

Looks good to me ! Thank you for the contribution!
In regard to the sibling versions, I am waiting for getsentry/sentry-javascript#14077 to be released before updating the next version

@lucas-zimerman lucas-zimerman merged commit 94a7430 into getsentry:main Nov 5, 2024
7 of 12 checks passed
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

Successfully merging this pull request may close these issues.

2 participants