Skip to content

Automate reviewed plugin releases from editor updates - #118

Merged
erseco merged 7 commits into
mainfrom
automation/release-preparation-pr
Aug 7, 2026
Merged

Automate reviewed plugin releases from editor updates#118
erseco merged 7 commits into
mainfrom
automation/release-preparation-pr

Conversation

@erseco

@erseco erseco commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace editor-pin-only PRs with a single automated, reviewable release-preparation PR.
  • Commit .editor-version, the Moodle Playground editor pin and final version.php metadata together.
  • Allocate a real monotonic Moodle version (YYYYMMDDXX) without rewriting release metadata during packaging.
  • Publish the plugin automatically only after the preparation PR is reviewed and merged.
  • Trigger publication from a push to main that changes .editor-version, so unrelated closed/merged PRs do not create skipped Release workflow runs.
  • Tag the exact reviewed release commit, build the editor from the matching editor tag, create the reproducible ZIP and publish the GitHub release.
  • After publication succeeds, return main to development in the same workflow by incrementing the real Moodle version and setting $plugin->release = 'dev'.
  • Update DEVELOPMENT.md and DEC-111-01 to document the complete lifecycle.

Automated release flow

  1. The daily watcher detects a new exelearning/exelearning release such as v4.0.3.
  2. It opens Prepare plugin release v4.0.3 containing:
    • .editor-version = v4.0.3;
    • the matching Moodle Playground pin;
    • the final monotonic $plugin->version;
    • $plugin->release = '4.0.3'.
  3. CI and maintainers review the PR.
  4. Merging it changes .editor-version on main, which triggers release.yml. Other PRs do not trigger this workflow.
  5. The release workflow validates the committed metadata and creates v4.0.3 on that exact merged commit.
  6. It builds the editor from editor tag v4.0.3, creates the reproducible ZIP and publishes the GitHub release.
  7. Only after publication succeeds, the same workflow checks out current main, increments $plugin->version, sets $plugin->release = 'dev', validates that development state and pushes Start development after v4.0.3.

The post-release commit only changes version.php, so it does not satisfy the .editor-version path filter and cannot cause a release loop. The published tag remains on the immutable release commit.

Versioning and reproducibility

The package still ships version.php byte-identical to the tagged commit. No release metadata is derived or rewritten during packaging. The post-release development commit occurs only after the tag and release exist, so it cannot alter what vX.Y.Z contains.

This preserves the core guarantees of DEC-111-01 while removing the previous manual second PR used only to return main to dev.

Validation and safety

  • scripts/check-version.sh --release X.Y.Z runs before the preparation PR is opened and again before publication.
  • The workflow verifies that the plugin tag points to the exact release commit.
  • The post-release state is validated with scripts/check-version.sh before it is pushed.
  • The workflow refuses the post-release update if the tagged release commit is no longer an ancestor of current main.
  • If branch protection rejects the final development push, the already-published release remains valid and immutable; only the return-to-development step fails.

v4.0.3 migration

The old editor-pin-only PR #117 has been closed without merging. After this PR lands, the editor watcher will still see v4.0.3 as newer than the .editor-version on main and can generate the new-style Prepare plugin release v4.0.3 PR.


Moodle Playground Preview

The changes in this pull request can be previewed and tested using a Moodle Playground instance.

Preview in Moodle Playground

ℹ️ The eXeLearning editor is fetched from the shared release and unpacked into the plugin when the playground boots, so the first load may take a few extra seconds. ELPX upload, viewer and preview work normally.

@codecov-commenter

codecov-commenter commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.31%. Comparing base (a232775) to head (79bcd40).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #118   +/-   ##
=========================================
  Coverage     92.31%   92.31%           
  Complexity      824      824           
=========================================
  Files            51       51           
  Lines          3734     3734           
=========================================
  Hits           3447     3447           
  Misses          287      287           
Flag Coverage Δ
javascript 94.11% <ø> (ø)
php 92.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
PHP (server-side) 92.23% <ø> (ø)
JavaScript (SCORM tracker) 94.11% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erseco
erseco merged commit 6327499 into main Aug 7, 2026
24 checks passed
@erseco
erseco deleted the automation/release-preparation-pr branch August 7, 2026 13:28
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