Skip to content

Commit 18fda2d

Browse files
committed
changes
1 parent 2dc87df commit 18fda2d

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

docs/search/search-query-language/search-operators/where.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ For example, using `where` with the boolean operator [`isValidIP`](/docs/searc
1616
```sql
1717
_collector="ABC1" | where type="web"
1818
```
19+
```sql
20+
_collector="ABC2" | where type="web"
21+
```
1922
* Filters as false and will not return results:
2023
```sql
2124
| where !isValidIP("192.168.0.10")

scripts/validate_queries.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,33 @@
66
from pathlib import Path
77
from sumologic_client import SumoLogicClient
88

9+
def debug_environment():
10+
"""Print critical debugging info"""
11+
print("::group::Debug Information")
12+
print(f"Current directory: {os.getcwd()}")
13+
print("Directory contents:")
14+
os.system("ls -R")
15+
print(f"Environment: {dict(os.environ)}")
16+
print("::endgroup::")
17+
18+
def get_changed_files():
19+
"""Get changed files from GitHub or fallback to full scan"""
20+
# Try GitHub Actions event data first
21+
if "GITHUB_EVENT_PATH" in os.environ:
22+
try:
23+
with open(os.environ["GITHUB_EVENT_PATH"]) as f:
24+
event_data = json.load(f)
25+
return [
26+
f for f in
27+
[f.get('filename') for f in event_data.get('pull_request', {}).get('files', [])]
28+
if f and f.endswith('.md')
29+
]
30+
except Exception as e:
31+
print(f"::warning::Failed to read GitHub event: {str(e)}")
32+
33+
# Fallback: Scan all documentation files
34+
return [str(p) for p in Path(".").rglob("*.md") if "search-query-language" in str(p)]
35+
936
def find_sql_blocks_in_pr():
1037
"""Detect changed SQL blocks with better debugging"""
1138
print("::group::Detecting SQL blocks") # GitHub Actions log grouping
@@ -34,6 +61,16 @@ def find_sql_blocks_in_pr():
3461
return changed_files
3562

3663
def validate_queries():
64+
debug_environment()
65+
66+
changed_files = get_changed_files()
67+
print(f"::group::Files to validate")
68+
print("\n".join(changed_files) or "No files found")
69+
print("::endgroup::")
70+
71+
if not changed_files:
72+
print("::warning::No Markdown files found to validate")
73+
return
3774
print("::group::Starting validation")
3875
client = SumoLogicClient()
3976
failed = False

0 commit comments

Comments
 (0)