Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c0b0f57
chore: fix formatting (pre-commit hooks)
rclanan Dec 1, 2025
3c069f0
fix: update all mockforge dependency versions to 0.3.3 in mockforge-http
rclanan Dec 1, 2025
74d28c3
Fix Docker build, k8s validation, and spell check issues
rclanan Dec 1, 2025
50daf6e
Fix mockforge-smtp version constraint from 0.2.0 to 0.3.3
rclanan Dec 1, 2025
772c7d7
Optimize workflows: update deprecated actions and add path filters
rclanan Dec 1, 2025
2641790
Fix all test failures and resolve dependency conflicts
rclanan Dec 1, 2025
86016e8
Fix kubectl validation to skip server connection
rclanan Dec 1, 2025
69c007a
Fix kubectl validation to prevent server connection attempts
rclanan Dec 1, 2025
6746636
Skip CRDs in kubectl validation to avoid server connection
rclanan Dec 1, 2025
f8db858
fix: standardize dependencies and fix all test failures
rclanan Dec 1, 2025
adcceb4
fix: fix GitHub Actions workflow failures
rclanan Dec 1, 2025
505dee1
fix: update MSRV from 1.82 to 1.75
rclanan Dec 1, 2025
287dd5a
fix: update MSRV to 1.80 and add GraphQL exclusion workaround
rclanan Dec 2, 2025
52d43c9
fix: pin sysinfo to 0.36, fix typos, improve MSRV workaround
rclanan Dec 2, 2025
ac1d12a
fix: sync sysinfo to 0.37, fix resolveable typo, exclude ace.js from …
rclanan Dec 2, 2025
34aaa39
fix: disable sysinfo feature during MSRV checks
rclanan Dec 2, 2025
93d53d0
fix: exclude highlight.js from spell check
rclanan Dec 2, 2025
ad10b6a
fix: exclude elasticlunr.min.js from spell check
rclanan Dec 2, 2025
c4aef39
fix: also remove sysinfo from mockforge-ui during MSRV checks
rclanan Dec 2, 2025
ff51e29
fix: exclude FontAwesome and all minified files from spell check
rclanan Dec 2, 2025
809a780
fix: add abd and existant to typos config
rclanan Dec 2, 2025
0ae7dcc
fix: exclude mockforge-ui from MSRV checks
rclanan Dec 2, 2025
b084a6b
fix: pin base64ct to 1.7 for MSRV compatibility
rclanan Dec 2, 2025
258fdd7
fix: improve base64ct pinning in MSRV workflow
rclanan Dec 2, 2025
e29b6f3
fix: use exact version constraint for base64ct in MSRV workflow
rclanan Dec 2, 2025
176bf18
fix: improve base64ct pinning order in MSRV workflow
rclanan Dec 2, 2025
66e5bcc
fix: use Cargo patch section to pin base64ct for MSRV
rclanan Dec 2, 2025
14b04cd
fix: use awk instead of sed for multi-line patch section insertion
rclanan Dec 2, 2025
b7396a7
fix: exclude mockforge-collab from MSRV checks and remove patch section
rclanan Dec 2, 2025
8d47f88
fix: remove argon2 from mockforge-core during MSRV checks
rclanan Dec 2, 2025
3dce786
fix: temporarily convert dependent crates' dependencies to path befor…
rclanan Dec 2, 2025
46a6ad2
fix: add mockforge-template-expansion to publishing script
rclanan Dec 2, 2025
212276f
fix: publish mockforge-template-expansion before mockforge-core
rclanan Dec 2, 2025
bfbd3ee
fix: handle short form dependencies when converting to path
rclanan Dec 2, 2025
87d4e95
fix: add all missing crates to workspace members
rclanan Dec 2, 2025
a26a865
fix: add mockforge-pipelines to workspace and publishing script
rclanan Dec 2, 2025
dc17d26
fix: add mockforge-pipelines to publishing order and dependency targets
rclanan Dec 2, 2025
733607a
fix: add missing README.md for mockforge-pipelines
rclanan Dec 2, 2025
060254b
fix: add mockforge-collab to workspace members
rclanan Dec 2, 2025
bfece4b
fix: add mockforge-collab to workspace members list
rclanan Dec 2, 2025
a791237
fix: add mockforge-performance to publishing order before mockforge-http
rclanan Dec 3, 2025
702d5ea
fix: reduce keywords to 5 for mockforge-performance (crates.io limit)
rclanan Dec 3, 2025
394cb0a
fix: reduce keywords from 6 to 5 for mockforge-performance
rclanan Dec 3, 2025
729883c
fix: add mockforge-route-chaos to publishing order before mockforge-http
rclanan Dec 3, 2025
2a1a840
fix: add mockforge-route-chaos to workspace and publishing script
rclanan Dec 3, 2025
c445d6c
fix: add mockforge-route-chaos to dependency targets and publishing o…
rclanan Dec 3, 2025
a658105
fix: add mockforge-route-chaos publishing step before mockforge-http
rclanan Dec 3, 2025
312b878
fix: add mockforge-world-state to workspace and publishing order befo…
rclanan Dec 3, 2025
08dc5b5
fix: add missing crates to workspace (mockforge-sdk, mockforge-http, …
rclanan Dec 3, 2025
3f85c3d
fix: add mockforge-cli to workspace and add metadata to mockforge-k8s…
rclanan Dec 3, 2025
bf4b9eb
chore: restore dependencies after publishing all crates
rclanan Dec 3, 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
16 changes: 10 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Cargo configuration for MockForge
# This file helps with sqlx offline mode for mockforge-collab
#
# IMPORTANT FOR PUBLISHING:
# - Published crates from crates.io will include the .sqlx/ directory
# - The build.rs script automatically enables SQLX_OFFLINE=true when .sqlx exists
# - No DATABASE_URL is needed for published crates
# - This config is only for local development when regenerating query cache

[env]
# Set DATABASE_URL for sqlx compile-time query checking
# Using SQLite for development - can be overridden with environment variable
# Note: The database file will be created automatically if it doesn't exist
DATABASE_URL = { value = "sqlite:///home/rclanan/dev/projects/work/mockforge/crates/mockforge-collab/compile-check.db" }
# DATABASE_URL for local development only (commented out for publishing)
# Uncomment this line only when you need to regenerate .sqlx query cache locally
# DATABASE_URL = { value = "sqlite:///home/rclanan/dev/projects/work/mockforge/crates/mockforge-collab/compile-check.db" }

# Enable sqlx offline mode to avoid database connection requirements during compilation
# Set this to true if you don't have a database connection available
# The build.rs script automatically enables this when .sqlx directory exists
# SQLX_OFFLINE = "true"
# Note: Disabled for now - using DATABASE_URL instead for compile-time checking

# Note: If you need to update sqlx query metadata, run:
# cd crates/mockforge-collab && cargo sqlx prepare --database-url postgresql://user:pass@localhost/dbname
6 changes: 3 additions & 3 deletions .github/workflows/breaking-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
with:
toolchain: stable

- name: Install MockForge
- name: Build MockForge
working-directory: pr-branch
run: cargo install --path crates/mockforge-cli
run: cargo build --release --bin mockforge

- name: Compare API specs
id: compare
working-directory: pr-branch
run: |
mockforge-cli compare \
./target/release/mockforge compare \
--old ../main-branch/specs/api.yaml \
--new specs/api.yaml \
--output breaking-changes.md \
Expand Down
86 changes: 62 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,34 @@ jobs:
run: cargo doc --workspace --no-deps
if: matrix.rust == 'stable'

changelog-validation:
name: Validate Changelog Pillar Tags
ui-test:
name: UI Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Validate pillar tags in changelog
run: |
# Check if CHANGELOG.md exists
if [ ! -f CHANGELOG.md ]; then
echo "ERROR: CHANGELOG.md not found"
exit 1
fi

# Use the check-changelog.sh script for consistent validation
chmod +x scripts/check-changelog.sh
if scripts/check-changelog.sh; then
echo "✅ Changelog validation passed: pillar tags found in all sections."
else
echo "::error::Changelog validation failed. Ensure all sections have pillar tags."
echo "::error::See docs/PILLARS.md for pillar definitions: [Reality], [Contracts], [DevX], [Cloud], [AI]"
exit 1
fi
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
working-directory: crates/mockforge-ui/ui
run: npm ci

- name: Run tests
working-directory: crates/mockforge-ui/ui
run: npm test

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
directory: crates/mockforge-ui/ui/coverage
flags: ui-tests

security-audit:
name: Security Audit
Expand Down Expand Up @@ -190,7 +194,7 @@ jobs:
- name: Install Rust toolchain (MSRV)
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.82" # MSRV updated for ICU crates
toolchain: "1.80" # MSRV - minimum version that supports Cargo.lock v4 (GraphQL crate excluded as it requires edition2024/unstable features)

- name: Install protoc (protobuf compiler)
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
Expand All @@ -215,7 +219,41 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Check MSRV compatibility
run: cargo check --workspace
run: |
# Temporarily remove mockforge-graphql, mockforge-ui, and mockforge-collab from workspace for MSRV check
# (mockforge-graphql requires async-graphql 7.0 which needs edition2024/unstable features)
# (mockforge-ui uses sysinfo 0.37 directly which requires edition2024)
# (mockforge-collab pulls in base64ct 1.8+ via argon2, which requires edition2024)
# This prevents Cargo from trying to parse manifests with edition2024 requirements
sed -i '/"crates\/mockforge-graphql",/d' Cargo.toml
sed -i '/"crates\/mockforge-ui",/d' Cargo.toml
sed -i '/"crates\/mockforge-collab",/d' Cargo.toml
# Also remove optional mockforge-graphql dependencies from other crates
sed -i '/mockforge-graphql = { version = "0.3.5", path = "..\/mockforge-graphql", optional = true }/d' crates/mockforge-cli/Cargo.toml crates/mockforge-sdk/Cargo.toml
# Remove mockforge-collab dependencies from other crates
sed -i '/mockforge-collab = { version = "0.3.5", path = "..\/mockforge-collab" }/d' crates/mockforge-ui/Cargo.toml
sed -i '/mockforge-collab = "\^0.3.0"/d' crates/mockforge-registry-server/Cargo.toml
# Remove "graphql" from default features (but keep other features)
sed -i 's/"graphql",//g' crates/mockforge-cli/Cargo.toml crates/mockforge-sdk/Cargo.toml
sed -i 's/, "graphql"//g' crates/mockforge-cli/Cargo.toml crates/mockforge-sdk/Cargo.toml
sed -i 's/"graphql"//g' crates/mockforge-cli/Cargo.toml crates/mockforge-sdk/Cargo.toml
# Remove graphql feature definitions
sed -i '/^graphql = \["mockforge-graphql"\]/d' crates/mockforge-cli/Cargo.toml crates/mockforge-sdk/Cargo.toml
# Disable sysinfo feature in mockforge-observability for MSRV check
# (sysinfo 0.37 requires edition2024 which is unstable)
# Remove sysinfo from default features so Cargo doesn't try to resolve it
sed -i 's/default = \["sysinfo"\]/default = []/' crates/mockforge-observability/Cargo.toml
# Temporarily remove argon2 from mockforge-core to avoid base64ct 1.8+ dependency
# (argon2 pulls in base64ct 1.8+ which requires edition2024)
sed -i '/argon2 = { workspace = true }/d' crates/mockforge-core/Cargo.toml
# Note: mockforge-collab is excluded above, so base64ct 1.8+ won't be pulled in
# No need to patch base64ct since mockforge-collab (which uses argon2 -> base64ct) is excluded
# Regenerate Cargo.lock without async-graphql and sysinfo dependencies
cargo generate-lockfile
# Check workspace (sysinfo feature disabled, so it won't be resolved)
cargo check --workspace
# Restore files
git checkout Cargo.toml Cargo.lock crates/mockforge-cli/Cargo.toml crates/mockforge-sdk/Cargo.toml crates/mockforge-observability/Cargo.toml crates/mockforge-ui/Cargo.toml crates/mockforge-registry-server/Cargo.toml crates/mockforge-core/Cargo.toml

typos:
name: Spell Check
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/contract-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler

- name: Cache cargo registry
uses: actions/cache@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/contract-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
with:
toolchain: stable

- name: Install MockForge
run: cargo install --path crates/mockforge-cli
- name: Build MockForge
run: cargo build --release --bin mockforge

- name: Start MockForge server
run: |
mockforge-cli serve \
./target/release/mockforge serve \
--http-port 3000 \
--spec specs/api.yaml &
echo $! > mockforge.pid
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Validate contract against live API
id: validate
run: |
mockforge-cli validate \
./target/release/mockforge validate \
--spec specs/api.yaml \
--endpoint http://localhost:3000 \
--output report.md \
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=pr,prefix=pr-
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix={{branch}}-
type=sha,prefix={{branch}}-,format=long,enable={{is_default_branch}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
Expand All @@ -82,23 +82,26 @@ jobs:
BUILD_DATE=${{ steps.meta.outputs.created }}

- name: Run Trivy vulnerability scanner
id: trivy
if: steps.build-and-push.outcome == 'success'
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

- name: Upload Trivy results to GitHub Security
uses: github/codeql-action/upload-sarif@v3
if: always()
if: steps.build-and-push.outcome == 'success' && steps.trivy.outcome == 'success'
with:
sarif_file: 'trivy-results.sarif'

- name: Generate SBOM
if: steps.build-and-push.outcome == 'success'
uses: anchore/sbom-action@v0
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}
format: cyclonedx-json
output-file: sbom.json

Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ name: Integration Tests
on:
push:
branches: [ main, develop ]
paths:
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/integration-tests.yml'
pull_request:
branches: [ main, develop ]
paths:
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/integration-tests.yml'
workflow_dispatch:

env:
Expand Down Expand Up @@ -76,3 +86,47 @@ jobs:
target/test-results/
if-no-files-found: ignore
retention-days: 7

e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install protoc (protobuf compiler)
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Build MockForge
run: |
cargo build --release --bin mockforge

- name: Run E2E tests
run: |
cargo test --package mockforge-integration-tests --test http_e2e_tests --release
cargo test --package mockforge-integration-tests --test websocket_e2e_tests --release
cargo test --package mockforge-integration-tests --test grpc_e2e_tests --release

- name: Upload test results
uses: actions/upload-artifact@v5
if: failure()
with:
name: e2e-test-results
path: target/test-results/
retention-days: 7
Loading
Loading