Repository navigation
fix: purge localhost fallbacks from omnibase_infra [OMN-7227] #1127
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
Merged
jonahgabriel
merged 21 commits into
main
from
jonah/omn-7227-omnibase-infra-purge-fallbacks
Apr 3, 2026
Merged
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d78a9ed
fix: purge localhost fallbacks from omnibase_infra, require env vars …
jonahgabriel 2ecce12
Merge branch 'main' into jonah/omn-7227-omnibase-infra-purge-fallbacks
jonahgabriel 9addccd
fix: ruff format on 3 files
jonahgabriel 2317af6
fix(tests): update tests for localhost fallback removal [OMN-7227]
jonahgabriel a263800
fix(tests): remove Kafka bootstrap defaults — defeats @requires_kafka…
jonahgabriel 6f51ae7
fix(ci): add ONEX_EXCLUDE to postgres handler env fallback, keep INV-…
jonahgabriel edd0de4
Merge remote-tracking branch 'origin/main' into jonah/omn-7227-omniba…
jonahgabriel fb4aaee
fix: correct INV-3 budget comment — handler_graph contributes 1, not …
jonahgabriel 2752113
fix(lint): use fmt:skip to preserve ONEX_EXCLUDE on long line — passe…
jonahgabriel 97cd384
fix: restore KAFKA_BOOTSTRAP_SERVERS test default in conftest [OMN-7227]
jonahgabriel afe0af2
fix(tests): remove KAFKA_BOOTSTRAP_SERVERS from global conftest defaults
jonahgabriel b610271
fix(tests): restore KAFKA_BOOTSTRAP_SERVERS in conftest, add KAFKA_IN…
jonahgabriel 8291c58
fix: supply kafka_bootstrap_servers explicitly in ConfigSavingsEstima…
jonahgabriel d6e12fb
fix: supply kafka_bootstrap_servers in all observability config test …
jonahgabriel 8750109
fix: add kafka_bootstrap_servers to monkeypatch env-based test cases
jonahgabriel 24f5418
fix: supply required bootstrap_servers in ConfigSessionConsumer and o…
jonahgabriel 1276399
fix: remove KAFKA_BOOTSTRAP_SERVERS from global _TEST_ENV_DEFAULTS
jonahgabriel 191fa66
docs: update DLQ test comment — KAFKA_BOOTSTRAP_SERVERS no longer set…
jonahgabriel 887aee9
fix: restore KAFKA_BOOTSTRAP_SERVERS global default, gate E2E tests o…
jonahgabriel e796a24
fix: gate Qdrant integration tests on QDRANT_INTEGRATION_TESTS=1
jonahgabriel a8d3fee
fix: ruff format Qdrant integration guard additions
jonahgabriel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| #!/usr/bin/env python3 | ||
| # SPDX-FileCopyrightText: 2025 OmniNode.ai Inc. | ||
| # SPDX-License-Identifier: MIT | ||
| """Validate that no localhost fallbacks exist in src/ Python files. | ||
|
|
||
| Scans src/**/*.py for patterns like: | ||
| - os.environ.get("...", "localhost...") | ||
| - default="localhost..." | ||
| - default="http://localhost..." | ||
| - default="bolt://localhost..." | ||
| - default="redis://localhost..." | ||
| - default="postgresql://localhost..." | ||
|
|
||
| Exits non-zero if any violations are found. | ||
| Skips test files (tests/, __tests__/). | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import re | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| VIOLATIONS_PATTERNS = [ | ||
| re.compile(r'os\.environ\.get\([^)]*,\s*"(localhost|http://localhost|bolt://localhost|redis://localhost|postgresql://localhost)'), | ||
| re.compile(r'default="(localhost|http://localhost|bolt://localhost|redis://localhost|postgresql://localhost)'), | ||
| ] | ||
|
|
||
| SKIP_DIRS = {"tests", "__tests__", "test", "__pycache__"} | ||
|
|
||
|
|
||
| def scan(root: Path) -> list[tuple[str, int, str]]: | ||
| violations: list[tuple[str, int, str]] = [] | ||
| for py_file in sorted(root.rglob("*.py")): | ||
| # Skip test directories | ||
| if any(part in SKIP_DIRS for part in py_file.parts): | ||
| continue | ||
| try: | ||
| lines = py_file.read_text().splitlines() | ||
| except (OSError, UnicodeDecodeError): | ||
| continue | ||
| for lineno, line in enumerate(lines, start=1): | ||
| for pattern in VIOLATIONS_PATTERNS: | ||
| if pattern.search(line): | ||
| violations.append((str(py_file), lineno, line.strip())) | ||
| break # one violation per line is enough | ||
| return violations | ||
|
|
||
|
|
||
| def main() -> int: | ||
| src_dir = Path(__file__).resolve().parent.parent / "src" | ||
| if not src_dir.is_dir(): | ||
| print(f"ERROR: src directory not found at {src_dir}", file=sys.stderr) | ||
| return 1 | ||
|
|
||
| violations = scan(src_dir) | ||
| if violations: | ||
| print(f"Found {len(violations)} localhost fallback(s):\n") | ||
| for filepath, lineno, line in violations: | ||
| print(f" {filepath}:{lineno}: {line}") | ||
| print("\nAll localhost/default fallbacks must be removed from src/.") | ||
| return 1 | ||
|
|
||
| print("OK: No localhost fallbacks found in src/.") | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| sys.exit(main()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.