chore: enable Cerberus security by default and fix 31 skipped E2E tests
Phase 1 of skipped Playwright tests remediation: Changed Cerberus default from disabled to enabled in backend code Deprecated FEATURE_CERBERUS_ENABLED env var (no longer needed) Added data-testid and a11y attributes to LanguageSelector component Fixed keyboard navigation timing in account-settings and user-management tests Simplified security dashboard toggle tests with waitForToast pattern Test results: 668 passed, 11 failed, 67 skipped (reduced from 98) Backend coverage: 87.0% (exceeds 85% threshold)
This commit is contained in:
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
# Skill runner for utility-update-go-version
|
||||
# Updates local Go installation to match go.work requirements
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
||||
|
||||
GO_WORK_FILE="$PROJECT_ROOT/go.work"
|
||||
|
||||
if [[ ! -f "$GO_WORK_FILE" ]]; then
|
||||
echo "❌ go.work not found at $GO_WORK_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract required Go version from go.work
|
||||
REQUIRED_VERSION=$(grep -E '^go [0-9]+\.[0-9]+(\.[0-9]+)?$' "$GO_WORK_FILE" | awk '{print $2}')
|
||||
|
||||
if [[ -z "$REQUIRED_VERSION" ]]; then
|
||||
echo "❌ Could not parse Go version from go.work"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "📋 Required Go version from go.work: $REQUIRED_VERSION"
|
||||
|
||||
# Check current installed version
|
||||
CURRENT_VERSION=$(go version 2>/dev/null | grep -oE 'go[0-9]+\.[0-9]+(\.[0-9]+)?' | sed 's/go//' || echo "none")
|
||||
echo "📋 Currently installed Go version: $CURRENT_VERSION"
|
||||
|
||||
if [[ "$CURRENT_VERSION" == "$REQUIRED_VERSION" ]]; then
|
||||
echo "✅ Go version already matches requirement ($REQUIRED_VERSION)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "🔄 Updating Go from $CURRENT_VERSION to $REQUIRED_VERSION..."
|
||||
|
||||
# Download the new Go version using the official dl tool
|
||||
echo "📥 Downloading Go $REQUIRED_VERSION..."
|
||||
go install "golang.org/dl/go${REQUIRED_VERSION}@latest"
|
||||
|
||||
# Download the SDK
|
||||
echo "📦 Installing Go $REQUIRED_VERSION SDK..."
|
||||
"go${REQUIRED_VERSION}" download
|
||||
|
||||
# Update the system symlink
|
||||
SDK_PATH="$HOME/sdk/go${REQUIRED_VERSION}/bin/go"
|
||||
if [[ -f "$SDK_PATH" ]]; then
|
||||
echo "🔗 Updating system Go symlink..."
|
||||
sudo ln -sf "$SDK_PATH" /usr/local/go/bin/go
|
||||
else
|
||||
echo "⚠️ SDK binary not found at expected path: $SDK_PATH"
|
||||
echo " You may need to add go${REQUIRED_VERSION} to your PATH manually"
|
||||
fi
|
||||
|
||||
# Verify the update
|
||||
NEW_VERSION=$(go version 2>/dev/null | grep -oE 'go[0-9]+\.[0-9]+(\.[0-9]+)?' | sed 's/go//' || echo "unknown")
|
||||
echo ""
|
||||
echo "✅ Go updated successfully!"
|
||||
echo " Previous: $CURRENT_VERSION"
|
||||
echo " Current: $NEW_VERSION"
|
||||
echo " Required: $REQUIRED_VERSION"
|
||||
|
||||
if [[ "$NEW_VERSION" != "$REQUIRED_VERSION" ]]; then
|
||||
echo ""
|
||||
echo "⚠️ Warning: Installed version ($NEW_VERSION) doesn't match required ($REQUIRED_VERSION)"
|
||||
echo " You may need to restart your terminal or IDE"
|
||||
fi
|
||||
@@ -0,0 +1,31 @@
|
||||
# Utility: Update Go Version
|
||||
|
||||
Updates the local Go installation to match the version specified in `go.work`.
|
||||
|
||||
## Purpose
|
||||
|
||||
When Renovate bot updates the Go version in `go.work`, this skill automatically downloads and installs the matching Go version locally.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
.github/skills/scripts/skill-runner.sh utility-update-go-version
|
||||
```
|
||||
|
||||
## What It Does
|
||||
|
||||
1. Reads the required Go version from `go.work`
|
||||
2. Compares against the currently installed version
|
||||
3. If different, downloads and installs the new version using `golang.org/dl`
|
||||
4. Updates the system symlink to point to the new version
|
||||
|
||||
## When to Use
|
||||
|
||||
- After Renovate bot creates a PR updating `go.work`
|
||||
- When you see "packages.Load error: go.work requires go >= X.Y.Z"
|
||||
- Before building if you get Go version mismatch errors
|
||||
|
||||
## Requirements
|
||||
|
||||
- `sudo` access (for updating symlink)
|
||||
- Internet connection (for downloading Go SDK)
|
||||
Reference in New Issue
Block a user