Skip to content

Commit 3bdda09

Browse files
chore: use docs-dev instead of docs dir for docs (#4522)
* chore: use `docs-dev` instead of `docs` folder * patch version bump * Rollback an incorrect rename * Use exact docs dir in the helper comment * Revert some overeager renamings * Moving `docs` to `docs-dev` * Update Docs Paths --------- Co-authored-by: eric-forte-elastic <[email protected]>
1 parent e28512a commit 3bdda09

35 files changed

+18
-15
lines changed

.github/workflows/attack-coverage-update.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
inputs:
55
update-coverage:
6-
description: 'Update the docs/ATT&CK-coverage.md file'
6+
description: 'Update the docs-dev/ATT&CK-coverage.md file'
77
required: true
88
default: '--update-coverage'
99

@@ -37,25 +37,25 @@ jobs:
3737
git config --global user.email "[email protected]"
3838
git config --global user.name "protectionsmachine"
3939
40-
- name: Update navigator gist files and docs/ATT&CK-coverage.md file.
40+
- name: Update navigator gist files and docs-dev/ATT&CK-coverage.md file.
4141
env:
4242
GITHUB_TOKEN: "${{ secrets.WRITE_TRADEBOT_GIST_TOKEN }}"
4343
run: |
4444
python -m detection_rules dev update-navigator-gists "${{ github.event.inputs.update-coverage }}"
45-
git add docs/"ATT\&CK-coverage.md"
45+
git add docs-dev/"ATT\&CK-coverage.md"
4646
4747
- name: Create Pull Request
4848
uses: peter-evans/[email protected]
4949
with:
5050
assignees: '${{github.actor}}'
5151
delete-branch: true
5252
branch: "update-attack-coverage"
53-
commit-message: "Update ATT&CK coverage URL(s) in docs/ATT&CK-coverage.md"
53+
commit-message: "Update ATT&CK coverage URL(s) in docs-dev/ATT&CK-coverage.md"
5454
branch-suffix: "short-commit-hash"
5555
base: main
56-
title: 'Update ATT&CK coverage URL(s) in docs/ATT&CK-coverage.md'
56+
title: 'Update ATT&CK coverage URL(s) in docs-dev/ATT&CK-coverage.md'
5757
body: |
58-
Update ATT&CK coverage URL(s) in docs/ATT&CK-coverage.md
58+
Update ATT&CK coverage URL(s) in docs-dev/ATT&CK-coverage.md
5959
6060
- Autogenerated from job `attack-coverage-update: pr`.
6161
labels: "backport: auto"

.github/workflows/version-code-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- 'hunting/**/*.py'
99
- 'pyproject.toml'
1010
- 'Makefile'
11-
- 'docs/**'
11+
- 'docs-dev/**'
1212
- 'detection_rules/**'
1313
- 'tests/**'
1414
- '!hunting/**/*.md'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ instance/
7777
.scrapy
7878

7979
# Sphinx documentation
80-
docs/_build/
80+
docs-dev/_build/
8181

8282
# PyBuilder
8383
target/

CLI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ python -m detection_rules kibana import-rules -d test-export-rules -o
498498

499499
### Exporting rules
500500

501-
This command should be run with the `CUSTOM_RULES_DIR` envvar set, that way proper validation is applied to versioning when the rules are downloaded. See the [custom rules docs](docs/custom-rules.md) for more information.
501+
This command should be run with the `CUSTOM_RULES_DIR` envvar set, that way proper validation is applied to versioning when the rules are downloaded. See the [custom rules docs](docs-dev/custom-rules.md) for more information.
502502

503503
```
504504
python -m detection_rules kibana export-rules -h

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 REPO_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(REPO_DOCS_DIR, 'custom-rules.md')
1920

2021

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

detection_rules/devtools.py

Lines changed: 3 additions & 3 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, REPO_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
@@ -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=f'Update the {REPO_DOCS_DIR}/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(REPO_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: 2 additions & 0 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+
REPO_DOCS_DIR = "docs-dev"
28+
2729

2830
class PackageDocument(xlsxwriter.Workbook):
2931
"""Excel document for summarizing a rules package."""
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)