Skip to content

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented May 22, 2025

Stop navigation menu being responsible for watch, with a dedicated Watcher component:

  • Watcher holds the watch configuration and manages the start/stop lifecycle
  • composeservice#watch() returns:
    • an async func for caller to wait for completion and capture execution error (could also be a chan error)
    • an error for configuration/startup issues
  • Navigation menu (shortcut.go) only knows Start and Stop functions to manage watch lifecycle
  • removed use of errgroup without actual error management (probably requires some extra work)

What I did

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did

@ndeloof ndeloof force-pushed the watch_refactoring branch 4 times, most recently from 0c65144 to f8ee5a0 Compare May 22, 2025 20:25
@ndeloof ndeloof marked this pull request as ready for review May 23, 2025 11:02
@ndeloof ndeloof requested a review from a team as a code owner May 23, 2025 11:02
@ndeloof ndeloof requested a review from glours May 23, 2025 11:02
@ndeloof ndeloof force-pushed the watch_refactoring branch from f8ee5a0 to 104e2a2 Compare May 26, 2025 06:14
Copy link

codecov bot commented May 26, 2025

Codecov Report

Attention: Patch coverage is 34.37500% with 105 lines in your changes missing coverage. Please review.

Project coverage is 53.64%. Comparing base (a54814f) to head (104e2a2).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/formatter/shortcut.go 0.00% 68 Missing ⚠️
pkg/compose/watch.go 59.70% 22 Missing and 5 partials ⚠️
pkg/compose/up.go 57.14% 5 Missing and 1 partial ⚠️
pkg/mocks/mock_docker_compose_api.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12865      +/-   ##
==========================================
+ Coverage   53.41%   53.64%   +0.23%     
==========================================
  Files         158      158              
  Lines       16273    16265       -8     
==========================================
+ Hits         8692     8726      +34     
+ Misses       6695     6653      -42     
  Partials      886      886              

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

@ndeloof ndeloof force-pushed the watch_refactoring branch 3 times, most recently from a7f7177 to c309f42 Compare June 2, 2025 05:34
Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM, nice refacto thanks!
waiting for conflicts resolution to merge it

@ndeloof ndeloof force-pushed the watch_refactoring branch from c309f42 to cdbeaec Compare June 5, 2025 13:51
@glours glours force-pushed the watch_refactoring branch from cdbeaec to 47b0168 Compare June 5, 2025 14:21
@glours glours enabled auto-merge (rebase) June 5, 2025 14:21
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof force-pushed the watch_refactoring branch from 47b0168 to a2c7630 Compare June 5, 2025 14:28
@glours glours merged commit 9b67a48 into docker:main Jun 5, 2025
50 of 51 checks passed
@ndeloof ndeloof deleted the watch_refactoring branch June 5, 2025 14:49
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jun 12, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | minor | `v2.36.2` -> `v2.37.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v2.37.1`](https://github.com/docker/compose/releases/tag/v2.37.1)

[Compare Source](docker/compose@v2.37.0...v2.37.1)

#### What's Changed

##### ✨ Improvements

-   Add support for extra_hosts building with bake by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12935

##### 🐛 Fixes

-   Fix SIGSEGV on Enable Watch by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12909
-   Revert docker compose images JSON output to array format by [@&#8203;x0rw](https://github.com/x0rw) in docker/compose#12917
-   Sanitize service name so they can be used as bake targets by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12925
-   Only look for required image in bake metadata by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12930
-   Don't create metadatafile, just generate a random name by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12931
-   Fix the generated manifest for compose artifacts by [@&#8203;jcarter3](https://github.com/jcarter3) in docker/compose#12933
-   Fix support for additional_contexts with service sub-dependencies by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12936
-   Fix panic on failure starting plugin server by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12914

##### 🔧  Internal

-   Do not forget to remove the bake metadata file by [@&#8203;glours](https://github.com/glours) in docker/compose#12912

##### ⚙️ Dependencies

-   Bump golang.org/x/sync v0.15.0 by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12913
-   Build(deps): bump google.golang.org/grpc from 1.72.2 to 1.73.0 by [@&#8203;dependabot](https://github.com/dependabot) in docker/compose#12910

#### New Contributors

-   [@&#8203;x0rw](https://github.com/x0rw) made their first contribution in docker/compose#12917
-   [@&#8203;jcarter3](https://github.com/jcarter3) made their first contribution in docker/compose#12933

**Full Changelog**: docker/compose@v2.37.0...v2.37.1

### [`v2.37.0`](https://github.com/docker/compose/releases/tag/v2.37.0)

[Compare Source](docker/compose@v2.36.2...v2.37.0)

#### What's Changed

ℹ️ `bake` is now used as the default images builder, if you don't want to use it you could opt-out by setting the `COMPOSE_BAKE` env variable to `false`

##### ✨ Improvements

-   Add compose bridge by [@&#8203;glours](https://github.com/glours) in docker/compose#12866
-   Include platform and creation date listing image by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12856
-   Add support of metadata subcommand for provider services by [@&#8203;glours](https://github.com/glours) in docker/compose#12903
-   Use bake by default by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12699

##### 🐛 Fixes

-   (Re)start dependent services after watch rebuilt image by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12879
-   Resolve symlinks while making dockerfile path absolute by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12884
-   Fix support for `BUILDKIT_PROGRESS` by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12894
-   Build dependent service images when required by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12896
-   Fix recreate network (and connected containers) on config updates by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12899
-   `pull` does not require `env_file` being resolved by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12904

##### 🔧  Internal

-   Refactor: use slices.Contains to simplify code by [@&#8203;tongjicoder](https://github.com/tongjicoder) in docker/compose#12877
-   Remove utils.Contains to prefer slice.ContainsFunc by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12878
-   Fix typo in suggestion log by [@&#8203;Carlos-err406](https://github.com/Carlos-err406) in docker/compose#12893
-   Replace uses of golang.org/x/exp/(maps|slices) for stdlib and fix linting by [@&#8203;thaJeztah](https://github.com/thaJeztah) in docker/compose#12885
-   Debug message to help diagnose platform mismatch by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12905
-   (refactoting) Move watch logic into a dedicated Watcher type by [@&#8203;ndeloof](https://github.com/ndeloof) in docker/compose#12865

##### ⚙️ Dependencies

-   Bump cli-doc-tools to v0.10.0 by [@&#8203;glours](https://github.com/glours) in docker/compose#12855
-   Bump github.com/docker/docker, docker/cli v28.2.2 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in docker/compose#12875
-   Build(deps): bump google.golang.org/grpc from 1.72.1 to 1.72.2 by [@&#8203;dependabot](https://github.com/dependabot) in docker/compose#12872

#### New Contributors

-   [@&#8203;tongjicoder](https://github.com/tongjicoder) made their first contribution in docker/compose#12877
-   [@&#8203;Carlos-err406](https://github.com/Carlos-err406) made their first contribution in docker/compose#12893

**Full Changelog**: docker/compose@v2.36.2...v2.37.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC41MC4wIiwidXBkYXRlZEluVmVyIjoiNDAuNTAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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.

2 participants