-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watch initial sync #12047
Watch initial sync #12047
Conversation
b13abd1
to
bb2d745
Compare
@@ -574,3 +585,114 @@ func (s *composeService) pruneDanglingImagesOnRebuild(ctx context.Context, proje | |||
} | |||
} | |||
} | |||
|
|||
func (s *composeService) initialSync(ctx context.Context, project *types.Project, service types.ServiceConfig, trigger types.Trigger, ignore watch.PathMatcher, syncer sync.Syncer) error { | |||
dockerFileIgnore, err := watch.NewDockerPatternMatcher("/", []string{"Dockerfile", "*compose*.y*ml"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a better way to handle all the compose.yaml
variations pattern? For instance, tried compose.y[a]?ml
but it did not work :(
fe051f9
to
a60e6d9
Compare
Signed-off-by: Joana Hrotko <[email protected]>
d7bca14
to
8a90c06
Compare
Signed-off-by: Joana Hrotko <[email protected]>
8a90c06
to
8567fb7
Compare
} | ||
|
||
// gets the image creation time for a service | ||
func (s *composeService) imageCreatedTime(ctx context.Context, project *types.Project, serviceName string) (time.Time, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly can be moved somewhere else more generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | patch | `v2.29.1` -> `v2.29.2` | 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.29.2`](https://github.com/docker/compose/releases/tag/v2.29.2) [Compare Source](docker/compose@v2.29.1...v2.29.2) #### What's Changed ##### ✨ Improvements - docs: Update docker compose kill usage [(12041)](docker/compose#12041) - add `x-initSync` to watch to always provide initial [(12047)](docker/compose#12047) ##### 🐛 Fixes - Removes redundant condition from toAPIBuildOptions in build.go [(12009)](docker/compose#12009) - Fix stoping compose process for single container for file change on sync-restart action [(12014)](docker/compose#12014) ##### 🔧 Internal - bump golang `1.21.12` [(12017)](docker/compose#12017) - bump engine and cli to `v27.1.1`, buildx to `v0.16.1` [(12020)](docker/compose#12020) - bump engine and cli to `v27.1.2`, buildx to `v0.16.2` [(12057)](docker/compose#12057) - remove all dependabot update MRs for OTel dependencies [(12006)](docker/compose#12006) - bump golang.org/x/sys `v0.22.0` and gofrs/flock `v0.12.1` [(12018)](docker/compose#12018) #### New Contributors - [@​janbrasna](https://github.com/janbrasna) made their first contribution in [(12041)](docker/compose#12041) - [@​kapurm17](https://github.com/kapurm17) made their first contribution in [(12009)](docker/compose#12009) **Full Changelog**: docker/compose@v2.29.1...v2.29.2 </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:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
What I did
Introduce initial sync for
sync
andsync+restart
actions indevelop.watch
configuration to solve issue when restarting watch - after adocker compose down
- where the container no longer reflects previous changes. This behaviour is triggered when addingx-initialSync: true
to a watch configuration. In order to make this work, it was needed to introduceExtensions
todevelop.watch.trigger
incompose-go
(check related PR below).The initial sync will evaluate if any file in
develop.watch.path
was modified after the image creation time. It also ignores files fromdevelop.watch.ignore
paths and binded volumes.Related issue
compose-go
fixes
watch
sync
does not pass project files to container / does not reflect file changes between container restarts #11102(not mandatory) A picture of a cute animal, if possible in relation to what you did
