Skip to content

Commit 089df72

Browse files
authored
Merge pull request #201 from andrewm4894/app-version-cleanup
Remove version from dashboard header and fix commit hash tracking
2 parents ab304cf + 443c051 commit 089df72

File tree

5 files changed

+24
-39
lines changed

5 files changed

+24
-39
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ fly-deploy-development-fresh:
239239
# test fly.io build locally before deploying (helps catch issues early)
240240
fly-build-test:
241241
@echo "🧪 Testing Fly.io build locally..."
242-
docker build --no-cache -f docker/Dockerfile.fly -t anomstack-fly-test .
242+
@GIT_COMMIT_HASH=$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") && \
243+
echo "📝 Git commit hash: $$GIT_COMMIT_HASH" && \
244+
docker build --no-cache -f docker/Dockerfile.fly --build-arg ANOMSTACK_BUILD_HASH="$$GIT_COMMIT_HASH" -t anomstack-fly-test .
243245
@echo "✅ Build successful! Testing container startup..."
244246
@echo "🚀 Starting container on port 3001 (http://localhost:3001)..."
245247
@echo "Press Ctrl+C to stop the test container"

dashboard/routes/index.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
from dashboard.constants import DEFAULT_LAST_N
2020
from dashboard.data import get_data
2121

22-
try:
23-
from anomstack.version import get_version_string
24-
except ImportError:
25-
def get_version_string():
26-
return "version unknown"
2722

2823
log = logging.getLogger("anomstack_dashboard")
2924

@@ -95,13 +90,7 @@ def create_main_content(batch_stats: dict, sorted_batch_names: list) -> Div:
9590
Card(
9691
DivLAligned(
9792
Div(
98-
Div(
99-
H2("Anomstack", cls="text-2xl font-bold pl-2"),
100-
P(
101-
get_version_string(),
102-
cls="text-xs text-muted-foreground pl-2",
103-
),
104-
),
93+
H2("Anomstack", cls="text-2xl font-bold pl-2"),
10594
P(
10695
"Painless open source anomaly detection for your metrics 📈📉🚀",
10796
cls="text-muted-foreground pl-2",

docker/Dockerfile.fly

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ COPY anomstack ./anomstack
3030
COPY dashboard ./dashboard
3131
COPY metrics ./metrics
3232

33+
# Capture git commit hash for version info
34+
ARG ANOMSTACK_BUILD_HASH
35+
ENV ANOMSTACK_BUILD_HASH=${ANOMSTACK_BUILD_HASH}
36+
3337
# Copy configuration files
3438
COPY dagster_fly.yaml ./dagster_home/dagster.yaml
3539
COPY workspace.yaml ./dagster_home/workspace.yaml

scripts/deployment/deploy_fly.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ rm fly.toml.bak
234234
# Deploy the application (force rebuild to ensure latest files are included)
235235
echo "🚀 Deploying application..."
236236

237+
# Capture git commit hash for version tracking
238+
GIT_COMMIT_HASH=""
239+
if git rev-parse --short HEAD >/dev/null 2>&1; then
240+
GIT_COMMIT_HASH=$(git rev-parse --short HEAD)
241+
echo "📝 Git commit hash: $GIT_COMMIT_HASH"
242+
else
243+
echo "⚠️ Could not determine git commit hash (not in a git repository or git not available)"
244+
fi
245+
237246
if [[ "$FORCE_REBUILD" == "true" ]]; then
238247
# Generate unique cache busting value with timestamp + random
239248
CACHEBUST_VALUE="$(date +%s)-$(openssl rand -hex 4 2>/dev/null || echo $RANDOM)"
@@ -243,15 +252,20 @@ if [[ "$FORCE_REBUILD" == "true" ]]; then
243252
# Use multiple cache busting strategies:
244253
# 1. --no-cache: Skip Docker layer cache
245254
# 2. CACHEBUST build arg: Force rebuild of layers that use it
246-
# 3. --dockerfile: Explicit dockerfile path to avoid confusion
255+
# 3. ANOMSTACK_BUILD_HASH build arg: Include git commit hash in container
256+
# 4. --dockerfile: Explicit dockerfile path to avoid confusion
247257
fly deploy \
248258
--no-cache \
249259
--build-arg CACHEBUST="$CACHEBUST_VALUE" \
260+
--build-arg ANOMSTACK_BUILD_HASH="$GIT_COMMIT_HASH" \
250261
--dockerfile docker/Dockerfile.fly \
251262
-a "$APP_NAME"
252263
else
253264
echo "⚡ Standard deployment (with caching)..."
254-
fly deploy --dockerfile docker/Dockerfile.fly -a "$APP_NAME"
265+
fly deploy \
266+
--build-arg ANOMSTACK_BUILD_HASH="$GIT_COMMIT_HASH" \
267+
--dockerfile docker/Dockerfile.fly \
268+
-a "$APP_NAME"
255269
fi
256270

257271
# Show the status

tests/test_docs_links.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,6 @@ def test_docusaurus_build_succeeds():
4242
pytest.skip("yarn not available. Install Node.js and yarn to run this test.")
4343

4444

45-
def test_architecture_grpc_section_exists():
46-
"""Test that the gRPC opt-in section exists in ARCHITECTURE.md."""
47-
repo_root = Path(__file__).parent.parent
48-
architecture_file = repo_root / "ARCHITECTURE.md"
49-
50-
if not architecture_file.exists():
51-
pytest.skip("ARCHITECTURE.md not found")
52-
53-
with open(architecture_file, 'r', encoding='utf-8') as f:
54-
content = f.read()
55-
56-
# Check that the gRPC section exists
57-
assert "### Advanced: gRPC Code Server (Optional)" in content, \
58-
"ARCHITECTURE.md should contain the gRPC opt-in section"
59-
60-
# Check that it mentions the anchor that docs link to
61-
assert "advanced-grpc-code-server-optional" in content.lower().replace(' ', '-').replace(':', ''), \
62-
"gRPC section should be linkable with the expected anchor"
6345

6446

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

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

71-
try:
72-
test_architecture_grpc_section_exists()
73-
print("✅ gRPC section test passed")
74-
except Exception as e:
75-
print(f"❌ gRPC section test failed: {e}")
76-
sys.exit(1)
7753

7854
try:
7955
test_docusaurus_build_succeeds()

0 commit comments

Comments
 (0)