Skip to content

Use immutable nightly releases#53

Merged
samdark merged 2 commits into
masterfrom
fix-immutable-nightly-releases
Jun 7, 2026
Merged

Use immutable nightly releases#53
samdark merged 2 commits into
masterfrom
fix-immutable-nightly-releases

Conversation

@samdark

@samdark samdark commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • publish nightly Linux binaries as unique immutable prereleases tagged like nightly-<run>-<attempt>-<sha>
  • make the build action resolve version: nightly to the newest matching nightly prerelease with binary and checksum assets
  • document the immutable nightly behavior and add packaging/action assertions

Tests

  • make test TESTS=tests/Unit/Packaging/ConfigurationPackagingTest.php (Make target ran full PHPUnit suite: 649 tests)
  • make psalm
  • make composer-dependency-analyser

Summary by CodeRabbit

  • New Features

    • Nightly releases are now immutable with a specific naming scheme; each build creates a new prerelease instead of updating an existing one.
    • Build action now supports version: nightly to automatically resolve to the latest available nightly prerelease.
  • Documentation

    • Updated documentation to clarify nightly build handling, immutability, and usage recommendations.

Copilot AI review requested due to automatic review settings June 7, 2026 11:03
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@samdark, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 48 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 908a9162-d65a-40aa-954e-55b7e54d1589

📥 Commits

Reviewing files that changed from the base of the PR and between 71ea8d6 and 3103898.

📒 Files selected for processing (2)
  • .github/actions/build/action.yml
  • tests/Unit/Packaging/ConfigurationPackagingTest.php
📝 Walkthrough

Walkthrough

This PR introduces immutable per-run nightly builds to the GitHub Actions CI/CD pipeline. The build action now resolves version: nightly by querying GitHub releases for the newest matching nightly-* prerelease with required assets, while the package workflow publishes new immutable nightly prereleases using a run-number–based tag scheme instead of updating a single mutable "nightly" release.

Changes

Immutable Nightly Releases

Layer / File(s) Summary
Build action nightly resolution
.github/actions/build/action.yml
GitHub API headers are initialized once and reused; the new version: nightly branch fetches up to 100 releases, filters for non-draft nightly-* prereleases with required tarball and checksum assets, and fails with an error if no matching nightly is found.
Workflow nightly publication
.github/workflows/package-static.yml
The nightly release script now computes an immutable per-run tag (nightly-${GITHUB_RUN_NUMBER}-${GITHUB_RUN_ATTEMPT}-${short_sha}), generates release notes with the short SHA, and creates a prerelease via gh release create with explicit commit targeting and --latest=false, removing the prior mutable single-nightly pattern.
Nightly release tests
tests/Unit/Packaging/ConfigurationPackagingTest.php
Enhanced workflow test validates immutable tag construction and gh release create invocation; new test buildActionResolvesNightlyToLatestImmutablePrerelease verifies the action's nightly version resolution, asset requirements, prerelease filtering, and error handling.
Nightly documentation
docs/binaries-phar-docker.md, docs/deployment.md, docs/github-actions.md
Documentation clarifies the immutable nightly-* prerelease scheme, tagging format, included assets, and how version: nightly resolves to the newest matching nightly; notes that nightly builds are for preview use while production should use fixed release tags.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • yiipress/engine#44: Introduced the initial composite build action where the new nightly resolution logic is now added.
  • yiipress/engine#33: Modified the static packaging pipeline and nightly workflow publishing that is now extended with immutable prerelease creation.
  • yiipress/engine#49: Earlier work on GitHub Actions nightly pipeline that this PR further refines with immutable per-run nightly releases and corresponding resolver logic.

Poem

🐰 A nightly dance, now set in stone—
Each run its own, no moving stone!
The action finds what shines so new,
Immutable, fresh, and tested true.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Use immutable nightly releases' directly reflects the main objective of the changeset: converting nightly releases from mutable to immutable by introducing unique tagging and version resolution logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-immutable-nightly-releases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR changes the nightly distribution model to be immutable by publishing each successful master build as a unique prerelease tag, and updates the reusable build action so version: nightly resolves to the newest such prerelease (with required assets). It also updates documentation and adds assertions to ensure the packaging workflow and action behavior remain consistent.

Changes:

  • Publish immutable nightly prereleases tagged nightly-<run>-<attempt>-<sha> (instead of updating a mutable nightly tag/release).
  • Update the composite build action to resolve version: nightly via the GitHub Releases API by selecting the newest matching prerelease with required assets.
  • Update docs and add unit assertions to enforce the new immutable-nightly workflow/action behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/Packaging/ConfigurationPackagingTest.php Adds assertions for immutable nightly prerelease creation and action nightly-resolution behavior.
docs/github-actions.md Documents that nightly resolves to the newest immutable nightly prerelease with required assets.
docs/deployment.md Updates deployment guidance to mention version: nightly for previewing newest immutable nightlies.
docs/binaries-phar-docker.md Updates packaging documentation to describe immutable nightly prereleases and action resolution behavior.
.github/workflows/package-static.yml Changes nightly publishing to create a unique prerelease per run/attempt/SHA (immutable).
.github/actions/build/action.yml Adds nightly resolution logic that selects a suitable prerelease tag via the GitHub API before downloading assets.

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

Comment thread .github/actions/build/action.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
docs/binaries-phar-docker.md (1)

44-44: ⚡ Quick win

Consider splitting this long sentence for clarity.

Line 44 describes three different artifact destinations (workflow artifacts, GitHub prereleases, and container registry) in a single complex sentence. While technically accurate, splitting it into separate sentences would improve readability and make it clearer where each artifact type is published.

✏️ Proposed restructure for clarity
-GitHub Actions builds the same outputs in the `Package Static Builds` workflow. Commits to `master` publish separate nightly PHAR, Linux, macOS, and Windows workflow artifacts, create immutable GitHub prereleases tagged as `nightly-<run>-<attempt>-<sha>` with the Linux binary and checksums, and push the distroless image as `ghcr.io/<owner>/<repo>-static:nightly` plus a commit-specific `nightly-<sha>` tag. The reusable build action resolves `version: nightly` to the newest matching nightly prerelease.
+GitHub Actions builds the same outputs in the `Package Static Builds` workflow. Commits to `master` publish separate nightly PHAR, Linux, macOS, and Windows workflow artifacts. They also create immutable GitHub prereleases tagged as `nightly-<run>-<attempt>-<sha>` with the Linux binary and checksums, and push the distroless image as `ghcr.io/<owner>/<repo>-static:nightly` plus a commit-specific `nightly-<sha>` tag. The reusable build action resolves `version: nightly` to the newest matching nightly prerelease.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/binaries-phar-docker.md` at line 44, The long sentence beginning "GitHub
Actions builds the same outputs in the `Package Static Builds` workflow..."
should be split into multiple clear sentences: one stating that commits to
master publish workflow artifacts (nightly PHAR, Linux, macOS, Windows), a
second describing the creation of immutable nightly prereleases (tagged
`nightly-<run>-<attempt>-<sha>` containing the Linux binary and checksums), and
a third explaining the distroless image pushes
(`ghcr.io/<owner>/<repo>-static:nightly` and `nightly-<sha>`). Finally, keep the
note about the reusable build action resolving `version: nightly` as a separate
concluding sentence for clarity.
.github/actions/build/action.yml (1)

82-114: Make nightly release lookup resilient to >100 matching prereleases

The nightly resolution only fetches the first page of releases (releases?per_page=100) and doesn’t paginate, so if more than 100 nightly-* prereleases accumulate over time it can fail to find the latest matching assets. A current check shows yiipress/engine has 0 nightly prereleases right now, but the logic remains brittle for other ${repository} values and future accumulation. [optional: add pagination for the GitHub releases query or document/implement retention/cleanup of old nightlies].

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/build/action.yml around lines 82 - 114, The nightly lookup
only downloads one page of releases into nightly_releases and can miss matching
prereleases if there are >100 entries; modify the logic around the curl +
nightly_releases and the python extractor to paginate GitHub releases (e.g.,
loop fetching releases?per_page=100&page=N until no more results) and
concatenate results into nightly_releases, or alternatively use the GitHub
Releases API with pagination headers to collect all pages before running the
python3 block that prints the matching tag; update the curl/headers loop and
ensure the python input (currently reading sys.argv[1] in the block used by
nightly_releases) receives the combined JSON so the existing tag-matching code
(tag.startswith("nightly-") and assets check) still works.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/actions/build/action.yml:
- Around line 82-114: The nightly lookup only downloads one page of releases
into nightly_releases and can miss matching prereleases if there are >100
entries; modify the logic around the curl + nightly_releases and the python
extractor to paginate GitHub releases (e.g., loop fetching
releases?per_page=100&page=N until no more results) and concatenate results into
nightly_releases, or alternatively use the GitHub Releases API with pagination
headers to collect all pages before running the python3 block that prints the
matching tag; update the curl/headers loop and ensure the python input
(currently reading sys.argv[1] in the block used by nightly_releases) receives
the combined JSON so the existing tag-matching code (tag.startswith("nightly-")
and assets check) still works.

In `@docs/binaries-phar-docker.md`:
- Line 44: The long sentence beginning "GitHub Actions builds the same outputs
in the `Package Static Builds` workflow..." should be split into multiple clear
sentences: one stating that commits to master publish workflow artifacts
(nightly PHAR, Linux, macOS, Windows), a second describing the creation of
immutable nightly prereleases (tagged `nightly-<run>-<attempt>-<sha>` containing
the Linux binary and checksums), and a third explaining the distroless image
pushes (`ghcr.io/<owner>/<repo>-static:nightly` and `nightly-<sha>`). Finally,
keep the note about the reusable build action resolving `version: nightly` as a
separate concluding sentence for clarity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b57f90a4-2191-46aa-9dc4-ac9f27de045b

📥 Commits

Reviewing files that changed from the base of the PR and between d9635fc and 71ea8d6.

📒 Files selected for processing (6)
  • .github/actions/build/action.yml
  • .github/workflows/package-static.yml
  • docs/binaries-phar-docker.md
  • docs/deployment.md
  • docs/github-actions.md
  • tests/Unit/Packaging/ConfigurationPackagingTest.php

@samdark samdark merged commit 3122ab5 into master Jun 7, 2026
7 checks passed
@samdark samdark deleted the fix-immutable-nightly-releases branch June 7, 2026 11:14
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.

2 participants