Skip to content

Commit

Permalink
[8.x] fix: kibana dev server not restarting for external plugin elast…
Browse files Browse the repository at this point in the history
…ic#171260 (elastic#198246) (elastic#201040)

# Backport

This will backport the following commits from `main` to `8.x`:
- [fix: kibana dev server not restarting for external plugin elastic#171260
(elastic#198246)](elastic#198246)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jordan
McAlpine","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-20T20:24:58Z","message":"fix:
kibana dev server not restarting for external plugin elastic#171260
(elastic#198246)\n\n## Summary\r\n\r\nFixes elastic#171260 the Kibana dev server not
restarting during external\r\nplugin development for server side
code.\r\n\r\n### Checklist\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ]
This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n##
Release note\r\nFixes elastic#171260 the Kibana dev server not restarting
during external\r\nplugin development for server side
code.\r\n\r\n---------\r\n\r\nCo-authored-by: Brad White
<[email protected]>","sha":"83b282a63a3748a07a0d9e69f2cafa44b9439af7","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","💝community","v9.0.0","backport:prev-minor"],"title":"fix:
kibana dev server not restarting for external plugin
elastic#171260","number":198246,"url":"https://github.com/elastic/kibana/pull/198246","mergeCommit":{"message":"fix:
kibana dev server not restarting for external plugin elastic#171260
(elastic#198246)\n\n## Summary\r\n\r\nFixes elastic#171260 the Kibana dev server not
restarting during external\r\nplugin development for server side
code.\r\n\r\n### Checklist\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ]
This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n##
Release note\r\nFixes elastic#171260 the Kibana dev server not restarting
during external\r\nplugin development for server side
code.\r\n\r\n---------\r\n\r\nCo-authored-by: Brad White
<[email protected]>","sha":"83b282a63a3748a07a0d9e69f2cafa44b9439af7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198246","number":198246,"mergeCommit":{"message":"fix:
kibana dev server not restarting for external plugin elastic#171260
(elastic#198246)\n\n## Summary\r\n\r\nFixes elastic#171260 the Kibana dev server not
restarting during external\r\nplugin development for server side
code.\r\n\r\n### Checklist\r\n\r\n\r\n### For maintainers\r\n\r\n- [ ]
This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n##
Release note\r\nFixes elastic#171260 the Kibana dev server not restarting
during external\r\nplugin development for server side
code.\r\n\r\n---------\r\n\r\nCo-authored-by: Brad White
<[email protected]>","sha":"83b282a63a3748a07a0d9e69f2cafa44b9439af7"}}]}]
BACKPORT-->

Co-authored-by: Jordan McAlpine <[email protected]>
  • Loading branch information
kibanamachine and mickalpine authored Nov 20, 2024
1 parent fd6dc18 commit 121d94f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/kbn-cli-dev-mode/src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const packageMatcher = makeMatcher([
/**
* Any code that is outside of a package must match this in order to trigger a restart
*/
const nonPackageMatcher = makeMatcher(['config/**/*.yml']);
const nonPackageMatcher = makeMatcher(['config/**/*.yml', 'plugins/**/server/**/*']);
const staticFileMatcher = makeMatcher(['plugins/**/kibana.json']);

export interface Options {
enabled: boolean;
Expand Down Expand Up @@ -87,6 +88,10 @@ export class Watcher {
if (result.type === 'non-package') {
return nonPackageMatcher(result.repoRel) && fire(result.repoRel);
}

if (result.type === 'static') {
return staticFileMatcher(result.repoRel) && fire(result.repoRel);
}
}
},
{
Expand Down

0 comments on commit 121d94f

Please sign in to comment.