Skip to content

Commit e6fda1e

Browse files
authored
Pin dependencies and relocate plugin files (#3)
Addresses review feedback: 1. Pin all dependencies to exact versions (crowdstrike-falconpy==1.6.1, pylint==4.0.5, pytest==9.0.2). 2. Move requirements.txt, pyproject.toml, .pylintrc, tests/, test-scripts.sh, test-e2e.sh, and .env.example into plugins/fusion-workflows/ since they are specific to that plugin. CI workflow paths updated accordingly. conftest.py sys.path simplified now that tests live closer to the scripts they test.
1 parent 8392bc7 commit e6fda1e

16 files changed

Lines changed: 20 additions & 20 deletions

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
python-version: "3.12"
2121
cache: pip
2222
- name: Install dependencies
23-
run: pip install -r requirements.txt
23+
run: pip install -r plugins/fusion-workflows/requirements.txt
2424
- name: Pylint
25-
run: pylint plugins/fusion-workflows/skills/fusion-workflows/scripts/*.py
25+
run: pylint --rcfile=plugins/fusion-workflows/.pylintrc plugins/fusion-workflows/skills/fusion-workflows/scripts/*.py
2626
- name: Shellcheck
27-
run: shellcheck test-scripts.sh test-e2e.sh
27+
run: shellcheck plugins/fusion-workflows/test-scripts.sh plugins/fusion-workflows/test-e2e.sh
2828

2929
test:
3030
runs-on: ubuntu-latest
@@ -36,9 +36,9 @@ jobs:
3636
python-version: "3.12"
3737
cache: pip
3838
- name: Install dependencies
39-
run: pip install -r requirements.txt
39+
run: pip install -r plugins/fusion-workflows/requirements.txt
4040
- name: Run tests
41-
run: pytest tests/ -v
41+
run: pytest plugins/fusion-workflows/tests/ -v
4242

4343
validate:
4444
runs-on: ubuntu-latest
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
crowdstrike-falconpy==1.6.1
2+
pylint==4.0.5
3+
pytest==9.0.2

test-e2e.sh renamed to plugins/fusion-workflows/test-e2e.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
set -euo pipefail
1414

15-
REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
16-
SCRIPTS_DIR="$REPO_ROOT/plugins/fusion-workflows/skills/fusion-workflows/scripts"
15+
PLUGIN_DIR="$(cd "$(dirname "$0")" && pwd)"
16+
SCRIPTS_DIR="$PLUGIN_DIR/skills/fusion-workflows/scripts"
1717
PASS=0
1818
FAIL=0
1919
SKIP=0
@@ -46,9 +46,9 @@ echo "────────────────────────
4646

4747
# Check credentials
4848
if [[ -z "${CS_CLIENT_ID:-}" || -z "${CS_CLIENT_SECRET:-}" ]]; then
49-
if [[ -f "$REPO_ROOT/.env" ]]; then
49+
if [[ -f "$PLUGIN_DIR/.env" ]]; then
5050
# shellcheck disable=SC1091
51-
source "$REPO_ROOT/.env" 2>/dev/null || true
51+
source "$PLUGIN_DIR/.env" 2>/dev/null || true
5252
fi
5353
fi
5454

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
set -euo pipefail
1111

12-
REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
13-
SCRIPTS_DIR="$REPO_ROOT/plugins/fusion-workflows/skills/fusion-workflows/scripts"
14-
ASSETS_DIR="$REPO_ROOT/plugins/fusion-workflows/skills/fusion-workflows/assets"
12+
PLUGIN_DIR="$(cd "$(dirname "$0")" && pwd)"
13+
SCRIPTS_DIR="$PLUGIN_DIR/skills/fusion-workflows/scripts"
14+
ASSETS_DIR="$PLUGIN_DIR/skills/fusion-workflows/assets"
1515
PASS=0
1616
FAIL=0
1717
SKIP=0
@@ -37,9 +37,9 @@ echo "────────────────────────
3737

3838
# Check for credentials
3939
if [[ -z "${CS_CLIENT_ID:-}" || -z "${CS_CLIENT_SECRET:-}" ]]; then
40-
if [[ -f "$REPO_ROOT/.env" ]]; then
40+
if [[ -f "$PLUGIN_DIR/.env" ]]; then
4141
# shellcheck disable=SC1091
42-
source "$REPO_ROOT/.env" 2>/dev/null || true
42+
source "$PLUGIN_DIR/.env" 2>/dev/null || true
4343
fi
4444
fi
4545

tests/conftest.py renamed to plugins/fusion-workflows/tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
SCRIPTS_DIR = os.path.join(
1313
os.path.dirname(__file__),
1414
"..",
15-
"plugins",
16-
"fusion-workflows",
1715
"skills",
1816
"fusion-workflows",
1917
"scripts",
@@ -29,7 +27,9 @@ def clean_env(monkeypatch):
2927
monkeypatch.delenv("CS_CLIENT_ID", raising=False)
3028
monkeypatch.delenv("CS_CLIENT_SECRET", raising=False)
3129
monkeypatch.delenv("CS_BASE_URL", raising=False)
32-
monkeypatch.delenv("CS_ENV_FILE", raising=False)
30+
# Point CS_ENV_FILE to a nonexistent path so load_env() won't walk up
31+
# and find a real .env file on the developer's machine.
32+
monkeypatch.setenv("CS_ENV_FILE", "/nonexistent/.env")
3333
cs_auth.reset_client()
3434

3535

tests/test_action_search.py renamed to plugins/fusion-workflows/tests/test_action_search.py

File renamed without changes.

tests/test_auth.py renamed to plugins/fusion-workflows/tests/test_auth.py

File renamed without changes.

0 commit comments

Comments
 (0)