-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
add script to update VSCode config with proper excludes #110161
Merged
spalger
merged 19 commits into
elastic:master
from
spalger:implement/setup-vscode-workspace-settings
Aug 30, 2021
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
61ade82
add script to update VSCode config with proper excludes
spalger 974b291
resolve paths against repo root
spalger dd158c1
reduce the scope of kbn/optimizer snapshots to make them less fragile
spalger ae9fdb7
Merge branch 'master' of github.com:elastic/kibana into implement/set…
spalger 3d07a43
add a few more files to list of watcher excludes
spalger 5a02486
support managing individual settings with `// self managed` comment
spalger 170a30a
Merge branch 'master' of github.com:elastic/kibana into implement/set…
spalger 4330532
Merge branch 'master' of github.com:elastic/kibana into implement/set…
spalger f4ae606
Merge branch 'master' into implement/setup-vscode-workspace-settings
kibanamachine f16d1f8
Merge branch 'implement/setup-vscode-workspace-settings' of github.co…
spalger 7c0a63a
expand support for self managing properties
spalger 0685c4b
Merge branch 'master' of github.com:elastic/kibana into implement/set…
spalger 2074e04
update comment of top level function
spalger 83cf3ba
remove existing managed keys which are not objects
spalger e3a752e
misc cleanup
spalger b874547
break loop logic up into helper functions for readability
spalger 38d138a
one more rename
spalger b5b5dd5
handle comment conflicts better and reduce iterations
spalger acbffcc
I swear, I'm done refactoring
spalger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export * from './update_vscode_config_cli'; |
40 changes: 40 additions & 0 deletions
40
packages/kbn-dev-utils/src/vscode_config/managed_config_keys.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export interface ManagedConfigKey { | ||
key: string; | ||
value: Record<string, any>; | ||
} | ||
|
||
/** | ||
* Defines the keys which we overrite in user's vscode config for the workspace. We currently | ||
* only support object values because that's all we needed to support, but support for non object | ||
* values should be easy to add. | ||
*/ | ||
export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [ | ||
{ | ||
key: 'files.watcherExclude', | ||
value: { | ||
['**/.eslintcache']: true, | ||
['**/.es']: true, | ||
['**/.yarn-local-mirror']: true, | ||
['**/.chromium']: true, | ||
['**/packages/kbn-pm/dist/index.js']: true, | ||
['**/bazel-*']: true, | ||
['**/node_modules']: true, | ||
['**/target']: true, | ||
spalger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
['**/*.log']: true, | ||
}, | ||
}, | ||
{ | ||
key: 'search.exclude', | ||
value: { | ||
['**/packages/kbn-pm/dist/index.js']: true, | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm wondering if we should list artifacts in
search.exclude
setting to speed up the default experience for search operations.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.
Did you turn off the "Use exclude settings and ignore files" setting? Artifacts should be excluded by default because they're not tracked by git.
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.
I only ask because I've never felt like search was slow and I definitely prefer to rely on the existing ignore files if we can.
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.
One example that may be useful here is the kbn-pm dist. That's the only one I'm running in to on first glance though, doesn't impact me much.
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.
Yeah, it's checked into the code so it makes sense to me
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.
So, in order to support managing the
search.exclude
property it felt like people needed to be able to add exclusions for themselves, so I've updated the logic to define management comments on each property it writes like so:Now, when the script runs it will ignore any property which doesn't have a
@managed
comment, and delete@managed
properties which are no longer managed. Additionally, users can self manage a property by replacing the@managed
comment with// self managed
and then customize things further.