-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat: pkg.pr.new #313
base: main
Are you sure you want to change the base?
feat: pkg.pr.new #313
Conversation
ecosystem-ci.ts
Outdated
@@ -25,16 +25,19 @@ cli | |||
.action(async (suites, options: CommandOptions) => { | |||
const { root, vitePath, workspace } = await setupEnvironment() | |||
const suitesToRun = getSuitesToRun(suites, root) | |||
let viteMajor | |||
let viteMajor = 5 |
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.
this is just a test, i wonder how we should get the viteMajor when we do not have the vite repo since we didn't set it up in commit mode.
ecosystem-ci.ts
Outdated
} else { | ||
viteMajor = parseMajorVersion(options.release) | ||
} | ||
const runOptions: RunOptions = { | ||
root, | ||
viteCommit: options.commit, |
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.
viteCommit option for later in the test so we generate a tarball link from it.
tests/_selftest.ts
Outdated
@@ -17,7 +17,7 @@ export async function test(options: RunOptions) { | |||
) | |||
} | |||
pkg.scripts.selftestscript = | |||
"[ -d ../../vite/packages/vite/dist ] || (echo 'vite build failed' && exit 1)" | |||
"pnpm vite -v || (echo 'vite build failed' && exit 1)" |
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.
This is a test too, since we do not have the repo anymore in commit mode, i just tried logging the vite version.
I think there should be a condition here.
The name I think the But this should probably stay as a draft until we figured out how it works with the planned comment triggers in vite repo. |
Yes, agreed! Let's handle things with the |
d580963
to
d6add4f
Compare
Ok, I made fully new changes on this! |
@@ -23,6 +24,14 @@ cli | |||
.option('--commit <commit>', 'vite commit sha to use') | |||
.option('--release <version>', 'vite release to use from npm registry') | |||
.action(async (suites, options: CommandOptions) => { | |||
if (options.commit) { | |||
const url = `https://pkg.pr.new/${options.repo}/vite@${options.commit}` | |||
const { status } = await fetch(url) |
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.
should be able to use head request here to avoid download
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.
as mentioned on discord this can only be implemented if pr.pkg.new supports full commit hash resolution in url. a collision in the first 7 chars may be unlikely but testing the wrong code would be catastrophic and super hard to debug. |
Whenever the commit is available, we avoid building vite and we use pkg.pr.new directly.
The idea is to get the commit sha from the vite repo when commenting in the workflow dispatch (
commit
option which is optional).