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

[FR] Bundle KQL & Kibana libs into base dependencies #3662

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[dev]
pip install lib/kql lib/kibana

- name: Prune non-${{matrix.target_branch}} rules
env:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/get-target-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
python -m pip install --upgrade pip
pip cache purge
pip install .[dev]
pip install lib/kql lib/kibana

- id: get-branch-list
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lock-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
python -m pip install --upgrade pip
pip cache purge
pip install .[dev]
pip install lib/kql lib/kibana

- name: Build release package
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/manual-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
python -m pip install --upgrade pip
pip cache purge
pip install .[dev]
pip install lib/kql lib/kibana

- name: Prune non-"${{github.event.inputs.target_branch}}" rules
env:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
python -m pip install --upgrade pip
pip cache purge
pip install .[dev]
pip install lib/kql lib/kibana
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If needed, we can also move this line up instead of removing it so that it installs from the local environment.


- name: Python Lint
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
python -m pip install --upgrade pip
pip cache purge
pip install .[dev]
pip install lib/kql lib/kibana

- name: Build Integration Docs
env:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-fleet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
python -m pip install --upgrade pip
pip cache purge
pip install .[dev]
pip install lib/kql lib/kibana

- name: Bump prebuilt rules package version
env:
Expand Down
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ clean:
rm -rf $(VENV) *.egg-info .eggs .egg htmlcov build dist packages .build .tmp .tox __pycache__ lib/kql/build lib/kibana/build lib/kql/*.egg-info lib/kibana/*.egg-info

.PHONY: deps
deps: $(VENV) install-packages
deps: $(VENV)
@echo "Installing all dependencies..."
$(PIP) install .[dev]

.PHONY: install-packages
install-packages:
@echo "Installing kql and kibana packages..."
$(PIP) install lib/kql lib/kibana

.PHONY: pytest
pytest: $(VENV) deps
$(PYTHON) -m detection_rules test
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,17 @@ Collecting Click==7.0
Downloading Click-7.0-py2.py3-none-any.whl (81 kB)
|████████████████████████████████| 81 kB 2.6 MB/s
...
pip3 install packages/kibana packages/kql
```

Note: The `kibana` and `kql` packages are not available on PyPI and must be installed from the `packages` directory or `git`.
Note: The `kibana` and `kql` packages are not available on PyPI and must be installed from the `lib` directory.

```console

# Install from the repository
pip3 install git+https://github.com/elastic/detection-rules.git#subdirectory=kibana
pip3 install git+https://github.com/elastic/detection-rules.git#subdirectory=kql

# or locally
# Or locally for development
pip3 install lib/kibana lib/kql
```

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ dependencies = [
"typing-inspect==0.9.0",
"typing-extensions==4.10.0",
"XlsxWriter~=3.2.0",
"semver==3.0.2"
"semver==3.0.2",
"detection-rules-kql @ git+https://github.com/elastic/detection-rules.git#subdirectory=lib/kql",
"detection-rules-kibana @ git+https://github.com/elastic/detection-rules.git#subdirectory=lib/kibana"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

]
[project.optional-dependencies]
dev = ["pep8-naming==0.13.0", "PyGithub==2.2.0", "flake8==7.0.0", "pyflakes==3.2.0", "pytest>=8.1.1", "pre-commit==3.6.2"]
Expand Down
Loading