Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
965041b
Init setup
smyrick Aug 27, 2025
3ef4932
feat: Add Kubernetes deployment support with security improvements
smyrick Aug 27, 2025
ed54b01
chore: Add IDE files to .gitignore
smyrick Aug 27, 2025
543ed4f
feat: complete repository cleanup and optimization
smyrick Aug 27, 2025
6049def
fix: add --validate=false to kubectl commands in GitHub Actions
smyrick Aug 27, 2025
543cf84
fix: add KinD cluster setup for Kubernetes manifest validation
smyrick Aug 27, 2025
4b2633c
fix: add --accept-license flag to Rover CLI commands
smyrick Aug 27, 2025
476cee9
Delete schemas
smyrick Aug 27, 2025
53241be
simplify: replace complex kubectl validation with basic YAML and Dock…
smyrick Aug 27, 2025
3a8d1af
Fix accept license
smyrick Aug 27, 2025
d790dc5
refactor: update all references to cleanup.sh to cleanup-k8s.sh
smyrick Aug 27, 2025
50b0f37
Cleanup readme
smyrick Aug 27, 2025
203c767
fix: add explicit kind cluster creation and verification in K8s deplo…
smyrick Aug 27, 2025
2270249
fix: correct YAML formatting in k8s/ingress.yaml
smyrick Aug 27, 2025
0397c49
fix: add document start markers to all Kubernetes YAML files
smyrick Aug 27, 2025
c026891
fix: correct YAML indentation in router-deployment-clusterip.yaml
smyrick Aug 27, 2025
1746b62
feat: add YAML linting to local tests
smyrick Aug 27, 2025
233bd40
fix: use python3 -m yamllint for more reliable YAML linting
smyrick Aug 27, 2025
c1dde7e
fix: simplify YAML linting to avoid installation issues
smyrick Aug 27, 2025
d4fabde
fix: correct YAML indentation in router-deployment-clusterip.yaml
smyrick Aug 27, 2025
425ca24
Update linter
smyrick Aug 27, 2025
00ff653
Lint GH actions files
smyrick Aug 27, 2025
3d51039
Run docker builds only
smyrick Aug 27, 2025
1527522
Rename file
smyrick Aug 27, 2025
cb9648d
Fix yaml
smyrick Aug 27, 2025
ed359aa
Duplicate tests
smyrick Aug 27, 2025
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
71 changes: 0 additions & 71 deletions .github/workflows/supergraph.graphql

This file was deleted.

216 changes: 200 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,207 @@
---
name: Test Apollo Supergraph

on:

Check warning on line 4 in .github/workflows/test.yaml

View workflow job for this annotation

GitHub Actions / Test Kubernetes YAML Format

4:1 [truthy] truthy value should be one of [false, true]
pull_request:
branches:
- main
push:
paths:
- Dockerfile
- router.yaml
- .github/workflows/test.yaml
- .github/workflows/supergraph.graphql
branches:
- main

jobs:
test:
name: Smoke test Router
test-subgraphs:
name: Test Subgraphs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Build Docker image
run: docker build -t router .
- name: Run Router
run: docker run -d --name router -p 4000:4000 -v ./.github/workflows/supergraph.graphql:/dist/supergraph.graphql router -s supergraph.graphql
- name: Wait for Router to start
run: sleep 5
- name: Test Router
run: |
curl http://localhost:4000 -d '{"query": "query{__typename}"}' -H "Content-Type: application/json"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: subgraphs/package-lock.json

- name: Install dependencies
run: |
cd subgraphs
npm ci

- name: Test subgraphs validation
run: |
cd subgraphs
if npm run | grep -q "validate"; then
npm run validate
else
echo "No validate script found, skipping"
fi

test-supergraph-composition:
name: Test Supergraph Composition
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install Rover CLI
run: |
curl -sSL https://rover.apollo.dev/nix/latest | sh
echo "$HOME/.rover/bin" >> $GITHUB_PATH

- name: Test supergraph composition
run: |
cd router
./compose.sh

# Verify the supergraph file was created
if [ ! -f "supergraph.graphql" ]; then
echo "❌ Supergraph composition failed - file not created"
exit 1
fi

# Verify the supergraph contains expected content
if ! grep -q "join__Graph" supergraph.graphql; then
echo "❌ Supergraph composition failed - missing join__Graph"
exit 1
fi

echo "βœ… Supergraph composition successful"

test-docker-builds:
name: Test Docker Builds
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build subgraphs Docker image
run: |
cd subgraphs
docker build -t subgraphs:test .

# Verify the image was created
if ! docker images | grep -q "subgraphs.*test"; then
echo "❌ Docker build failed for subgraphs"
exit 1
fi

echo "βœ… Subgraphs Docker build successful"

test-scripts:
name: Test Helper Scripts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Test script syntax
run: |
# Test that all scripts have valid syntax
for script in *.sh; do
if [ -f "$script" ]; then
echo "Testing syntax for $script"
bash -n "$script" || exit 1
fi
done

# Test scripts in scripts directory
if [ -d "scripts" ]; then
for script in scripts/*.sh; do
if [ -f "$script" ]; then
echo "Testing syntax for $script"
bash -n "$script" || exit 1
fi
done
fi

echo "βœ… All scripts have valid syntax"

- name: Test script help options
run: |
# Test that scripts with help options work
./run-k8s.sh --help || exit 1
./cleanup-k8s.sh --help || exit 1
./kill-minikube.sh --help || exit 1
./setup-minikube.sh --help || exit 1
./setup-env.sh --help || exit 1

echo "βœ… All script help options working"

test-k8s-yaml:
name: Test Kubernetes YAML Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Install yamllint
run: |
pip install yamllint

- name: Validate YAML files
run: |
# Test all YAML files in k8s directory
if [ -d "k8s" ]; then
for yaml_file in k8s/*.yaml; do
if [ -f "$yaml_file" ]; then
echo "Validating YAML format: $yaml_file"
yamllint "$yaml_file" || exit 1
fi
done
fi

# Test GitHub Actions workflows
for workflow in .github/workflows/*.yaml; do
if [ -f "$workflow" ]; then
echo "Validating workflow: $workflow"
yamllint "$workflow" || exit 1
fi
done

echo "βœ… All YAML files have valid format"

- name: Test Kubernetes manifest structure
run: |
# Basic structure validation without kubectl
echo "Testing Kubernetes manifest structure..."

# Check if required files exist
required_files=("k8s/namespace.yaml" \
"k8s/subgraphs-deployment-clusterip.yaml" \
"k8s/router-deployment-clusterip.yaml" \
"k8s/ingress.yaml")

for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
echo "❌ Required Kubernetes manifest missing: $file"
exit 1
fi
echo "βœ… Found: $file"
done

# Check for basic Kubernetes resource types
for file in k8s/*.yaml; do
if [ -f "$file" ]; then
echo "Checking $file for Kubernetes resource types..."
if ! grep -q "kind:" "$file"; then
echo "❌ No 'kind:' field found in $file"
exit 1
fi
if ! grep -q "apiVersion:" "$file"; then
echo "❌ No 'apiVersion:' field found in $file"
exit 1
fi
fi
done

echo "βœ… All Kubernetes manifests have basic structure"
26 changes: 0 additions & 26 deletions .github/workflows/update-router-config.yaml

This file was deleted.

43 changes: 42 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
.env
# Environment files
.env
router/.env

# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Generated files
router/supergraph.graphql

# IDE files
.idea/
.vscode/
*.swp
*.swo
*~

# OS files
.DS_Store
Thumbs.db

# Logs
*.log
logs/

# Temporary files
*.tmp
*.temp
*.backup

# Docker
.dockerignore

# Kubernetes
*.kubeconfig

# Build artifacts
dist/
build/
4 changes: 0 additions & 4 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/graphql-settings.xml

This file was deleted.

Loading