-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Simplify fields.yml generator #7713
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
db65390
simplify global fields.yml generator script
kvch f390bf8
fix format of error messages of asset generator
kvch 5c25ec8
changed asset file
kvch f370eb3
fix makefile of libbeat
kvch f01ec89
fix libbeat generator
kvch 3f50160
remove unnecessary meta/fields.yml file of packetbeat
kvch 1709b34
mage cleanup
kvch 4771483
add missing newline
kvch 1e367ab
use os.SameFile instead of path cmp
kvch aeb6394
do not try to open fields.generated.yml during testing
kvch 04758ee
rename winlogbeat/_meta/fields.yml to winlogbeat/_meta/fields.common.yml
kvch 41bd36b
remove _meta/fields.yml from the list && change order
kvch 6b4fc8e
follow up asset changes
kvch 837530e
fields asset generator reads from stdin if `-stdin` is set
kvch 1d5822e
global fields.yml generator writes to stdout if `-stdout` is passed
kvch e680f94
add missing dir
kvch 17d1c1d
follow up changes in makefile
kvch 0a2e813
add missing dir
kvch b296932
make fields target direct dependency of update
kvch 22bde9b
do not pollute output
kvch 76b0547
pass less params to `filepath.Join`
kvch d3fca54
fix tyop
kvch c3c6aba
-out as output and -in as input
kvch 6ff6069
use stringvar
kvch 2d64d75
add missing StringVar to asset
kvch 6349712
add comment
kvch 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -35,4 +35,4 @@ git-add: | |
|
||
# Collects all dependencies and then calls update | ||
.PHONY: collect | ||
collect: fields | ||
collect: |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -71,7 +71,7 @@ func CollectModuleFiles(modulesDir string) ([]*YmlFile, error) { | |
func CollectFiles(module string, modulesPath string) ([]*YmlFile, error) { | ||
|
||
var files []*YmlFile | ||
fieldsYmlPath := filepath.Join(modulesPath, module, "_meta", "fields.yml") | ||
fieldsYmlPath := filepath.Join(modulesPath, module, "_meta/fields.yml") | ||
if _, err := os.Stat(fieldsYmlPath); !os.IsNotExist(err) { | ||
files = append(files, &YmlFile{ | ||
Path: fieldsYmlPath, | ||
|
@@ -91,7 +91,7 @@ func CollectFiles(module string, modulesPath string) ([]*YmlFile, error) { | |
if !s.IsDir() { | ||
continue | ||
} | ||
fieldsYmlPath = filepath.Join(modulesPath, module, s.Name(), "_meta", "fields.yml") | ||
fieldsYmlPath = filepath.Join(modulesPath, module, s.Name(), "_meta/fields.yml") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question as above. |
||
if _, err = os.Stat(fieldsYmlPath); !os.IsNotExist(err) { | ||
files = append(files, &YmlFile{ | ||
Path: fieldsYmlPath, | ||
|
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
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.
What is the reason you introduced the
/
here? Could break on Windows. Any issues with the previous option?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.
Andrew pointed out that it is working everywhere in #7713 (comment)