Skip to content

Skip setting startInPauseMode property in tasks based on a property#2556

Open
sajinieKavindya wants to merge 1 commit into
wso2:masterfrom
sajinieKavindya:master
Open

Skip setting startInPauseMode property in tasks based on a property#2556
sajinieKavindya wants to merge 1 commit into
wso2:masterfrom
sajinieKavindya:master

Conversation

@sajinieKavindya

Copy link
Copy Markdown
Member

$subject

Setting the startInPauseMode property based on the value of skipStartInPauseModeAssignment property in taskdescription.

@sajinieKavindya sajinieKavindya requested a review from chanikag as a code owner May 11, 2026 10:51
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18e0bd0c-499c-4fcf-a9e1-5b1739601b17

📥 Commits

Reviewing files that changed from the base of the PR and between a36768d and 6bfb982.

📒 Files selected for processing (2)
  • modules/core/src/main/java/org/apache/synapse/startup/quartz/StartUpController.java
  • modules/tasks/src/main/java/org/apache/synapse/task/TaskConstants.java

📝 Walkthrough

Overview

This pull request introduces conditional configuration of the task startInPauseMode property. The change allows tasks to skip the automatic startup-state assignment from the registry when a specific flag is set.

Changes

TaskConstants.java

  • Added new constant SKIP_START_IN_PAUSED_MODE_ASSIGNMENT to allow tasks to control whether startup pause mode should be configured from the registry

StartUpController.java

  • Modified the init() method to check for the skipStartInPauseModeAssignment property during task initialization
  • When this property is set to true, the controller skips calling configureStartupStateFromRegistry(), preserving the task's default startup behavior
  • When absent or false, the existing behavior is maintained, allowing startup pause mode to be configured from the registry

Impact

This change provides greater flexibility in managing task startup behavior by allowing individual tasks to opt out of automatic registry-based startup-state configuration while maintaining backward compatibility for existing tasks.

Walkthrough

This pull request adds conditional control over startup-state registry configuration. A new task property constant SKIP_START_IN_PAUSED_MODE_ASSIGNMENT is introduced in TaskConstants. The StartUpController.init(...) method is then updated to read this property from the task description; when the flag is set to true, the method skips calling configureStartupStateFromRegistry(taskDescription), allowing tasks to bypass persisted pause-mode state restoration from the registry.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and lacks required sections from the template including Purpose, Goals, Approach, Release notes, Documentation, Testing, and Security checks. Expand the description to include all template sections: Purpose (with issue links), Goals, Approach, Release notes, Documentation impact, and relevant Testing/Security information.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: conditionally skipping the setting of startInPauseMode property based on a property flag.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-out mechanism so a startup task’s startInPausedMode is not overridden from the persisted registry state when a skipStartInPauseModeAssignment flag is set on the TaskDescription.

Changes:

  • Introduced TaskConstants.SKIP_START_IN_PAUSED_MODE_ASSIGNMENT constant.
  • Updated StartUpController.init() to conditionally skip configureStartupStateFromRegistry(taskDescription) based on the new flag.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
modules/tasks/src/main/java/org/apache/synapse/task/TaskConstants.java Adds a constant key for the new TaskDescription flag.
modules/core/src/main/java/org/apache/synapse/startup/quartz/StartUpController.java Conditionally skips applying registry-derived paused/active state based on the new flag.

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

Comment on lines +356 to +360
boolean skipConfiguringStartupState = false;
Object skipConfiguringStartupStateProp = taskDescription.getProperty(TaskConstants.SKIP_START_IN_PAUSED_MODE_ASSIGNMENT);
if (skipConfiguringStartupStateProp != null) {
skipConfiguringStartupState = Boolean.parseBoolean((String) skipConfiguringStartupStateProp);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This property is explicitly set in product-integrator-mi repo by calling taskDescription.addProperty(TaskConstants.SKIP_START_IN_PAUSED_MODE_ASSIGNMENT, "true");

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