Skip to content

Commit 2d96f10

Browse files
Mikaayensongithub-actions[bot]
authored andcommitted
[FR] Normalize yml ext to yaml (#3675)
Removed changes from: - detection_rules/etc/packages.yml (selectively cherry picked from commit 79f575b)
1 parent 1d7e597 commit 2d96f10

15 files changed

+20
-20
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ lib/ @brokensound77 @mikaayenson @eric-forte-elastic
88
rta/ @brokensound77 @mikaayenson @eric-forte-elastic
99

1010
# skip rta-mapping to avoid the spam
11-
detection_rules/etc/packages.yml @brokensound77 @mikaayenson @eric-forte-elastic
11+
detection_rules/etc/packages.yaml @brokensound77 @mikaayenson @eric-forte-elastic
1212
detection_rules/etc/*.json @brokensound77 @mikaayenson @eric-forte-elastic
1313
detection_rules/etc/*.json @brokensound77 @mikaayenson @eric-forte-elastic
1414
detection_rules/etc/*/* @brokensound77 @mikaayenson @eric-forte-elastic

.github/workflows/get-target-branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
- id: get-branch-list
3131
run: |
3232
python -m detection_rules dev utils get-branches
33-
echo "::set-output name=matrix::$(cat ./detection_rules/etc/target-branches.yml)"
33+
echo "::set-output name=matrix::$(cat ./detection_rules/etc/target-branches.yaml)"

.github/workflows/manual-backport.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
description: 'Sha256 hash of the merge commit to use in backporting'
1010
required: true
1111
exceptions:
12-
description: 'Comma seperated list of files to skip staging e.g. detection_rules/etc/packages.yml,detection_rules/attack.py)'
12+
description: 'Comma seperated list of files to skip staging e.g. detection_rules/etc/packages.yaml,detection_rules/attack.py)'
1313
required: false
1414

1515
jobs:
@@ -60,7 +60,7 @@ jobs:
6060
env:
6161
UNSTAGED_LIST_FILE: "../unstaged-rules.txt"
6262
run: |
63-
VERSION=$(cat detection_rules/etc/packages.yml | grep -oP "(?<=name:\s')[\d\.]+[-\w\.]*(?=')")
63+
VERSION=$(cat detection_rules/etc/packages.yaml | grep -oP "(?<=name:\s')[\d\.]+[-\w\.]*(?=')")
6464
python -m detection_rules dev unstage-incompatible-rules --target-stack-version "$VERSION" --exception-list "${{github.event.inputs.exceptions}}"
6565
6666
# Track which rules were unstaged

.github/workflows/release-fleet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
if: github.event.inputs.package_maturity == 'ga'
101101
run: |
102102
cd detection-rules
103-
output=$(cat detection_rules/etc/packages.yml | grep -oP '(?<=\sversion: )\S+')
103+
output=$(cat detection_rules/etc/packages.yaml | grep -oP '(?<=\sversion: )\S+')
104104
echo "pkg_version=$output" >> $GITHUB_ENV
105105
106106
- name: Create release tag

detection_rules/cli_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,6 @@ def rule_prompt(path=None, rule_type=None, required_only=True, save=True, verbos
227227
print(' - {}'.format('\n - '.join(skipped)))
228228

229229
# rta_mappings.add_rule_to_mapping_file(rule)
230-
# click.echo('Placeholder added to rule-mapping.yml')
230+
# click.echo('Placeholder added to rule-mapping.yaml')
231231

232232
return rule

detection_rules/devtools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def build_integration_docs(ctx: click.Context, registry_version: str, pre: str,
195195
def bump_versions(major_release: bool, minor_release: bool, patch_release: bool, new_package: str, maturity: str):
196196
"""Bump the versions"""
197197

198-
pkg_data = load_etc_dump('packages.yml')['package']
198+
pkg_data = load_etc_dump('packages.yaml')['package']
199199
kibana_ver = Version.parse(pkg_data["name"], optional_minor_and_patch=True)
200200
pkg_ver = Version.parse(pkg_data["registry_data"]["version"])
201201
pkg_kibana_ver = Version.parse(pkg_data["registry_data"]["conditions"]["kibana.version"].lstrip("^"))
@@ -236,7 +236,7 @@ def bump_versions(major_release: bool, minor_release: bool, patch_release: bool,
236236
click.echo(f"Package Kibana version: {pkg_data['registry_data']['conditions']['kibana.version']}")
237237
click.echo(f"Package version: {pkg_data['registry_data']['version']}")
238238

239-
save_etc_dump({"package": pkg_data}, "packages.yml")
239+
save_etc_dump({"package": pkg_data}, "packages.yaml")
240240

241241

242242
@dataclasses.dataclass
@@ -293,7 +293,7 @@ def read(self, git_tree="HEAD") -> bytes:
293293
def prune_staging_area(target_stack_version: str, dry_run: bool, exception_list: list):
294294
"""Prune the git staging area to remove changes to incompatible rules."""
295295
exceptions = {
296-
"detection_rules/etc/packages.yml",
296+
"detection_rules/etc/packages.yaml",
297297
}
298298
exceptions.update(exception_list.split(","))
299299

@@ -1077,7 +1077,7 @@ def utils_group():
10771077

10781078

10791079
@utils_group.command('get-branches')
1080-
@click.option('--outfile', '-o', type=Path, default=get_etc_path("target-branches.yml"), help='File to save output to')
1080+
@click.option('--outfile', '-o', type=Path, default=get_etc_path("target-branches.yaml"), help='File to save output to')
10811081
def get_branches(outfile: Path):
10821082
branch_list = get_stack_versions(drop_patch=True)
10831083
target_branches = json.dumps(branch_list[:-1]) + "\n"

detection_rules/eswrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def es_group(ctx: click.Context, **kwargs):
371371
@click.option('--query', '-q', help='KQL query to scope search')
372372
@click.option('--index', '-i', multiple=True, help='Index(es) to search against (default: all indexes)')
373373
@click.option('--rta-name', '-r', help='Name of RTA in order to save events directly to unit tests data directory')
374-
@click.option('--rule-id', help='Updates rule mapping in rule-mapping.yml file (requires --rta-name)')
374+
@click.option('--rule-id', help='Updates rule mapping in rule-mapping.yaml file (requires --rta-name)')
375375
@click.option('--view-events', is_flag=True, help='Print events after saving')
376376
@click.pass_context
377377
def collect_events(ctx, host_id, query, index, rta_name, rule_id, view_events):

detection_rules/mappings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RtaMappings:
2222

2323
def __init__(self):
2424
"""Rta-mapping validation and prep."""
25-
self.mapping: dict = load_etc_dump('rule-mapping.yml')
25+
self.mapping: dict = load_etc_dump('rule-mapping.yaml')
2626
self.validate()
2727

2828
self._rta_mapping = defaultdict(list)
@@ -48,7 +48,7 @@ def add_rule_to_mapping_file(self, rule, rta_name, count=0, *sources):
4848

4949
mapping[rule.id] = rule_map
5050
self.mapping = dict(sorted(mapping.items()))
51-
save_etc_dump(self.mapping, 'rule-mapping.yml')
51+
save_etc_dump(self.mapping, 'rule-mapping.yaml')
5252
return rule_map
5353

5454
def get_rta_mapping(self):

detection_rules/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def download_worker(rule_info):
267267
@cached
268268
def load_current_package_version() -> str:
269269
"""Load the current package version from config file."""
270-
return load_etc_dump('packages.yml')['package']['name']
270+
return load_etc_dump('packages.yaml')['package']['name']
271271

272272

273273
def get_default_config() -> Optional[Path]:

0 commit comments

Comments
 (0)