Skip to content

Respect workflow resolution for scheduled publishing#36594

Open
riccardoruocco wants to merge 1 commit into
dotCMS:mainfrom
riccardoruocco:fix/publish-date-workflow-resolution
Open

Respect workflow resolution for scheduled publishing#36594
riccardoruocco wants to merge 1 commit into
dotCMS:mainfrom
riccardoruocco:fix/publish-date-workflow-resolution

Conversation

@riccardoruocco

@riccardoruocco riccardoruocco commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Add the opt-in PUBLISH_JOB_QUEUE_RESPECT_WORKFLOW_RESOLUTION configuration flag, disabled by default.
  • When enabled, prevent PublishDateUpdater from locally publishing scheduled content unless its current workflow step is resolved.
  • Add PUBLISH_JOB_QUEUE_RESPECT_WORKFLOW_RESOLUTION_SCHEMES to optionally scope the check to comma-separated workflow scheme IDs or variable names.
    • Empty value: apply the resolution check to all workflows.
    • Configured value: apply it only to the listed workflows.
  • Keep immediate publishing, push publishing, and scheduled expiration/unpublishing unchanged.
  • Fail closed for each affected content item when its workflow state cannot be determined.
  • Ensure failed or missing content items still count toward batch transaction boundaries, so the transaction is always closed.
  • Add tests covering:
    • default and explicitly disabled flag behavior;
    • global behavior when the workflow list is empty;
    • resolved and unresolved workflow steps;
    • configured and non-configured workflows;
    • content without a current workflow step;
    • workflow lookup failures;
    • transaction closure after a workflow lookup failure;
    • scheduled expiration remaining unaffected.

Checklist

  • Tests
  • Translations — not applicable
  • Security Implications Contemplated

Additional Info

This change only affects local publishing triggered by PublishDateUpdater when a scheduled publishDate matures.

The main flag defaults to false, preserving the existing dotCMS behavior. When enabled with an empty workflow list, scheduled publishing is allowed only when the content's current workflow step has resolved=true. When workflow scheme IDs or variable names are configured, the gate applies only to those workflows.

For content without a current step, the global mode keeps the conservative behavior and blocks scheduled publication. In scoped mode, it blocks only when the content type is assigned to one of the configured workflow schemes.

Immediate workflow publishing and push publishing are not intercepted by this check. Scheduled expiration/unpublishing is also unaffected.

Workflow lookup failures are handled conservatively: the affected content item is not published, processing continues for the remaining items, and the batch transaction is still closed.

Validation performed:

  • PublishDateUpdaterTest: 11 tests passed.
  • Focused Maven test run completed successfully on the latest main.
  • git diff --check passed.
  • The PR changes only three files; OpenAPI output is unaffected.

Screenshots

Not applicable — backend-only change with no UI modifications.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0860e845f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Make the scheduled publishing workflow gate optionally scheme-selective and ensure failed workflow lookups still close the batch transaction.
@riccardoruocco
riccardoruocco force-pushed the fix/publish-date-workflow-resolution branch from 0860e84 to d60c7a8 Compare July 16, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant