Skip to content

Fix #6829: drop support for kamel run --dev/--sync - #6832

Open
Suhail98 wants to merge 3 commits into
apache:mainfrom
Suhail98:fix-6829-remove-dev-sync
Open

Suhail98 wants to merge 3 commits into
apache:mainfrom
Suhail98:fix-6829-remove-dev-sync

Conversation

@Suhail98

Copy link
Copy Markdown

Fixes #6829

kamel run --dev and --sync were deprecated in v2.9.0 and printed a removal notice on every use. This removes them, so kamel run no longer carries a file-watching rebuild loop that nothing else in the CLI depends on.

What is removed

  • The --dev and --sync flags and the Dev / Sync fields on runCmdOptions.
  • The --dev + -o/--output mutual-exclusion check and the "Dev and Sync properties are deprecated" notice in validate.
  • In run: the SIGTERM handler that deleted the Integration on Ctrl-C, and the o.Dev / o.Sync arms of the --logs and --wait conditions.
  • syncIntegration, plus what only it used: filterFileLocation (run_support.go), the pkg/util/sync package, and DeleteIntegration (pkg/cmd/util.go). The e2e suite has its own DeleteIntegrations in e2e/support, so nothing else calls it.
  • The unit tests covering the two flags, and TestFilterFileLocation.

--logs and --wait behave exactly as before: the two if o.Logs branches left after the o.Dev arms were dropped are merged into one, which is the same sequence of calls in the same order.

No deprecation shim is added — Cobra already answers --dev with unknown flag: --dev, matching how #6816 left the removed subcommands. Following your reviews on #6807 and #6816, there is also no test asserting the flags are gone.

The only mention left in docs/ was a passing "dev mode" aside in configuration/dependencies.adoc; it is reworded rather than deleted, since the point it makes about automatic dependency resolution still holds.

Testing

go build ./pkg/... ./cmd/..., go vet ./pkg/cmd/... ./pkg/util/... and gofmt -l are clean, and go test ./pkg/cmd/... shows the same 10 pre-existing Windows-only path/file-lock failures before and after the change. Built ./cmd/kamel and confirmed --dev and --sync are gone from run --help and now report unknown flag.

Both flags were deprecated in v2.9.0. Removes the flags, the
runCmdOptions fields behind them, and the code that existed only to
serve them: syncIntegration, filterFileLocation, the pkg/util/sync
package and DeleteIntegration.

--logs and --wait keep their current behaviour.

@squakez squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool cleaning work. Thanks. A few comments to verify.

Comment thread docs/modules/ROOT/pages/configuration/dependencies.adoc Outdated
Comment thread pkg/util/sync/file.go
@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 63.9% to 64.2% (+0.3%)

… dependency

The dependencies.adoc sentence only made sense in terms of the dev loop,
so remove it rather than reword it.

pkg/util/sync was the only first-party user of fsnotify, so go mod tidy
moves it to the indirect block, where viper still needs it.
@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 63.8% to 64.2% (+0.4%)

@squakez

squakez commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Please, make lint-fix or the needed to fix the linting problems reported.

syncIntegration held the only call to RootCmdOptions.ContextCancel, so
the cancel func from WithCancel was left uncalled (gosec G118). The
child context existed only to let sync cancel and restart the in-flight
command, so drop it along with RootContext, which had a single use.

Realign the runCmdOptions tags the removed fields left ragged.
@Suhail98

Copy link
Copy Markdown
Author

Both lint issues fixed, and both turned out to be fallout from the removal rather than formatting noise:

  • gosec G118 in root.gosyncIntegration held the only call to RootCmdOptions.ContextCancel, so once it was gone the cancel func from WithCancel was never called. The child context only existed so sync could cancel and restart the in-flight command, so I dropped it, along with RootContext, whose single remaining use was the <-o.RootContext.Done() wait point in run. That now waits on o.Context, which is the same instant: the child was only ever cancelled by its parent. Shout if you'd rather keep the fields and silence the linter instead.
  • tagalign in run.go — the removed Sync / Dev fields left the surrounding tags ragged. Realigned.

No make on my machine, so I ran the pinned linter directly: golangci-lint v2.13.2 run --config .golangci.yml. Clean apart from 12 mnd reports in files listed under mnd.ignored-files — those paths use forward slashes, so the ignore list doesn't match on Windows. Nothing there is touched by this PR.

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.

Drop support for kamel run --dev/--sync

2 participants