Skip to content

Add --validate config-check mode#6

Open
uttam12331 wants to merge 1 commit into
peopleworks:masterfrom
uttam12331:feat/3-validate-mode
Open

Add --validate config-check mode#6
uttam12331 wants to merge 1 commit into
peopleworks:masterfrom
uttam12331:feat/3-validate-mode

Conversation

@uttam12331

Copy link
Copy Markdown

Closes #3.

Adds a --validate (alias --check) mode that loads appsettings.json, validates every job in ScheduledCommands (required Id/Command, a parseable CronExpression via Cronos, and a resolvable TimeZone via the existing TimeZoneHelper), prints a per-job report, and executes nothing. It exits 0 when all jobs are valid and non-zero otherwise — useful as a pre-deploy or CI gate.

  • New ConfigValidator reuses the existing ScheduledCommand model and TimeZoneHelper checks.
  • Program.Main short-circuits to validation before building the host, so no commands run.
  • Documented in the README Quick start.

Verified locally: dotnet build clean; valid config -> exit 0, broken cron / missing command -> exit 1 with a clear per-job report; confirmed no commands execute.

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.

Add a --validate mode to check config without executing jobs

1 participant