Skip to content
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

Generating a schema with the subset and include options together means that include is not used #843

Closed
joshdevins opened this issue May 11, 2020 · 4 comments
Labels
bug Something isn't working review

Comments

@joshdevins
Copy link
Member

Using both --subset and --include together fails to include the custom fields. Using one or the other of those options seems to work fine though.

scripts/generator.py \
        --subset ../../config/ecs/subset.yml \
    	--include ../../config/ecs/custom \
    	--out generated_custom

Specifying a single custom file with --include produces the following output with no custom YAML files listed:

Running generator. ECS version 1.6.0-dev
Loading default schemas
Loading user defined schemas: []

Specifying a directory containing one or more custom files with --include produces the following output with the correct custom YAML files listed:

Running generator. ECS version 1.6.0-dev
Loading default schemas
Loading user defined schemas: ['../../config/ecs/custom/search_metrics.yml', '../../config/ecs/custom/search_metrics_simulation.yml']
@joshdevins joshdevins added the bug Something isn't working label May 11, 2020
@joshdevins
Copy link
Member Author

As per the "documentation", this is expected if the custom fields are not in the subset file:

Note that if you use --subset and --include together, your subset file should list the custom fields you're importing via --include. Otherwise --subset will filter them out right away :-)

It seems however that there is still a bug around including a single file vs directory.

@marshallmain
Copy link
Contributor

--include doesn't support providing a single file name, it expects a directory and always grabs all yaml files from that directory.

@joshdevins
Copy link
Member Author

If we use the principle of least surprise, I guess I would expect a failure message. The "docs" also say it can take a file so we should at least fix that comment.

The --help output indeed says it supports directories of YAML files.

@ebeahan
Copy link
Member

ebeahan commented Jul 27, 2020

The former unofficial "docs" from #746 have been deprecated in favor of proper documentation introduced in #893. The currents docs note how --include expects a directory today.

Created a new issue to improve consistency of the two arguments in #899.

@ebeahan ebeahan closed this as completed Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working review
Projects
None yet
Development

No branches or pull requests

3 participants