Add weekly GitHub action cron job to check for new PHP versions - #4026
Conversation
bcotrim
left a comment
There was a problem hiding this comment.
Great improvement, some suggestions:
- Skip dispatch if the version’s already on the CDN. If the bump PR sits unmerged, the next cron re-builds all 4 platforms and only fails at upload so the whole build is wasted.
- Alert on failure. Let's add a Slack ping if this fails, we already do it on other CI checks, so it should be easy to add. Could be a follow-up if it's not as straightforward as I am assuming.
- Expose error_on_duplicate as a dispatch input (default true). Just to make it easier for a manual run to allow an overwrite. Let's say we notice an issue in a nightly build, we could manually trigger an overwrite without any side effects to our users.
Good idea 👍 Updated.
Ditto 👍
I disagree here. I think we should be super careful about updating existing packages on appscdn, because local Studio installs expect a certain checksum for those packages. If the checksum doesn't match, those Studio installs will stop being able to install those PHP versions. You and I discussed this a while back and concluded that we should probably get creative about the version numbers we use for PHP packages to mitigate this (i.e., make it so that we are able to rebuild PHP versions that are already on the CDN without breaking existing Studio installs). |
That's fair, I was being optimistic about the runner but you make a very good point, a mistake on an updated version would result in a breaking state for our users. 👍 |
…on` field to identify PHP packages (#4042) ## Related issues <!-- Link a related issue to this PR. If the PR does not immediately resolve the issue, for example, it requires a separate deployment to production, avoid using the "Fixes" keyword and use "Related to" instead. --> - Related to STU-1972 ## How AI was used in this PR <!-- Help reviewers understand what to look for and verify that you've reviewed the code yourself. --> Codex drove the implementation based on previous diagnosis. ## Proposed Changes <!-- Explain the intent of this PR: - What problem does it solve, or what need does it address? - How does it affect the user (new capability, fix, performance, accessibility, etc.)? - Note any user-visible behavior changes or trade-offs. Focus on the "why" and the user impact. Avoid listing modified files or describing implementation mechanics — the diff already shows that. --> Sentry shows that some users are running into `PHP command failed (code: 3221225781)` errors. This is because of missing DLLs on their system – very likely the Visual C++ Redistributable ones, as PHP explicitly [names that dependency](https://www.php.net/downloads.php?os=windows#instructions). This PR updates the native PHP build workflow to include the necessary DLLs next to `php.exe`. Because there aren't new PHP patch versions available yet for every minor PHP version we offer, I also had to find a way to rebuild PHP versions that already exist on appscdn. This cannot be done today without breaking local Studio installations, because they expect the appscdn package to have a predefined checksum. If the checksum of the appscdn package changes, the Studio client will refuse to install it. The solution is to add a `packageVersion` field that identifies the package version separately from the PHP version. The workflow sets this to `studio-1` by default – meaning a typical workflow run (that builds a new PHP version) can just use the default. Moreover, I've set `error_on_duplicate` to always be true (same as in #4026, which I mistakenly merged to another branch than trunk) ## Testing Instructions <!-- Add as many details as possible to help others reproduce the issue and test the fix. "Before / After" screenshots can also be very helpful when the change is visual. --> I'll manually verify that these builds do what we want on Windows. ## Pre-merge Checklist <!-- Complete applicable items on this checklist **before** merging into trunk. Inapplicable items can be left unchecked. Both the PR author and reviewer are responsible for ensuring the checklist is completed. --> - [ ] Have you checked for TypeScript, React or other console errors?
…ions (#4052) ## Related issues <!-- Link a related issue to this PR. If the PR does not immediately resolve the issue, for example, it requires a separate deployment to production, avoid using the "Fixes" keyword and use "Related to" instead. --> - Fixes RSM-4591 ## How AI was used in this PR <!-- Help reviewers understand what to look for and verify that you've reviewed the code yourself. --> Codex executed the implementation with iterative driving instructions from me. ## Proposed Changes <!-- Explain the intent of this PR: - What problem does it solve, or what need does it address? - How does it affect the user (new capability, fix, performance, accessibility, etc.)? - Note any user-visible behavior changes or trade-offs. Focus on the "why" and the user impact. Avoid listing modified files or describing implementation mechanics — the diff already shows that. --> See description in #4026. I mistakenly merged that PR to the base branch `codex/remove-tsx-from-scripts` before #4021 has been merged to `trunk` (which is the workflow I want). This PR applies the changes from #4026 again, and it'll be merged after the base PR. ## Testing Instructions <!-- Add as many details as possible to help others reproduce the issue and test the fix. "Before / After" screenshots can also be very helpful when the change is visual. --> See #4026 ## Pre-merge Checklist <!-- Complete applicable items on this checklist **before** merging into trunk. Inapplicable items can be left unchecked. Both the PR author and reviewer are responsible for ensuring the checklist is completed. --> - [ ] Have you checked for TypeScript, React or other console errors? --------- Co-authored-by: bcotrim <bernardo.cotrim@a8c.com>
Related issues
How AI was used in this PR
Codex executed the implementation with iterative driving instructions from me.
Proposed Changes
The
Build PHP CLI BinariesGitHub Actions workflow gives us a really smooth way of building new PHP binaries for all platforms. Input a PHP version and setapps_cdn_visibilitytoexternal, and you get a PR back that modifies thephp-binary-cdn-metadata.mjsfile. The missing piece is automation that looks for new PHP versions and automatically triggers those builds. This PR adds it as a weekly GitHub Actions cron job.For added safety, I've changed the
error_on_duplicateparameter in theBuild PHP CLI Binariesjob to true. Overwriting existing appscdn packages would lead to errors in some local Studio CLI installations. We should only do that if we really know what we're doing.Testing Instructions
GH_TOKEN=xxxxxx node scripts/check-php-cli-versions.mjs(this will only generate output and not trigger a CI workflow run)Pre-merge Checklist