feat(config): add support for output format configuration#300
Draft
neBM wants to merge 1 commit intomcuadros:masterfrom
Draft
feat(config): add support for output format configuration#300neBM wants to merge 1 commit intomcuadros:masterfrom
neBM wants to merge 1 commit intomcuadros:masterfrom
Conversation
2 tasks
nekrich
pushed a commit
to nekrich/ofelia
that referenced
this pull request
Feb 13, 2026
…labels (mcuadros#300) ## Summary This PR exposes the existing job dependency infrastructure via user-configurable INI file settings and Docker labels. - Added `gcfg` and `mapstructure` struct tags to `BareJob` dependency fields (`Dependencies`, `OnSuccess`, `OnFailure`) - Created comprehensive tests for dependency configuration parsing across all job types - Updated `CONFIGURATION.md` with full documentation and examples Closes mcuadros#299 ## Changes ### Core (`core/bare_job.go`) - Added `gcfg:"depends-on"` and `mapstructure:"depends-on,"` tags to `Dependencies` field - Added `gcfg:"on-success"` and `mapstructure:"on-success,"` tags to `OnSuccess` field - Added `gcfg:"on-failure"` and `mapstructure:"on-failure,"` tags to `OnFailure` field ### Tests (`cli/config_dependencies_test.go`) - `TestBuildFromString_WithDependencies` - Tests parsing of single and multiple dependencies - `TestBuildFromString_DependenciesAllJobTypes` - Verifies all job types (exec, run, local, service, compose) support dependencies - `TestBuildFromString_EmptyDependencies` - Verifies jobs without dependencies work correctly ### Documentation (`docs/CONFIGURATION.md`) - Added "Job Dependencies" section with complete usage examples - Documented INI file syntax with multiple `depends-on` lines - Documented Docker labels syntax for dependencies - Added configuration options table ## Usage Example ### INI Configuration ```ini [job-exec "init-database"] schedule = @daily container = postgres command = /scripts/init-db.sh [job-exec "backup-database"] schedule = @daily container = postgres command = /scripts/backup.sh depends-on = init-database on-success = notify-complete on-failure = alert-ops ``` ### Docker Labels ```yaml labels: ofelia.job-exec.process.depends-on: "setup" ofelia.job-exec.process.on-success: "cleanup" ofelia.job-exec.process.on-failure: "alert" ``` ## Test plan - [x] All existing tests pass - [x] New dependency configuration tests pass - [x] Linting passes - [x] Verified struct tags match existing patterns in codebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Logging events with a hardcoded logging format adds to complexity when submitted to logging agros such as an ELK stack.
Short of bringing in encoders to keep the implementation as lightweight as possible, this MR adds support for docker label injected logging format strings.