Skip to content

Comments

[WIP] Add nightly GitHub CI workflow to fetch main artifact#1532

Open
Copilot wants to merge 3 commits intomainfrom
copilot/add-nightly-ci-workflow
Open

[WIP] Add nightly GitHub CI workflow to fetch main artifact#1532
Copilot wants to merge 3 commits intomainfrom
copilot/add-nightly-ci-workflow

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

  • Create a nightly GitHub CI workflow (nightly.yml) that:
    • Runs on a schedule (daily at 08:00 UTC) and supports manual dispatch
    • Fetches the latest artifacts from the most recent successful CI workflow run on main
    • Downloads wheels from ci.yml (CUDA 12.8) and ci_cu13.yml (CUDA 13) workflow runs
    • Creates a nightly pre-release on GitHub with the fetched wheel artifacts
    • Uses nightly-YYYYMMDD tag naming convention
    • Handles cleanup of existing same-day nightly releases
    • Validates that at least some artifacts were downloaded before proceeding
  • Validate workflow YAML syntax
  • Address code review feedback (fixed glob check, added download validation)
  • Run security checks

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 10, 2026 11:59
…GitHub release

Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>
Co-authored-by: stmatengss <11641725+stmatengss@users.noreply.github.com>
@stmatengss stmatengss marked this pull request as ready for review February 10, 2026 12:00
@stmatengss stmatengss closed this Feb 10, 2026
@stmatengss stmatengss reopened this Feb 10, 2026
Copilot stopped work on behalf of stmatengss due to an error February 10, 2026 12:00
@stmatengss
Copy link
Collaborator

stmatengss commented Feb 10, 2026

/gemini review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a scheduled GitHub Actions workflow to automatically publish a nightly pre-release by downloading wheel artifacts from the latest successful CI runs on main.

Changes:

  • Introduces .github/workflows/nightly.yml scheduled + manual workflow to fetch artifacts from ci.yml and ci_cu13.yml.
  • Extracts downloaded artifacts and creates/overwrites a same-day nightly-YYYYMMDD GitHub pre-release with wheel assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +64 to +76
console.log(`Downloading artifact: ${artifact.name}`);
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});

const artifactDir = path.join('nightly-wheels', artifact.name);
fs.mkdirSync(artifactDir, { recursive: true });
const zipPath = path.join(artifactDir, `${artifact.name}.zip`);
fs.writeFileSync(zipPath, Buffer.from(download.data));
console.log(`Saved to ${zipPath}`);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The artifact download loop doesn’t handle per-artifact download failures. If a single artifact download fails (expired artifact, transient API issue, etc.), the whole step will throw and the workflow will abort without a clear summary. Consider wrapping downloadArtifact/writeFileSync in a try/catch, logging the failure, and continuing while still enforcing the final downloaded === 0 guard.

Copilot uses AI. Check for mistakes.
Comment on lines +117 to +131
try {
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag,
});
await github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
});
console.log(`Deleted existing release for tag ${tag}`);
} catch (e) {
console.log(`No existing release found for tag ${tag}`);
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Both deletion try/catch blocks treat any error as “not found”. This can mask real failures (permissions, rate limiting, API outage) and lead to confusing downstream errors when creating the new release/tag. Please only swallow 404/Not Found and rethrow (or core.setFailed) for other statuses.

Copilot uses AI. Check for mistakes.
Comment on lines +134 to +143
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${tag}`,
});
console.log(`Deleted existing tag ${tag}`);
} catch (e) {
console.log(`No existing tag found: ${tag}`);
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Same as above for tag deletion: catching all exceptions and logging “No existing tag found” will hide non-404 errors. Please check the error status/code and only ignore the expected not-found case.

Copilot uses AI. Check for mistakes.
}

- name: Upload wheels to GitHub Nightly Release
uses: softprops/action-gh-release@v1
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

For supply-chain security, consider pinning third-party actions (e.g., softprops/action-gh-release) to a specific commit SHA (or at least a full semver tag) instead of a moving major tag. This reduces the risk of a compromised upstream release affecting your release automation.

Suggested change
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v1.10.0

Copilot uses AI. Check for mistakes.
Comment on lines +107 to +109
echo "Found wheel files:"
ls -la nightly-release/*.whl

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The artifacts uploaded from CI preserve their relative paths (e.g., mooncake-wheel/dist-py…/*.whl), so after unzip the wheels will typically be under subdirectories of nightly-release/, not directly in nightly-release/. This ls nightly-release/*.whl will fail even when wheels exist (your preceding find check would pass). Consider either flattening wheels into a single directory (like the release workflows do with find … -exec cp) or updating the listing command to use find.

Copilot uses AI. Check for mistakes.
Generated at: ${{ steps.tag.outputs.nightly_tag }}
This is an automated nightly release and may be unstable.
prerelease: true
files: nightly-release/*.whl
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

softprops/action-gh-release is configured to upload nightly-release/*.whl, but after unzipping CI artifacts the wheels are likely nested under subdirectories (because CI uploads from mooncake-wheel/dist-py…/*.whl). As written, the release can be created with zero uploaded assets. Suggest flattening wheels into a dedicated folder (and upload from there) or using a recursive glob that the action supports.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +14
jobs:
nightly-release:
runs-on: ubuntu-22.04
permissions:
contents: write
actions: read
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Because this workflow deletes and recreates a shared tag/release (nightly-YYYYMMDD), concurrent runs (e.g., a manual dispatch overlapping the scheduled run) can race and interfere with each other. Consider adding a concurrency group (and possibly cancel-in-progress: true) to ensure only one nightly-release job runs at a time.

Copilot uses AI. Check for mistakes.

on:
schedule:
# Run at 08:00 UTC every day (midnight PST)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The schedule comment is inaccurate during daylight saving time: 08:00 UTC is midnight PST only in winter, but 01:00 PDT in summer. Please update the comment to a DST-agnostic phrasing (e.g., “00:00 Pacific Time (08:00 UTC)” or just “08:00 UTC”).

Suggested change
# Run at 08:00 UTC every day (midnight PST)
# Run at 08:00 UTC every day (00:00 Pacific Time)

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants