Skip to content

Commit 65be2b8

Browse files
committed
chore: use docs-dev instead of docs folder
1 parent 8854b3b commit 65be2b8

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

detection_rules/custom_rules.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111

1212
from .main import root
1313
from .utils import get_etc_path, load_etc_dump, ROOT_DIR
14+
from .docs import DOCS_DIR
1415

1516
from semver import Version
1617

1718
DEFAULT_CONFIG_PATH = Path(get_etc_path('_config.yaml'))
18-
CUSTOM_RULES_DOC_PATH = Path(ROOT_DIR).joinpath('docs', 'custom-rules.md')
19+
CUSTOM_RULES_DOC_PATH = Path(ROOT_DIR).joinpath(DOCS_DIR, 'custom-rules.md')
1920

2021

2122
@root.group('custom-rules')

detection_rules/devtools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
refresh_main_schema)
3535
from .cli_utils import single_collection
3636
from .config import parse_rules_config
37-
from .docs import IntegrationSecurityDocs, IntegrationSecurityDocsMDX
37+
from .docs import IntegrationSecurityDocs, IntegrationSecurityDocsMDX, DOCS_DIR
3838
from .ecs import download_endpoint_schemas, download_schemas
3939
from .endgame import EndgameSchemaManager
4040
from .eswrap import CollectEvents, add_range_to_dsl
@@ -566,7 +566,7 @@ def elastic_pkg(*args):
566566
567567
## Checklist
568568
569-
- [x] I have reviewed [tips for building integrations](https://github.com/elastic/integrations/blob/master/docs/tips_for_building_integrations.md) and this pull request is aligned with them.
569+
- [x] I have reviewed [tips for building integrations](https://github.com/elastic/integrations/blob/master/docs-dev/tips_for_building_integrations.md) and this pull request is aligned with them.
570570
- [ ] ~I have verified that all data streams collect metrics or logs.~
571571
- [x] I have added an entry to my package's `changelog.yml` file.
572572
- [x] If I'm introducing a new feature, I have modified the Kibana version constraint in my package's `manifest.yml` file to point to the latest Elastic stack release (e.g. `^7.13.0`).
@@ -802,7 +802,7 @@ def deprecate_rule(ctx: click.Context, rule_file: Path, deprecation_folder: Path
802802
help='GitHub token to push to gist', hide_input=True)
803803
@click.option('--gist-id', default=NAVIGATOR_GIST_ID, help='Gist ID to be updated (must exist).')
804804
@click.option('--print-markdown', is_flag=True, help='Print the generated urls')
805-
@click.option('--update-coverage', is_flag=True, help='Update the docs/ATT&CK-coverage.md file')
805+
@click.option('--update-coverage', is_flag=True, help='Update the docs-dev/ATT&CK-coverage.md file')
806806
def update_navigator_gists(directory: Path, token: str, gist_id: str, print_markdown: bool,
807807
update_coverage: bool) -> list:
808808
"""Update the gists with new navigator files."""
@@ -857,7 +857,7 @@ def raw_permalink(raw_link):
857857
click.echo('\n'.join(markdown) + '\n')
858858

859859
if update_coverage:
860-
coverage_file_path = get_path('docs', 'ATT&CK-coverage.md')
860+
coverage_file_path = get_path(DOCS_DIR, 'ATT&CK-coverage.md')
861861
header_lines = textwrap.dedent("""# Rule coverage
862862
863863
ATT&CK navigator layer files are generated when a package is built with `make release` or

detection_rules/docs.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from .rule_loader import DeprecatedCollection, RuleCollection
2525
from .utils import load_etc_dump, save_etc_dump
2626

27+
DOCS_DIR = "docs-dev"
28+
2729

2830
class PackageDocument(xlsxwriter.Workbook):
2931
"""Excel document for summarizing a rules package."""
@@ -278,8 +280,8 @@ def __init__(self, registry_version: str, directory: Path, overwrite=False,
278280
self.sorted_rules = sorted(all_rules, key=lambda rule: rule.name)
279281
self.registry_version_str, self.base_name, self.prebuilt_rule_base = self.parse_registry(registry_version)
280282
self.directory = directory
281-
self.package_directory = directory / "docs" / "detections" / "prebuilt-rules" / "downloadable-packages" / self.base_name # noqa: E501
282-
self.rule_details = directory / "docs" / "detections" / "prebuilt-rules" / "rule-details"
283+
self.package_directory = directory / DOCS_DIR / "detections" / "prebuilt-rules" / "downloadable-packages" / self.base_name # noqa: E501
284+
self.rule_details = directory / DOCS_DIR / "detections" / "prebuilt-rules" / "rule-details"
283285
self.update_message = update_message
284286

285287
if overwrite:
@@ -347,8 +349,8 @@ def generate_summary(self):
347349

348350
def generate_rule_reference(self):
349351
"""Generate rule reference page for prebuilt rules."""
350-
summary = self.directory / "docs" / "detections" / "prebuilt-rules" / 'prebuilt-rules-reference.asciidoc'
351-
rule_list = self.directory / "docs" / "detections" / "prebuilt-rules" / 'rule-desc-index.asciidoc'
352+
summary = self.directory / DOCS_DIR / "detections" / "prebuilt-rules" / 'prebuilt-rules-reference.asciidoc'
353+
rule_list = self.directory / DOCS_DIR / "detections" / "prebuilt-rules" / 'rule-desc-index.asciidoc'
352354

353355
summary_header = textwrap.dedent("""
354356
[[prebuilt-rules]]

0 commit comments

Comments
 (0)