Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts artifact naming to remove file extensions, updates CI branch triggers, and simplifies the rsbuild demo UI content.
Changes:
- Remove file extensions from uploaded/downloaded artifact names.
- Update GitHub Actions CI workflow to run on
mainandtest/main3pushes. - Delete duplicated/extra UI sections from the rsbuild demo
App.tsx.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/upload.ts | Changes artifact naming to omit the original file extension. |
| src/download.ts | Updates expected artifact name computation to match the new naming scheme. |
| examples/rsbuild-demo2/src/App.tsx | Removes extra duplicated UI sections to simplify the demo page. |
| dist/index.js | Rebuild output reflecting the artifact naming change. |
| .github/workflows/ci.yml | Expands push branch triggers for CI runs. |
| const relativePath = path.relative(process.cwd(), targetFilePath); | ||
| const pathParts = relativePath.split(path.sep); | ||
| const fileNameWithoutExt = path.parse(fileName).name; | ||
| const fileExt = path.parse(fileName).ext; | ||
|
|
||
|
|
||
| const pathHash = hashPath(pathParts, fileNameWithoutExt); | ||
| const artifactName = `${pathHash}-${hash}${fileExt}`; | ||
| const artifactName = `${pathHash}-${hash}`; |
There was a problem hiding this comment.
Dropping the file extension from artifactName reduces uniqueness: two artifacts with the same path + base filename but different extensions (e.g., report.html vs report.json) will collide and can overwrite each other or be indistinguishable when downloading. Consider restoring ${fileExt} in the artifact name, or incorporate the extension into the hashed component (e.g., include fileExt in the hashPath input) to keep names stable and unique.
| const relativePath = path.relative(process.cwd(), filePath); | ||
| const pathParts = relativePath.split(path.sep); | ||
| const fileNameWithoutExt = path.parse(fileName).name; | ||
| const fileExt = path.parse(fileName).ext; | ||
| const pathHash = hashPath(pathParts, fileNameWithoutExt); | ||
| const expectedArtifactName = `${pathHash}-${commitHash}${fileExt}`; | ||
| const expectedArtifactName = `${pathHash}-${commitHash}`; |
There was a problem hiding this comment.
This change makes downloads incompatible with previously uploaded artifacts that included the file extension in their names. If existing artifacts need to remain accessible, consider a backward-compatible lookup (e.g., attempt ${pathHash}-${commitHash}${fileExt} first, then ${pathHash}-${commitHash}, or vice versa), or introduce a versioned naming scheme so callers can unambiguously select old vs new behavior.
Rsdoctor Bundle Diff AnalysisFound 2 projects in monorepo, 2 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 rsbuild-demoPath:
📁 rsbuild-demo2Path:
Generated by Rsdoctor GitHub Action |
7a733f5 to
224af0e
Compare
No description provided.