Skip to content

Commit

Permalink
Merge branch 'master' into nest-as (elastic#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Martin committed Apr 7, 2020
2 parents 3acc866 + 3343b7f commit 9f3852f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Thanks, you're awesome :-) -->

#### Bugfixes

* Subsets are created after duplicating reusable fields now so subsets can
be applied to each reused instance independently. #753
* Quoted the example for `labels` to avoid YAML interpreting it, and having
slightly different results in different situations. #782
* Fix incorrect listing of where field sets are nested in asciidoc,
Expand Down
2 changes: 2 additions & 0 deletions scripts/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def main():
intermediate_custom = schema_reader.load_schemas(include_glob)
schema_reader.merge_schema_fields(intermediate_fields, intermediate_custom)

schema_reader.assemble_reusables(intermediate_fields)

if args.subset:
subset = {}
for arg in args.subset:
Expand Down
4 changes: 1 addition & 3 deletions scripts/schema_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ def merge_schema_fields(a, b):


def generate_nested_flat(fields_intermediate):
assemble_reusables(fields_intermediate)
cleanup_fields_recursive(fields_intermediate, "")
for field_name, field in fields_intermediate.items():
nestings = find_nestings(field['fields'], field_name + ".")
nestings.sort()
Expand All @@ -139,7 +137,7 @@ def assemble_reusables(fields_nested):
for schema_name in fields_nested:
schema = fields_nested[schema_name]
duplicate_reusable_fieldsets(schema, fields_nested)

cleanup_fields_recursive(fields_nested, "")

def duplicate_reusable_fieldsets(schema, fields_nested):
"""Copies reusable field definitions to their expected places"""
Expand Down
5 changes: 3 additions & 2 deletions scripts/tests/test_ecs_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

from scripts import schema_reader


(nested, flat) = schema_reader.generate_nested_flat(schema_reader.load_schemas())
schemas = schema_reader.load_schemas()
schema_reader.assemble_reusables(schemas)
(nested, flat) = schema_reader.generate_nested_flat(schemas)


class TestEcsSpec(unittest.TestCase):
Expand Down

0 comments on commit 9f3852f

Please sign in to comment.