Skip to content

Enforce consistency between packages in preview builds #79610

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

Merged
merged 1 commit into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ jobs:
path: crates/wasm

- name: Create tarballs
run: GH_PR_NUMBER=${{ github.event.pull_request && github.event.pull_request.number || '' }} node scripts/create-preview-tarballs.js "${{ github.sha }}" "${{ runner.temp }}/preview-tarballs"
Copy link
Member

Choose a reason for hiding this comment

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

If we don't use the PR number we aren't able to look up the artifacts currently for the build if it's from a fork. Ideally we could reference PR and commit if available so it can be consistent and we can look it up for a fork

Copy link
Member Author

@eps1lon eps1lon May 27, 2025

Choose a reason for hiding this comment

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

That needs separate consideration then. But within, preview builds need to be consistent. They cannot reference PRs since that makes them not reproducible.

I'd need to see preview build from a fork PR to understand the issue. Though I think this largely stems from not using the right commit SHA to reference preview builds on forks.

Copy link
Member Author

Choose a reason for hiding this comment

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

This should enable preview builds on forks while keeping internal consistency: #79648

run: node scripts/create-preview-tarballs.js "${{ github.sha }}" "${{ runner.temp }}/preview-tarballs"

- name: Upload tarballs
uses: actions/upload-artifact@v4
Expand Down
13 changes: 4 additions & 9 deletions scripts/create-preview-tarballs.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function main() {
}
)
// tarball name is printed as the last line of npm-pack
const tarballName = stdout.trim().split('\n').pop() || ''
const tarballName = stdout.trim().split('\n').pop()
console.info(`Created tarball ${path.join(packDestination, tarballName)}`)

nextSwcPackageNames.add(manifest.name)
Expand All @@ -97,21 +97,16 @@ async function main() {
])
const packages = JSON.parse(lernaListJson.stdout)
const packagesByVersion = new Map()
const PR_NUMBER = process.env.GH_PR_NUMBER
const basePackageUrl = PR_NUMBER
? `https://vercel-packages.vercel.app/next/prs/${PR_NUMBER}/`
: `https://vercel-packages.vercel.app/next/commits/${commitSha}/`

for (const packageInfo of packages) {
packagesByVersion.set(
packageInfo.name,
`${basePackageUrl}${packageInfo.name}`
`https://vercel-packages.vercel.app/next/commits/${commitSha}/${packageInfo.name}`
)
}
for (const nextSwcPackageName of nextSwcPackageNames) {
packagesByVersion.set(
nextSwcPackageName,
`${basePackageUrl}${nextSwcPackageName}`
`https://vercel-packages.vercel.app/next/commits/${commitSha}/${nextSwcPackageName}`
)
}

Expand Down Expand Up @@ -169,7 +164,7 @@ async function main() {
}
)
// tarball name is printed as the last line of npm-pack
const tarballName = stdout.trim().split('\n').pop() || ''
const tarballName = stdout.trim().split('\n').pop()
console.info(`Created tarball ${path.join(packDestination, tarballName)}`)
}

Expand Down
Loading