Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ fly-deploy-development-fresh:
# test fly.io build locally before deploying (helps catch issues early)
fly-build-test:
@echo "🧪 Testing Fly.io build locally..."
docker build --no-cache -f docker/Dockerfile.fly -t anomstack-fly-test .
@GIT_COMMIT_HASH=$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") && \
echo "📝 Git commit hash: $$GIT_COMMIT_HASH" && \
docker build --no-cache -f docker/Dockerfile.fly --build-arg ANOMSTACK_BUILD_HASH="$$GIT_COMMIT_HASH" -t anomstack-fly-test .
@echo "✅ Build successful! Testing container startup..."
@echo "🚀 Starting container on port 3001 (http://localhost:3001)..."
@echo "Press Ctrl+C to stop the test container"
Expand Down
13 changes: 1 addition & 12 deletions dashboard/routes/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
from dashboard.constants import DEFAULT_LAST_N
from dashboard.data import get_data

try:
from anomstack.version import get_version_string
except ImportError:
def get_version_string():
return "version unknown"

log = logging.getLogger("anomstack_dashboard")

Expand Down Expand Up @@ -95,13 +90,7 @@ def create_main_content(batch_stats: dict, sorted_batch_names: list) -> Div:
Card(
DivLAligned(
Div(
Div(
H2("Anomstack", cls="text-2xl font-bold pl-2"),
P(
get_version_string(),
cls="text-xs text-muted-foreground pl-2",
),
),
H2("Anomstack", cls="text-2xl font-bold pl-2"),
P(
Comment on lines 91 to 94
Copy link

Copilot AI Aug 23, 2025

Choose a reason for hiding this comment

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

After removing the version display, there's now a nested Div inside DivLAligned that only contains the H2 and P elements. Consider flattening this structure by removing the extra Div wrapper to simplify the HTML structure.

Copilot uses AI. Check for mistakes.
"Painless open source anomaly detection for your metrics 📈📉🚀",
cls="text-muted-foreground pl-2",
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile.fly
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ COPY anomstack ./anomstack
COPY dashboard ./dashboard
COPY metrics ./metrics

# Capture git commit hash for version info
ARG ANOMSTACK_BUILD_HASH
ENV ANOMSTACK_BUILD_HASH=${ANOMSTACK_BUILD_HASH}

# Copy configuration files
COPY dagster_fly.yaml ./dagster_home/dagster.yaml
COPY workspace.yaml ./dagster_home/workspace.yaml
Expand Down
18 changes: 16 additions & 2 deletions scripts/deployment/deploy_fly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ rm fly.toml.bak
# Deploy the application (force rebuild to ensure latest files are included)
echo "🚀 Deploying application..."

# Capture git commit hash for version tracking
GIT_COMMIT_HASH=""
if git rev-parse --short HEAD >/dev/null 2>&1; then
GIT_COMMIT_HASH=$(git rev-parse --short HEAD)
echo "📝 Git commit hash: $GIT_COMMIT_HASH"
else
echo "⚠️ Could not determine git commit hash (not in a git repository or git not available)"
fi
Comment on lines +237 to +244
Copy link

Copilot AI Aug 23, 2025

Choose a reason for hiding this comment

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

The git commit hash is captured twice with git rev-parse --short HEAD - once in the condition check and once for assignment. Consider capturing it once and checking if the result is non-empty to avoid redundant git command execution.

Copilot uses AI. Check for mistakes.

if [[ "$FORCE_REBUILD" == "true" ]]; then
# Generate unique cache busting value with timestamp + random
CACHEBUST_VALUE="$(date +%s)-$(openssl rand -hex 4 2>/dev/null || echo $RANDOM)"
Expand All @@ -243,15 +252,20 @@ if [[ "$FORCE_REBUILD" == "true" ]]; then
# Use multiple cache busting strategies:
# 1. --no-cache: Skip Docker layer cache
# 2. CACHEBUST build arg: Force rebuild of layers that use it
# 3. --dockerfile: Explicit dockerfile path to avoid confusion
# 3. ANOMSTACK_BUILD_HASH build arg: Include git commit hash in container
# 4. --dockerfile: Explicit dockerfile path to avoid confusion
fly deploy \
--no-cache \
--build-arg CACHEBUST="$CACHEBUST_VALUE" \
--build-arg ANOMSTACK_BUILD_HASH="$GIT_COMMIT_HASH" \
--dockerfile docker/Dockerfile.fly \
-a "$APP_NAME"
else
echo "⚡ Standard deployment (with caching)..."
fly deploy --dockerfile docker/Dockerfile.fly -a "$APP_NAME"
fly deploy \
--build-arg ANOMSTACK_BUILD_HASH="$GIT_COMMIT_HASH" \
--dockerfile docker/Dockerfile.fly \
-a "$APP_NAME"
fi

# Show the status
Expand Down
24 changes: 0 additions & 24 deletions tests/test_docs_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,6 @@ def test_docusaurus_build_succeeds():
pytest.skip("yarn not available. Install Node.js and yarn to run this test.")


def test_architecture_grpc_section_exists():
"""Test that the gRPC opt-in section exists in ARCHITECTURE.md."""
repo_root = Path(__file__).parent.parent
architecture_file = repo_root / "ARCHITECTURE.md"

if not architecture_file.exists():
pytest.skip("ARCHITECTURE.md not found")

with open(architecture_file, 'r', encoding='utf-8') as f:
content = f.read()

# Check that the gRPC section exists
assert "### Advanced: gRPC Code Server (Optional)" in content, \
"ARCHITECTURE.md should contain the gRPC opt-in section"

# Check that it mentions the anchor that docs link to
assert "advanced-grpc-code-server-optional" in content.lower().replace(' ', '-').replace(':', ''), \
"gRPC section should be linkable with the expected anchor"


if __name__ == "__main__":
Expand All @@ -68,12 +50,6 @@ def test_architecture_grpc_section_exists():

print("🔍 Testing Docusaurus documentation...")

try:
test_architecture_grpc_section_exists()
print("✅ gRPC section test passed")
except Exception as e:
print(f"❌ gRPC section test failed: {e}")
sys.exit(1)

try:
test_docusaurus_build_succeeds()
Expand Down