Skip to content

feat(ui): Add version footer to canvas (v0.6.1) #30

feat(ui): Add version footer to canvas (v0.6.1)

feat(ui): Add version footer to canvas (v0.6.1) #30

name: Configuration Validation
on:
push:
branches: [main, "156c-*"]
paths:
- "lib/**/*.ts"
- "scripts/**/*.ts"
- "test/**/*.ts"
- "package.json"
- "tsconfig.json"
- ".github/workflows/config-validation.yml"
pull_request:
branches: [main]
paths:
- "lib/**/*.ts"
- "scripts/**/*.ts"
- "test/**/*.ts"
- "package.json"
- "tsconfig.json"
jobs:
validate-schema:
name: Validate Configuration Schema
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: TypeScript compilation check
run: npm run build:typecheck
- name: Validate XDG configuration types
run: |
npx ts-node -e "
import { XDGConfig } from './lib/xdg-config';
import { UserConfig, DerivedConfig, DeploymentConfig } from './lib/types/config';
const config = new XDGConfig();
console.log('✓ XDG configuration types validated');
"
- name: Run configuration tests
run: npm run test:ts -- --testPathPatterns="xdg-config" --passWithNoTests
validate-scripts:
name: Validate Configuration Scripts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Validate infer-quilt-config script
run: |
npx ts-node scripts/infer-quilt-config.ts --help
- name: Validate sync-secrets script
run: |
npx ts-node scripts/sync-secrets.ts --help
- name: Validate install-wizard script
run: |
npx ts-node scripts/install-wizard.ts --help
- name: Run script tests
run: npm run test:ts -- --testPathPatterns="scripts" --passWithNoTests
validate-cross-platform:
name: Validate Cross-Platform Compatibility
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ["18", "20"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: TypeScript compilation check
run: npm run build:typecheck
- name: Test XDG path handling
run: |
npx ts-node -e "
import { XDGConfig } from './lib/xdg-config';
import { tmpdir } from 'os';
import { resolve } from 'path';
const testDir = resolve(tmpdir(), 'config-test-${{ matrix.os }}-node${{ matrix.node }}');
const config = new XDGConfig(testDir);
config.ensureDirectories();
const paths = config.getPaths();
console.log('User config:', paths.userConfig);
console.log('Derived config:', paths.derivedConfig);
console.log('Deploy config:', paths.deployConfig);
console.log('✓ Cross-platform paths validated');
"
- name: Run cross-platform tests
run: npm run test:ts
validate-secrets-integration:
name: Validate Secrets Integration
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Validate secrets schema
run: |
npx ts-node -e "
import { UserConfig } from './lib/types/config';
const secretFields = [
'benchlingClientSecret',
'benchlingSecrets',
'benchlingSecret',
];
console.log('✓ Secret fields defined in schema:', secretFields);
"
- name: Test sync-secrets dry-run
run: |
# Create test config
mkdir -p /tmp/config-test
cat > /tmp/config-test/default.json << 'EOF'
{
"benchlingTenant": "test-tenant",
"benchlingClientId": "test-id",
"benchlingClientSecret": "test-secret",
"quiltUserBucket": "test-bucket",
"_metadata": {
"source": "test",
"savedAt": "2025-01-01T00:00:00Z"
}
}
EOF
# Test dry-run mode (should not require AWS credentials)
echo "Testing sync-secrets in dry-run mode..."
# Note: Actual test would require mocking AWS SDK
validate-profile-compatibility:
name: Validate Profile Compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Test profile management
run: |
npx ts-node -e "
import { XDGConfig } from './lib/xdg-config';
import { tmpdir } from 'os';
import { resolve } from 'path';
const testDir = resolve(tmpdir(), 'profile-test');
const config = new XDGConfig(testDir);
// Create multiple profiles
const profiles = ['default', 'dev', 'staging', 'prod'];
profiles.forEach(profile => {
config.ensureProfileDirectories(profile);
console.log(\`✓ Created profile: \${profile}\`);
});
// List profiles
const listedProfiles = config.listProfiles();
console.log('Detected profiles:', listedProfiles);
// Verify all created profiles are listed
const allFound = profiles.every(p => listedProfiles.includes(p));
if (!allFound) {
throw new Error('Not all profiles were detected');
}
console.log('✓ Profile compatibility validated');
"
validate-documentation:
name: Validate Configuration Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Check for configuration documentation
run: |
if [ ! -f "spec/156c-secrets-config/04-phases.md" ]; then
echo "Error: Configuration phases documentation missing"
exit 1
fi
if [ ! -f "lib/types/config.ts" ]; then
echo "Error: Configuration types documentation missing"
exit 1
fi
echo "✓ Configuration documentation present"
- name: Validate TypeScript documentation
run: |
grep -q "@module" lib/xdg-config.ts || (echo "Missing @module in xdg-config.ts" && exit 1)
grep -q "@module" lib/types/config.ts || (echo "Missing @module in config.ts" && exit 1)
grep -q "@module" scripts/infer-quilt-config.ts || (echo "Missing @module in infer-quilt-config.ts" && exit 1)
grep -q "@module" scripts/install-wizard.ts || (echo "Missing @module in install-wizard.ts" && exit 1)
grep -q "@module" scripts/sync-secrets.ts || (echo "Missing @module in sync-secrets.ts" && exit 1)
echo "✓ TypeScript documentation validated"
integration-test:
name: Integration Test
runs-on: ubuntu-latest
needs: [validate-schema, validate-scripts, validate-profile-compatibility]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run full test suite
run: npm run test:ci
- name: Generate test coverage report
run: npm run test:ts -- --coverage --coverageDirectory=coverage
- name: Upload coverage to artifacts
uses: actions/upload-artifact@v5
with:
name: coverage-report
path: coverage/
retention-days: 7