Skip to content

Backport 4.x review fixes to 3.x JSON configuration#3015

Merged
lahma merged 1 commit into
3.xfrom
json-settings-fixes
Apr 5, 2026
Merged

Backport 4.x review fixes to 3.x JSON configuration#3015
lahma merged 1 commit into
3.xfrom
json-settings-fixes

Conversation

@lahma

@lahma lahma commented Apr 5, 2026

Copy link
Copy Markdown
Member

Summary

Backports all improvements from Copilot review rounds on the 4.x PR (#3014) to the 3.x branch.

  • Input validation: TryParse for all user-provided values (Priority, StartTime, EndTime, TimeSpan intervals, Enum values, booleans) with contextual SchedulerConfigException messages
  • Null safety: Validate TypeLoadHelper.LoadType return, JobDataMap entry values
  • Error context: Wrap CronScheduleBuilder.CronSchedule() with try-catch, TimeOfDay range validation
  • Configuration detection: Simplified HasDirectSchedulerConfiguration to catch non-reserved scalar keys (typo detection)
  • Plugin hardening: License headers, reflection-based misfire parsing (avoids internal Constants dependency), SchedulerException captured in Start catch block
  • Test coverage: TestJsonSchedulingPlugin for UseJsonSchedulingConfiguration extension method

Test plan

  • 1355 tests pass, 0 fail (net10.0)
  • All new and existing JSON configuration tests pass

🤖 Generated with Claude Code

Port improvements from Copilot review rounds on the 4.x PR (#3014):

- Validate TypeLoadHelper.LoadType return for null
- Validate JobDataMap entries are non-null strings
- Replace all raw Parse calls with TryParse + contextual errors
  (Priority, StartTime, EndTime, TimeSpan, Enum, bool)
- Add SafeParseInt, SafeParseTimeSpan, SafeParseEnum helpers
- Validate TimeOfDay range (00:00:00-23:59:59) with TryParse
- Wrap CronScheduleBuilder.CronSchedule with try-catch
- Simplify HasDirectSchedulerConfiguration to catch all non-reserved keys
- Add license headers to all plugin files
- Replace Constants-based misfire parsing with reflection in Plugins
  processor (avoids internal type dependency)
- Add TestJsonSchedulingPlugin test for UseJsonSchedulingConfiguration

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Apr 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
7.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@lahma
lahma merged commit f248417 into 3.x Apr 5, 2026
15 of 16 checks passed
@lahma
lahma deleted the json-settings-fixes branch April 5, 2026 20:05
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.

1 participant