Ensure dockercompose trigger creation uses existing dd/wud.compose.file labels only#6
Conversation
Co-authored-by: Crow-Control <7613738+Crow-Control@users.noreply.github.com>
Co-authored-by: Crow-Control <7613738+Crow-Control@users.noreply.github.com>
dd/wud.compose.file
|
@copilot im not asking for adding extra metadata config, i want the current labels to correctly create triggers. |
Co-authored-by: Crow-Control <7613738+Crow-Control@users.noreply.github.com>
Done — I removed the compose metadata fallback and kept trigger creation scoped to the existing |
dd/wud.compose.filedd/wud.compose.file labels only
|
@copilot somehow the containerlabels dont create the trigger in the ui? |
Co-authored-by: Crow-Control <7613738+Crow-Control@users.noreply.github.com>
Fixed — the issue was cached containers returning early before compose trigger creation. I updated the watcher to still create the trigger when |
There was a problem hiding this comment.
Pull request overview
Aligns Docker compose trigger auto-creation strictly to the existing dd.compose.file / wud.compose.file label contract, while fixing an edge case where cached containers could skip compose trigger creation due to an early store short-circuit.
Changes:
- Prevent early return from
addImageDetailsToContainerwhen a compose file label exists but no compose trigger is cached for that container. - Reuse
composeFilePathcomputed up-front for trigger creation. - Add a unit test covering the cached-container path to ensure compose trigger creation and
triggerIncludepopulation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/watchers/providers/docker/Docker.ts | Adjusts store short-circuit logic to allow compose trigger creation when needed based on dd/wud.compose.file. |
| app/watchers/providers/docker/Docker.test.ts | Adds regression test ensuring cached containers with dd.compose.file still create compose triggers and set triggerInclude. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if ( | ||
| containerInStore !== undefined && | ||
| containerInStore.error === undefined && | ||
| !needsComposeTriggerCreation | ||
| ) { |
There was a problem hiding this comment.
With this change, if dd/wud.compose.file is set but dockercompose trigger creation fails (exception in ensureDockercomposeTriggerForContainer), composeTriggersByContainer[containerId] remains unset. That means needsComposeTriggerCreation will stay true on every subsequent poll, so the watcher will repeatedly skip the store short-circuit and re-run the full image inspect path just to retry trigger creation, which can add ongoing load/log noise. Consider handling the “container already in store + needs trigger creation” case without inspecting the image (create trigger, update composeTriggersByContainer, and return/update the stored container’s triggerInclude), or add a backoff/sentinel to avoid repeated inspect work on persistent failures.
| if ( | |
| containerInStore !== undefined && | |
| containerInStore.error === undefined && | |
| !needsComposeTriggerCreation | |
| ) { | |
| if (containerInStore !== undefined && containerInStore.error === undefined) { |
This PR keeps compose trigger creation aligned with the existing label contract and removes the metadata-based fallback that expanded scope beyond the requested fix.
Compose trigger source
dd.compose.filewud.compose.fileScope correction from feedback
com.docker.compose.project.config_filescom.docker.compose.project.working_dirCurrent behavior
backup,prune,dryrun,auto,threshold) continue to be passed fromdd/wud.compose.*labels as before.Additional regression coverage
triggerIncludepopulation whendd.compose.fileis set.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.