fix(preview): keep builds installed and updatable - #127
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CA PR previews now publish successfully, remain recognized as installed on the Apps page, and continue receiving updates from their stable per-PR channel.
Why This Exists
The trusted publisher could publish preview files but failed with
403 Resource not accessible by integrationwhen it tried to create the installer comment. Separately, CA's installed-state check treated strictpluginURLequality as identity. A preview needs a per-PRpluginURLfor updates, but that made the canonical CA app-feed entry appear uninstalled. Live artifact inspection also found GNUcpnesting the package below./community.applications/, unlike the local BSDcpbuild, so CI previews did not place files at the filesystem root expected byupgradepkg.Resolution
Grant the trusted publisher the pull-request write permission GitHub requires. Keep the canonical
community.applicationsplugin name for WebGUI paths, retain the per-PRpluginURLas the preview update channel, and recognize only official numeric CA PR-preview URLs as aliases of the canonical CA app-feed template. Build deterministic archives with normalized metadata and reject any archive that does not contain CA'sApps.pageat the expected package-root path. CI independently builds on Linux and macOS, byte-compares every output, and publishes only the verified result.This changes the real CA installed-state matcher, not the built package after generation. The builder only supplies the preview version, package metadata, and per-PR update URL.
Reviewer Considerations
pr-previewsbranch, numericpr/<number>path, andcommunity.applications.plgfilename.cpbehavior from publishing a structurally invalid package.-pr<number>-<sha>for operator visibility.workflow_runboundary and all other workflow permissions remain unchanged.Behavior Changes
Implementation Summary
pull-requestspermission fromreadtowritein the trusted publisher.checkInstalledPlugin()through that matcher.namecanonical while restoring the per-PRpluginURLin generated manifests.ca.md5integrity manifest.Verification
actionlint .github/workflows/pr-preview-publish.ymlbash -n scripts/build-pr-preview.shshellcheck scripts/build-pr-preview.shphp tests/test_plugin_identity.php, all eight cases pass../usr/local/emhttp/plugins/community.applications/Apps.pageand has no nested./community.applications/package root.diff -rreports identical package, manifest, and JSON output.md5sum -c ca.md5integrity check.git diff --checkRisk
Low; the exception is scoped to official CA preview URLs, has negative coverage for neighboring URL shapes, and preserves the existing exact-match rule for every other plugin. The builder and CI both fail closed when output structure or bytes diverge across platforms.