Skip to content

Support immutable nightly binary installation - #135

Merged
samdark merged 6 commits into
masterfrom
feat/nightly-installer
Aug 5, 2026
Merged

Support immutable nightly binary installation#135
samdark merged 6 commits into
masterfrom
feat/nightly-installer

Conversation

@samdark

@samdark samdark commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • resolve and install the newest immutable nightly prerelease from shell, PowerShell, GitHub Actions, and self-update flows
  • harden paginated nightly release discovery and validate required assets
  • make packaged nightly binaries report their embedded commit SHA even if Composer metadata still contains an older stable version
  • keep tagged releases reporting their release tag and document nightly version behavior

Tests

  • make test CLI_ARGS='tests/Unit/ApplicationInfoTest.php' (4 tests, 12 assertions)
  • focused packaging tests exercised 35 tests; the existing CRLF checkout mismatch causes the workflow fixture assertion to fail before the new assertions

Summary by CodeRabbit

  • New Features
    • Install the newest nightly binary with YIIPRESS_VERSION=nightly.
    • Nightly resolution searches paginated releases, stops after 10 pages, and clearly reports when no nightly release is available.
    • Development and nightly artifacts now display their full commit SHA.
  • Bug Fixes
    • Packaged commit information now takes precedence over outdated release metadata when displaying the application version.
  • Documentation
    • Added installation examples and guidance for nightly releases, including API-based version resolution without additional command-line tools.
  • Chores
    • Simplified release artifact packaging by removing the commit override configuration.

Copilot AI lite review requested due to automatic review settings August 4, 2026 19:30
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 45 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b9555ee-53e9-4522-b52a-4cd5e3d5cc82

📥 Commits

Reviewing files that changed from the base of the PR and between 1fbcdfb and 666fedd.

📒 Files selected for processing (1)
  • docs/binaries-phar-docker.md
📝 Walkthrough

Walkthrough

The release workflow no longer injects YIIPRESS_COMMIT. Application version resolution prioritizes packaged commit metadata. The installer resolves YIIPRESS_VERSION=nightly across paginated GitHub releases and installs the newest matching artifact.

Changes

Release and installation flow

Layer / File(s) Summary
Packaged version metadata and release packaging
.github/workflows/release.yml, src/ApplicationInfo.php, tests/Unit/ApplicationInfoTest.php, tests/Unit/Packaging/ConfigurationPackagingTest.php
Release packaging no longer passes YIIPRESS_COMMIT. resolveVersion() returns a non-empty packaged commit first. Tests cover both changes.
Paginated nightly installer resolution
install.sh, tests/Unit/Packaging/InstallerTest.php
The installer scans up to 10 GitHub release pages, selects a matching nightly-* prerelease, constructs its asset URL, and reports an error when no match exists. Tests cover cross-page selection, empty results, and the page limit.
Nightly installation documentation
docs/binaries-phar-docker.md, roadmap.md
The documentation describes full commit-SHA reporting and YIIPRESS_VERSION=nightly. The roadmap marks nightly installation complete.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Installer as install.sh
  participant GitHubAPI as GitHub releases API
  participant Asset as nightly release asset
  Installer->>GitHubAPI: Request release page
  GitHubAPI-->>Installer: Return prerelease objects
  Installer->>Installer: Select matching nightly-* tag
  Installer->>Asset: Download resolved nightly binary
  Asset-->>Installer: Return binary
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.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 clearly and concisely describes the pull request's main change: support for immutable nightly binary installation.
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.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch feat/nightly-installer
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/nightly-installer

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.

@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.

Actionable comments posted: 3

🤖 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.

Inline comments:
In `@install.sh`:
- Around line 56-85: Update the nightly-release parsing in the version-selection
loop to require the enclosing release record’s prerelease field to be true
before accepting a matching nightly tag. Preserve pagination and empty-result
handling, and add a fixture covering a non-prerelease nightly-shaped tag before
a valid nightly prerelease.

In `@tests/Unit/ApplicationInfoTest.php`:
- Around line 57-61: Remove the eval-based source rewriting from
packagedCommitTakesPrecedenceOverStaleReleaseMetadata(). Test resolveVersion()
through a fixture or class configuration that directly supplies the packaged
commit, or update resolveVersion() to accept that value as a testable parameter,
while preserving the assertion that the packaged commit takes precedence over
stale release metadata.

In `@tests/Unit/Packaging/ConfigurationPackagingTest.php`:
- Line 474: Update the release-workflow assertions in the relevant packaging
test to verify that the `YIIPRESS_COMMIT` override is absent in every form,
including both the YAML environment syntax and command assignments such as
`${GITHUB_SHA}`. Prefer asserting that `YIIPRESS_COMMIT` does not occur anywhere
in the workflow, while preserving the existing workflow validation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3aee4b96-b88c-49ca-87c4-36f192677242

📥 Commits

Reviewing files that changed from the base of the PR and between 403308c and 2d1263c.

📒 Files selected for processing (8)
  • .github/workflows/release.yml
  • docs/binaries-phar-docker.md
  • install.sh
  • roadmap.md
  • src/ApplicationInfo.php
  • tests/Unit/ApplicationInfoTest.php
  • tests/Unit/Packaging/ConfigurationPackagingTest.php
  • tests/Unit/Packaging/InstallerTest.php

Comment thread install.sh
Comment thread tests/Unit/ApplicationInfoTest.php Outdated
Comment thread tests/Unit/Packaging/ConfigurationPackagingTest.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for resolving and installing the newest immutable “nightly” binary, and adjusts version reporting so packaged/nightly artifacts can prefer an embedded commit SHA over stale Composer metadata.

Changes:

  • Extend install.sh and installer tests to resolve YIIPRESS_VERSION=nightly via the GitHub Releases API with pagination.
  • Update application version resolution logic so packaged builds can report an embedded commit SHA reliably.
  • Align release workflow assertions/docs/roadmap with the new nightly + version-reporting behavior.

Reviewed changes

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

Show a summary per file
File Description
install.sh Adds nightly resolution via GitHub API before downloading assets.
tests/Unit/Packaging/InstallerTest.php Stubs paginated GitHub API responses and adds nightly installer coverage.
src/ApplicationInfo.php Makes embedded COMMIT take precedence over Composer-provided version/reference.
tests/Unit/ApplicationInfoTest.php Adds a regression test for embedded commit precedence over stale metadata.
.github/workflows/release.yml Stops passing YIIPRESS_COMMIT for tagged releases.
tests/Unit/Packaging/ConfigurationPackagingTest.php Updates assertions to match the release workflow changes.
docs/binaries-phar-docker.md Documents nightly install usage and the updated version-reporting behavior.
roadmap.md Marks “install newest nightly via YIIPRESS_VERSION=nightly” as completed.

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

Comment thread install.sh

@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)
tests/Unit/Packaging/InstallerTest.php (2)

79-88: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a second valid nightly candidate to test newest selection.

The page-two fixture has only one prerelease: true nightly. The assertion at Line 182 can pass without proving newest-candidate selection. Add an older valid nightly after nightly-42-1-abcdef123456.

Proposed fixture change
-            "[{\"prerelease\":false,\"draft\":false,\"tag_name\":\"nightly-41-1-deadbeef1234\"},"
-            . "{\"prerelease\":true,\"draft\":false,\"tag_name\":\"nightly-42-1-abcdef123456\"}]\n",
+            "[{\"prerelease\":false,\"draft\":false,\"tag_name\":\"nightly-40-1-deadbeef1234\"},"
+            . "{\"prerelease\":true,\"draft\":false,\"tag_name\":\"nightly-42-1-abcdef123456\"},"
+            . "{\"prerelease\":true,\"draft\":false,\"tag_name\":\"nightly-41-1-deadbeef1234\"}]\n",

Also applies to: 174-183

🤖 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 `@tests/Unit/Packaging/InstallerTest.php` around lines 79 - 88, Add a second
valid, older nightly release entry to the page-two fixture in the installer
test, placing it after nightly-42-1-abcdef123456 while keeping it prerelease and
non-draft. Preserve the existing assertions so the test verifies the newer
nightly candidate is selected.

184-196: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Assert that discovery stops after page 2.

The assertions at Lines 186-187 confirm requests for pages 1 and 2, but they do not reject page 3. A regression could continue pagination after finding a match and still pass this test.

Proposed assertion
         self::assertStringContainsString('/repos/test/engine/releases?per_page=100&page=2', $curlLog);
+        self::assertStringNotContainsString(
+            '/repos/test/engine/releases?per_page=100&page=3',
+            $curlLog,
+        );
🤖 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 `@tests/Unit/Packaging/InstallerTest.php` around lines 184 - 196, Extend the
curlLog assertions in the installer test to verify that no request is made for
the releases endpoint with page=3. Keep the existing positive assertions for
pages 1 and 2 and the download URLs unchanged.
🤖 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 `@tests/Unit/Packaging/InstallerTest.php`:
- Around line 79-88: Add a second valid, older nightly release entry to the
page-two fixture in the installer test, placing it after
nightly-42-1-abcdef123456 while keeping it prerelease and non-draft. Preserve
the existing assertions so the test verifies the newer nightly candidate is
selected.
- Around line 184-196: Extend the curlLog assertions in the installer test to
verify that no request is made for the releases endpoint with page=3. Keep the
existing positive assertions for pages 1 and 2 and the download URLs unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42b8308f-ee90-480c-a6d8-8dddbfacdfae

📥 Commits

Reviewing files that changed from the base of the PR and between 2d1263c and 1fbcdfb.

📒 Files selected for processing (5)
  • install.sh
  • src/ApplicationInfo.php
  • tests/Unit/ApplicationInfoTest.php
  • tests/Unit/Packaging/ConfigurationPackagingTest.php
  • tests/Unit/Packaging/InstallerTest.php
🚧 Files skipped from review as they are similar to previous changes (4)
  • install.sh
  • src/ApplicationInfo.php
  • tests/Unit/Packaging/ConfigurationPackagingTest.php
  • tests/Unit/ApplicationInfoTest.php

# Conflicts:
#	install.sh
#	tests/Unit/Packaging/InstallerTest.php
@samdark
samdark merged commit 9cbf269 into master Aug 5, 2026
13 checks passed
@samdark
samdark deleted the feat/nightly-installer branch August 5, 2026 09:13
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