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

feat: pkg.pr.new #313

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Aslemammad
Copy link
Contributor

@Aslemammad Aslemammad commented Jun 12, 2024

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).

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
Copy link
Contributor Author

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,
Copy link
Contributor Author

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.

@@ -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)"
Copy link
Contributor Author

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.

@dominikg
Copy link
Collaborator

The name commit is a bit generic and we already support passing a commit on the vite main repo.

I think the release option could be extended to support links to this registry, or introduce a similar option that has an explicit name.

But this should probably stay as a draft until we figured out how it works with the planned comment triggers in vite repo.

@Aslemammad
Copy link
Contributor Author

Yes, agreed! Let's handle things with the release field.

@Aslemammad Aslemammad marked this pull request as ready for review October 30, 2024 19:09
@Aslemammad
Copy link
Contributor Author

Ok, I made fully new changes on this!

ecosystem-ci.ts Outdated Show resolved Hide resolved
@@ -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)
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dominikg
Copy link
Collaborator

dominikg commented Nov 6, 2024

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.

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.

3 participants