Repository navigation
Conversation
ReleaseStatus::canTransitionTo() now defines which status changes are allowed, and every status write in Releases goes through Release::transitionTo(). It updates the row only if its status is still the one it was read with. The unschedule and publish guards, the publish and schedule policy checks, the publish modal and the "can unschedule" flag all read the same table instead of their own status lists. unscheduleIfEmpty() now reloads the release first. Applying a scheduled release's last draft early already unschedules it through withElementDeletion(), and the second write came from an outdated copy. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4 Co-authored-by: Amp <amp@ampcode.com>
A release only enters Publishing inside the publication transaction, so a failure normally rolls it back. When something commits that transaction early, such as a MySQL statement with an implicit commit, the release stayed Publishing, and nothing can publish, schedule or delete a release in that status. publishRelease() now moves a release that's still Publishing after its publication threw to Failed, and notifies release managers. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
Until a release publishes, publishedAt holds the time it's scheduled for. The releases_get description now says so, so agents don't read a future date as the time it was published. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d1-9981-7090-9108-69125aec9ad4
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
This branch has not been deployed
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.
Description
Release status checks were repeated in five places, and nothing could move a release out of
Publishing.ReleaseStatus::canTransitionTo()is now the single table, and every status write goes throughRelease::transitionTo()as a compare-and-set.ReleasePolicy,ReleasesControllerandReleaseViewModeluse the table instead of their own status lists.Publishingafter its publication throws, such as when MySQL commits the transaction implicitly, moves toFailed, and managers are notified.releases_getdescription says a futurepublishedAtis the scheduled time.Evidence
Publishing, which every action rejects.After:
Releases::publishRelease()moves it toFailed.ReleasesTestcovers the transition table and the guards that now use it.