Skip to content

feat: add defaults envs for auto compose#10

Merged
Crow-Control merged 2 commits into
mainfrom
compose-env-defaults
Feb 18, 2026
Merged

feat: add defaults envs for auto compose#10
Crow-Control merged 2 commits into
mainfrom
compose-env-defaults

Conversation

@Crow-Control
Copy link
Copy Markdown
Member

Description

⚒️ Fixes #

⚙️ Type of change

  • ⚙️ Feature/App addition
  • 🪛 Bugfix
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🔃 Refactor of current code
  • 📜 Documentation Changes

🧪 How Has This Been Tested?

📃 Notes:

✔️ Checklist:

  • ⚖️ My code follows the style guidelines of this project
  • 👀 I have performed a self-review of my own code
  • #️⃣ I have commented my code, particularly in hard-to-understand areas
  • 📄 I have made changes to the documentation
  • 🧪 I have added tests to this description that prove my fix is effective or that my feature works
  • ⬆️ I increased versions for any altered app according to semantic versioning
  • I made sure the title starts with feat(chart-name):, fix(chart-name):, chore(chart-name):, docs(chart-name): or fix(docs):

➕ App addition

If this PR is an app addition please make sure you have done the following.

  • 🖼️ I have added an icon in the Chart's root directory called icon.png

Please don't blindly check all the boxes. Read them and only check those that apply.
Those checkboxes are there for the reviewer to see what is this all about and
the status of this PR with a quick glance.

Copilot AI review requested due to automatic review settings February 18, 2026 11:34
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.94%. Comparing base (1748064) to head (d665764).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #10   +/-   ##
=======================================
  Coverage   99.93%   99.94%           
=======================================
  Files         179      179           
  Lines        6664     6668    +4     
  Branches     1451     1458    +7     
=======================================
+ Hits         6660     6664    +4     
  Misses          4        4           
Flag Coverage Δ
app 99.94% <100.00%> (+<0.01%) ⬆️
ui 99.94% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for watcher-level compose defaults that apply when container-level compose labels are not present. It allows setting default values for compose trigger options (backup, prune, dryrun, auto, threshold) via environment variables at the watcher level.

Changes:

  • Added compose configuration object to Docker watcher with optional boolean/string fields for default trigger options
  • Modified compose trigger configuration extraction to fall back to watcher-level defaults when labels are absent
  • Added comprehensive test coverage for the new default behavior and label override scenarios

Reviewed changes

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

File Description
app/watchers/providers/docker/Docker.ts Added compose defaults interface, schema validation, helper function for value normalization, and updated getDockercomposeTriggerConfigurationFromLabels to use defaults as fallback
app/watchers/providers/docker/Docker.test.ts Added tests for watcher compose defaults during init and container detail processing, including label override scenarios
README.md Documented the new watcher-level environment variables for compose defaults

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

Comment on lines +216 to +246
const backup =
getLabel(labels, ddComposeBackup, wudComposeBackup) ??
normalizeComposeDefaultValue(composeDefaults.backup);
if (backup !== undefined) {
dockercomposeConfig.backup = backup;
}

const prune = getLabel(labels, ddComposePrune, wudComposePrune);
const prune =
getLabel(labels, ddComposePrune, wudComposePrune) ??
normalizeComposeDefaultValue(composeDefaults.prune);
if (prune !== undefined) {
dockercomposeConfig.prune = prune;
}

const dryrun = getLabel(labels, ddComposeDryrun, wudComposeDryrun);
const dryrun =
getLabel(labels, ddComposeDryrun, wudComposeDryrun) ??
normalizeComposeDefaultValue(composeDefaults.dryrun);
if (dryrun !== undefined) {
dockercomposeConfig.dryrun = dryrun;
}

const auto = getLabel(labels, ddComposeAuto, wudComposeAuto);
const auto =
getLabel(labels, ddComposeAuto, wudComposeAuto) ??
normalizeComposeDefaultValue(composeDefaults.auto);
if (auto !== undefined) {
dockercomposeConfig.auto = auto;
}

const threshold = getLabel(labels, ddComposeThreshold, wudComposeThreshold);
const threshold =
getLabel(labels, ddComposeThreshold, wudComposeThreshold) ||
normalizeConfigStringValue(composeDefaults.threshold);
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Inconsistent handling of empty string labels: threshold uses || with normalizeConfigStringValue (treats empty strings as unset), while backup/prune/dryrun/auto use ?? with normalizeComposeDefaultValue (preserves empty strings as ""). This creates different behaviors - an empty threshold label falls back to the default, but an empty backup label would result in backup: "". For consistency, either use || for all fields to treat empty strings as unset, or modify normalizeComposeDefaultValue to return undefined for empty strings like normalizeConfigStringValue does.

Copilot uses AI. Check for mistakes.
@Crow-Control
Copy link
Copy Markdown
Member Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown

Copilot AI commented Feb 18, 2026

@Crow-Control I've opened a new pull request, #11, to work on those changes. Once the pull request is ready, I'll request review from you.

Crow-Control and others added 2 commits February 18, 2026 12:54
* Initial plan

* fix: use consistent empty string handling for compose labels

Co-authored-by: Crow-Control <7613738+Crow-Control@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Crow-Control <7613738+Crow-Control@users.noreply.github.com>
@Crow-Control Crow-Control merged commit 494291d into main Feb 18, 2026
5 checks passed
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.

4 participants