Skip to content

Comments

feat: add config schema#1639

Merged
yottahmd merged 2 commits intomainfrom
config-schema
Feb 6, 2026
Merged

feat: add config schema#1639
yottahmd merged 2 commits intomainfrom
config-schema

Conversation

@yottahmd
Copy link
Collaborator

@yottahmd yottahmd commented Feb 6, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added configuration schema validation support for enhanced configuration file validation.
    • New endpoint available to serve the configuration schema alongside the existing schema endpoint.
    • Schema headers now dynamically reflect schema type for improved clarity.
  • Tests

    • Updated schema validation tests to reflect new schema naming behavior.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This PR adds JSON schema support for the Dagu configuration file. A new config.schema.json file is introduced with comprehensive schema definitions, exposed via ConfigSchemaJSON, integrated into schema registration with a helper function, and served by the frontend server alongside the existing DAG schema with dynamic schema-aware headers.

Changes

Cohort / File(s) Summary
Schema Registration
internal/agent/schema/embed.go, internal/cmn/schema/schema.go
Introduces mustRegister helper function to register schemas with generalized error handling; adds embedding and export of ConfigSchemaJSON for the new config schema.
Dynamic Header Formatting
internal/agent/schema/registry.go, internal/agent/schema/registry_test.go
Adds capitalizeFirst helper function and schemaName field to navigator struct for dynamic, schema-aware header generation; updates test assertion to match new behavior.
Configuration Schema Definition
internal/cmn/schema/config.schema.json
New comprehensive JSON schema defining Dagu base configuration structure with properties for server, UI, authentication, permissions, paths, monitoring, and distributed coordination features.
Schema Serving
internal/service/frontend/server.go
Adds server-side route handler to serve config.schema.json alongside existing dag.schema.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: add config schema' directly matches the main objective of this changeset, which introduces a comprehensive JSON schema definition for Dagu configuration and makes it available throughout the application.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch config-schema

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.

@yottahmd yottahmd merged commit 2a21bcf into main Feb 6, 2026
5 checks passed
@yottahmd yottahmd deleted the config-schema branch February 6, 2026 14:26
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.79%. Comparing base (fd7fabe) to head (35ece54).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
internal/agent/schema/embed.go 60.00% 1 Missing and 1 partial ⚠️
internal/agent/schema/registry.go 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1639      +/-   ##
==========================================
- Coverage   69.79%   69.79%   -0.01%     
==========================================
  Files         331      331              
  Lines       37248    37256       +8     
==========================================
+ Hits        25999    26003       +4     
- Misses       9185     9192       +7     
+ Partials     2064     2061       -3     
Files with missing lines Coverage Δ
internal/agent/schema/embed.go 66.66% <60.00%> (+33.33%) ⬆️
internal/agent/schema/registry.go 89.06% <80.00%> (-0.58%) ⬇️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8cf041...35ece54. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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