-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(vue): Added canary and latest test variants to Vue tests #18681
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
| "test:assert": "pnpm test:print-version && playwright test", | ||
| "test:build-canary": "pnpm install && pnpm test:install-canary && pnpm build", | ||
| "test:build-latest": "pnpm install && pnpm add vue@latest && pnpm build", | ||
| "test:install-canary": "pnpm add vue@$(git ls-remote --tags --sort='v:refname' https://github.com/vuejs/core.git | tail -n1 | awk -F'/' '{print $NF}')", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The script to get the latest Vue tag incorrectly includes the ^{} suffix from git ls-remote, which is an invalid version string for pnpm and will cause installation to fail.
Severity: HIGH | Confidence: High
🔍 Detailed Analysis
The test:build-canary script in package.json uses a shell command to find the latest Vue.js tag. The command git ls-remote --tags ... | tail -n1 incorrectly captures the dereferenced annotated tag, which includes a ^{} suffix (e.g., v3.4.15^{}). This string is not a valid version specifier for pnpm. As a result, the subsequent pnpm add vue@... command will fail with a version resolution error, causing the test:build-canary test variant to crash whenever it is executed.
💡 Suggested Fix
Modify the git ls-remote command to prevent capturing the ^{} suffix. One option is to add the --refs flag to only list actual tag references. Alternatively, filter the output to exclude lines ending in ^{}, for example by piping the output through grep -v '{}$' before tail -n1.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: dev-packages/e2e-tests/test-applications/vue-3/package.json#L18
Potential issue: The `test:build-canary` script in `package.json` uses a shell command
to find the latest Vue.js tag. The command `git ls-remote --tags ... | tail -n1`
incorrectly captures the dereferenced annotated tag, which includes a `^{}` suffix
(e.g., `v3.4.15^{}`). This string is not a valid version specifier for `pnpm`. As a
result, the subsequent `pnpm add vue@...` command will fail with a version resolution
error, causing the `test:build-canary` test variant to crash whenever it is executed.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8109808
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it works well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds test infrastructure to enable automated testing of the Vue 3 application against both the latest stable version and the most recent tagged version (labeled as "canary") of Vue. This helps catch compatibility issues early with upcoming Vue releases.
Key Changes:
- Added new npm scripts for installing and testing with different Vue versions (
test:build-latest,test:build-canary,test:install-canary,test:print-version) - Added
sentryTestconfiguration with avariantsarray for the latest Vue version and anoptionalVariantsarray for the canary version - Modified
test:assertto print the Vue version before running tests
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lms24
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "canary" strategy sounds fine for me as long as there's no better option. Fwiw, I think we'll face this issue in a few frameworks, so let's see how well it works for Vue.
This pull request adds new test scripts and Sentry test configuration variants to the
vue-3test application.The main goal is to enable automated testing of the application against both the latest and canary (alpha) versions of Vue, improving compatibility and early detection of issues with upcoming Vue releases.
Vue has several tags but no single tag is considered the "cutting-edge" of Vue releases. The docs suggest using
install-vuetool but none of the suggested tags are suitable:canarylatest publish is 2 years ago3.2edgecovers the main branch and not the latest releases, currently sitting at3.5.xxalphalatest alpha release, already outdated withbetareleases are coming throughbetawill be outdated oncercreleases start going throughrcwill be outdated once the stable version comes throughSo it doesn't feel like there is one good option here, so I opted to instead use git to query the latest tag on the Vue repo and just use that, it's not true canary and it will sometimes install other versions but I'm out of ideas. Happy to hear more thoughts and ideas here!
I will reach out to Vue team members to see if they can make
canarylive again.closes #18679