Skip to content

fix: handle RuntimeLevel.Upgrading in CanAutoPublish#484

Draft
gavinfaux wants to merge 8 commits into
Shazwazza:developfrom
gavinfaux:pr/autopublish
Draft

fix: handle RuntimeLevel.Upgrading in CanAutoPublish#484
gavinfaux wants to merge 8 commits into
Shazwazza:developfrom
gavinfaux:pr/autopublish

Conversation

@gavinfaux
Copy link
Copy Markdown
Contributor

@gavinfaux gavinfaux commented May 29, 2026

  • Change CanAutoPublish guard from 'is not RuntimeLevel.Run' to 'is RuntimeLevel.Boot or RuntimeLevel.BootFailed or RuntimeLevel.Unknown' so Umbraco 17's new RuntimeLevel.Upgrading does not block auto-publish after unattended install, without breaking Umbraco 16 where the enum value does not exist.
  • Add diagnostic logging showing RuntimeLevel and AutoPublishOnStartup values to aid future debugging.

Depends on #488 (needs Umbraco 17.4 for RuntimeLevel.Upgrading).

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR bumps the minimum Umbraco 17 requirement to 17.4.0 and fixes CanAutoPublish to allow publishing when RuntimeLevel.Upgrading (new in Umbraco 17) is active, so unattended installs are no longer silently skipped.

  • The guard in CanAutoPublish is updated via #if NET10_0_OR_GREATER to an allowlist of Run or Upgrading (net10) while keeping the original is not RuntimeLevel.Run guard unchanged on net9, avoiding a compilation break on Umbraco 16.
  • A new #if NET10_0_OR_GREATER test verifies that ImportedPackageNotification triggers a publish when RuntimeLevel.Upgrading is active; the diagnostic log at the start of CanAutoPublish was moved to LogDebug.
  • Accompanying changes include toolchain/dependency version bumps, removal of OpenMcdf package references, and documentation updates reflecting the new minimum version.

Confidence Score: 5/5

Safe to merge; the #if NET10_0_OR_GREATER guard is correct and the targeted behavioural change is well-tested for the primary ImportedPackageNotification path.

The core logic change — allowlisting RuntimeLevel.Run or RuntimeLevel.Upgrading on net10 — directly achieves the stated goal without affecting net9 behaviour. The #if boundary is clean, the new test correctly validates the unattended-install scenario, and all other changes are version/toolchain bumps. The only gap is a missing test for the MigrationPlansExecutedNotification path at RuntimeLevel.Upgrading, but since both paths share the same CanAutoPublish method the fix is indirectly covered.

src/Articulate.Tests/Migrations/ArticulateMigrationPlanExecutedHandlerTests.cs — consider adding a MigrationPlansExecutedNotification test at RuntimeLevel.Upgrading to mirror the new ImportedPackageNotification test.

Important Files Changed

Filename Overview
src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs Core fix: #if NET10_0_OR_GREATER allowlist adds RuntimeLevel.Upgrading alongside Run; diagnostic log moved to LogDebug. Logic is correct for the stated goal; test coverage for the MigrationPlansExecutedNotification path with Upgrading is absent.
src/Articulate.Tests/Migrations/ArticulateMigrationPlanExecutedHandlerTests.cs New NET10_0_OR_GREATER test verifies ImportedPackageNotification publishes at RuntimeLevel.Upgrading; no corresponding test for MigrationPlansExecutedNotification at Upgrading.
Directory.Build.props Minimum Umbraco 17 version bumped to 17.4.0 from 17.2.2; OpenMcdfPackageVersion properties removed from both TFM groups.
.github/workflows/build.yml Action versions bumped; .NET SDK versions switched from pinned patch (9.0.309 / 10.0.201) to wildcard (9.0.x / 10.0.x); pnpm setup switched to read packageManager from package.json.
global.json SDK rollForward policy changed from latestPatch (10.0.201) to latestFeature (10.0.100), allowing any feature band within 10.0 — intentionally more permissive to match CI wildcard change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Notification fired\nMigrationPlansExecuted\nor ImportedPackage] --> B[CanAutoPublish]
    B --> C{NET10_0_OR_GREATER?}
    C -- Yes --> D{RuntimeLevel is\nRun or Upgrading?}
    C -- No --> E{RuntimeLevel is\nRun?}
    D -- No --> F[return false\nskip publish]
    D -- Yes --> G{AutoPublishOnStartup\nenabled?}
    E -- No --> F
    E -- Yes --> G
    G -- No --> F
    G -- Yes --> H[return true\nproceed to publish]
    H --> I{Which notification?}
    I -- MigrationPlansExecuted --> J{HasMigrationRun?}
    I -- ImportedPackage --> K{installedRoots.Count > 0?}
    J -- No --> F
    J -- Yes --> L[PublishArticulateRoots\nGetAllArticulateRoots\nForceRepublish filter]
    K -- No --> F
    K -- Yes --> M[PublishArticulateRoots\nInstalledRoots only\nAll filter for new roots]
Loading

Reviews (9): Last reviewed commit: "fix: restore package_json_file for pnpm ..." | Re-trigger Greptile

Comment thread src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs Outdated
Comment thread src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs Outdated
Comment thread src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs Outdated
Comment thread src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs Outdated
@gavinfaux
Copy link
Copy Markdown
Contributor Author

Still relevant, RuntimeLevel.Upgrading was added in 17.3.0 and I've missed a PR for bumping to 17.4.0 before this, will resolve today.

@gavinfaux gavinfaux marked this pull request as draft June 2, 2026 09:10
@gavinfaux
Copy link
Copy Markdown
Contributor Author

This branch was developed on top of pr/17.4 locally because RuntimeLevel.Upgrading support requires the newer 17.3+ API.

@gavinfaux gavinfaux marked this pull request as ready for review June 2, 2026 20:54
Copilot AI review requested due to automatic review settings June 2, 2026 20:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates Articulate’s Umbraco 17 baseline to 17.4.0, refreshes several dependency/tooling versions, and adjusts auto-publish behavior/logging around migrations/package imports.

Changes:

  • Bump minimum Umbraco 17 requirement from 17.2.2 to 17.4.0 across docs, build props, and Docker defaults.
  • Update dependencies/tooling (FileSignatures, Markdig, pnpm, test SDK) and remove OpenMcdf references.
  • Broaden runtime levels that allow post-migration auto-publish and reduce log noise by shifting many messages to Debug.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
umbraco-marketplace-readme.md Updates Umbraco 17 minimum version to 17.4.0.
src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs Adjusts auto-publish gating by runtime level and changes log levels.
src/Articulate/Articulate.csproj Updates NuGet package versions; removes OpenMcdf reference.
src/Articulate.Web/Client/package.json Updates pnpm packageManager version.
src/Articulate.Web/Articulate.Web.csproj Mirrors dependency updates/removal from core project.
src/Articulate.Tests/Migrations/ArticulateMigrationPlanExecutedHandlerTests.cs Adds net10-only test for RuntimeLevel.Upgrading behavior.
src/Articulate.Tests/Articulate.Tests.csproj Updates test SDK; removes OpenMcdf reference.
src/Articulate.Tests.Website/Articulate.Tests.Website.csproj Removes OpenMcdf reference.
global.json Updates .NET SDK selection/roll-forward strategy.
docker-compose.yml Updates default Umbraco CMS version range to start at 17.4.0.
build/docker-site/ArticulateDockerSite.csproj Removes OpenMcdf reference.
RELEASE_NOTES.md Updates documented minimum Umbraco 17 version.
README.md Updates documented minimum Umbraco 17 version.
Dockerfile Updates base images and default Umbraco version range.
Directory.Build.props Updates Umbraco 17 package range; removes OpenMcdf version property.
.github/workflows/build.yml Updates GH Actions versions and .NET/pnpm setup behavior.
.devcontainer/Dockerfile Updates pnpm version used in devcontainer.

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

Comment thread Dockerfile
Comment thread Dockerfile
Comment thread Dockerfile
Comment thread global.json
Comment thread src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs
Comment thread src/Articulate/Migrations/ArticulateMigrationPlanExecutedHandler.cs
@gavinfaux gavinfaux marked this pull request as draft June 2, 2026 21:34
@gavinfaux gavinfaux marked this pull request as ready for review June 3, 2026 16:48
gavinfaux added 6 commits June 4, 2026 02:00
- bump Markdig 0.45.0 (match Umbraco 17.4.0)
- bump FileSignatures 7.1 (updates transitive dependency OpenMcdf to 3.1.4)
- bump Microsoft.NET.Test.Sdk 18.4.0
- bump pnpm 11.4.0 and reinstall dependencies
- bump GitHub actions to latest
- amend dotnet version to dynamically match newest feature band
- Change CanAutoPublish guard from 'is not RuntimeLevel.Run' to
  'is RuntimeLevel.Boot or RuntimeLevel.BootFailed or RuntimeLevel.Unknown'
  so Umbraco 17's new RuntimeLevel.Upgrading does not block auto-publish
  after unattended install, without breaking Umbraco 16 where the enum
  value does not exist.
- Add diagnostic logging showing RuntimeLevel and AutoPublishOnStartup
  values to aid future debugging.
Change initial CanAutoPublish log to Debug to reduce info noise and clarify when auto-publish checks run. Replace the previous Boot/BootFailed/Unknown check with an explicit allowlist (RuntimeLevel.Run, Install, Upgrade) so migration/publish tasks are only considered in valid runtime scenarios. Update log message wording and add a comment explaining the rationale.
Migration plans run at Run for normal/manual path's, or Upgrading for unattended - `RuntimeLevel.Upgrading` added in Umbraco 17.3
    path
gavinfaux added 2 commits June 4, 2026 02:21
- bump Markdig 0.45.0 (match Umbraco 17.4.0)
- bump FileSignatures 7.1 (updates transitive dependency OpenMcdf to 3.1.4)
- bump Microsoft.NET.Test.Sdk 18.4.0
- bump pnpm 11.4.0 and reinstall dependencies
- bump GitHub actions to latest
- amend dotnet version to dynamically match newest feature band
@gavinfaux gavinfaux marked this pull request as draft June 5, 2026 11:33
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.

3 participants