-
-
Notifications
You must be signed in to change notification settings - Fork 78
feat: pkg.pr.new on main #354
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
042e65a
06852c3
00a6c5e
505fe41
8e0cb06
627a5a9
a56f13c
f76ef85
896ce89
04ec121
ade5945
faab52e
257b0ee
1856507
603cee8
2d0e8ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,8 +16,13 @@ export async function test(options: RunOptions) { | |
| `invalid checkout, expected package.json with "name":"vite-ecosystem-ci" in ${dir}`, | ||
| ) | ||
| } | ||
| pkg.scripts.selftestscript = | ||
| "[ -d ../../vite/packages/vite/dist ] || (echo 'vite build failed' && exit 1)" | ||
| if (options.release?.startsWith('https://pkg.pr.new/vite@')) { | ||
Aslemammad marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pkg.scripts.selftestscript = | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sapphi-red would love to hear your thoughts on this now that the ci is fixed by this! |
||
| "[ -d ./node_modules/vite ] || (echo 'vite build failed' && exit 1)" | ||
Aslemammad marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } else { | ||
| pkg.scripts.selftestscript = | ||
| "[ -d ../../vite/packages/vite/dist ] || (echo 'vite build failed' && exit 1)" | ||
| } | ||
| await fs.promises.writeFile( | ||
| pkgFile, | ||
| JSON.stringify(pkg, null, 2), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -371,11 +371,15 @@ export async function setupViteRepo(options: Partial<RepoOptions>) { | |
| } | ||
| } | ||
|
|
||
| export async function getPermanentRef() { | ||
| cd(vitePath) | ||
| export async function getPermanentRef(repo: string, ref: string) { | ||
| try { | ||
| const ref = await $`git log -1 --pretty=format:%H` | ||
| return ref | ||
| const res = await fetch( | ||
| `https://api.github.com/repos/${repo}/branches/${ref}`, | ||
| ) | ||
| const { | ||
| commit: { sha }, | ||
| } = (await res.json()) as { commit: { sha: string } } | ||
| return sha | ||
|
||
| } catch (e) { | ||
| console.warn(`Failed to obtain perm ref. ${e}`) | ||
| return undefined | ||
|
|
||
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.
By this code, we will sometimes get a prebuilt package and sometimes don't, depending on when the last commit was pushed. I think we should avoid that if possible so that there aren't differences among the runs.
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.
i see, can you show me an instance where we give the prebuilt package? i'd like to see how can i manipulate the code to perform well on those edge-cases.
i wonder if putting
if (options.commit && !options.release)would resolve that edge case or no? would love to hear your thoughts.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 example case of using a prebuilt package is:
The example case of not using a prebuilt package is:
I think that doesn't resolve the case.