diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml new file mode 100644 index 0000000..c5bf3e0 --- /dev/null +++ b/.github/workflows/docs-check.yml @@ -0,0 +1,120 @@ +# Demo Workflow: Documentation Check +# This workflow shows how PM Command Center tracks documentation quality +# Great for demonstrating the Gap Analyzer integration + +name: ๐Ÿ“š Documentation Check + +on: + push: + paths: + - '**.md' + - 'docs/**' + pull_request: + paths: + - '**.md' + - 'docs/**' + workflow_dispatch: + inputs: + check_level: + description: 'Check thoroughness level' + required: true + default: 'standard' + type: choice + options: + - quick + - standard + - thorough + +jobs: + check-readme: + name: ๐Ÿ“– README Quality + runs-on: ubuntu-latest + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: ๐Ÿ” Check README exists + id: readme + run: | + if [ -f "README.md" ]; then + echo "exists=true" >> $GITHUB_OUTPUT + LINES=$(wc -l < README.md) + echo "lines=$LINES" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + echo "lines=0" >> $GITHUB_OUTPUT + fi + + - name: ๐Ÿ“‹ Check required sections + run: | + echo "## ๐Ÿ“– README Analysis" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + check_section() { + if grep -qi "$1" README.md 2>/dev/null; then + echo "| $2 | โœ… Found |" >> $GITHUB_STEP_SUMMARY + else + echo "| $2 | โš ๏ธ Missing |" >> $GITHUB_STEP_SUMMARY + fi + } + + echo "| Section | Status |" >> $GITHUB_STEP_SUMMARY + echo "|---------|--------|" >> $GITHUB_STEP_SUMMARY + + check_section "install" "Installation" + check_section "usage" "Usage" + check_section "feature" "Features" + check_section "license" "License" + check_section "contribut" "Contributing" + + check-docs-structure: + name: ๐Ÿ“ Documentation Structure + runs-on: ubuntu-latest + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: ๐Ÿ“Š Analyze documentation + run: | + echo "## ๐Ÿ“ Documentation Overview" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + MD_COUNT=$(find . -name "*.md" -not -path "./node_modules/*" | wc -l) + echo "**Total Markdown files:** $MD_COUNT" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + echo "### ๐Ÿ“„ Documentation Files" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + find . -name "*.md" -not -path "./node_modules/*" | head -20 | while read file; do + LINES=$(wc -l < "$file") + echo "- \`$file\` ($LINES lines)" >> $GITHUB_STEP_SUMMARY + done + + - name: ๐ŸŽฏ PM Command Center Integration + run: | + echo "" >> $GITHUB_STEP_SUMMARY + echo "---" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "๐Ÿ’ก **Tip:** Use \`@pm /gaps\` to find issues with missing documentation" >> $GITHUB_STEP_SUMMARY + + spell-check: + name: โœ๏ธ Spell Check + runs-on: ubuntu-latest + continue-on-error: true + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: โœ๏ธ Check spelling + uses: crate-ci/typos@master + continue-on-error: true + + - name: ๐Ÿ“Š Report + if: always() + run: | + echo "## โœ๏ธ Spell Check Complete" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Documentation quality is tracked in PM Command Center CI/CD view" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/feature-validation.yml b/.github/workflows/feature-validation.yml new file mode 100644 index 0000000..a87a3a4 --- /dev/null +++ b/.github/workflows/feature-validation.yml @@ -0,0 +1,79 @@ +# Demo Workflow: Feature Branch Validation +# This workflow demonstrates PM Command Center's CI/CD monitoring capabilities +# Triggers on feature branches to show active development tracking + +name: ๐Ÿš€ Feature Validation + +on: + push: + branches: + - 'feature/**' + - 'demo-*' + pull_request: + types: [opened, synchronize, reopened] + +jobs: + validate: + name: ๐Ÿ“‹ Validate Feature + runs-on: ubuntu-latest + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: ๐Ÿ“ฆ Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: ๐Ÿ“š Install dependencies + run: npm ci + + - name: ๐Ÿ” Run linter + run: npm run lint --if-present + + - name: ๐Ÿงช Run unit tests + run: npm test --if-present + + - name: ๐Ÿ—๏ธ Build application + run: npm run build + + - name: ๐Ÿ“Š Generate build summary + run: | + echo "## ๐Ÿš€ Feature Validation Complete" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Check | Status |" >> $GITHUB_STEP_SUMMARY + echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY + echo "| Lint | โœ… Passed |" >> $GITHUB_STEP_SUMMARY + echo "| Tests | โœ… Passed |" >> $GITHUB_STEP_SUMMARY + echo "| Build | โœ… Passed |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Ready for PM review in **PM Command Center** ๐ŸŽฏ" >> $GITHUB_STEP_SUMMARY + + analyze: + name: ๐Ÿ“ˆ Code Analysis + runs-on: ubuntu-latest + needs: validate + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: ๐Ÿ“ฆ Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: ๐Ÿ“Š Count lines of code + run: | + echo "## ๐Ÿ“Š Code Statistics" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY + echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY + JS_LINES=$(find src -name "*.js" -o -name "*.jsx" | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}' || echo "0") + echo "| JavaScript/JSX | $JS_LINES lines |" >> $GITHUB_STEP_SUMMARY + TS_LINES=$(find . -name "*.ts" -o -name "*.tsx" | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}' || echo "0") + echo "| TypeScript | $TS_LINES lines |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "View this in **@pm /cicd** ๐Ÿ”ง" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml new file mode 100644 index 0000000..d07f6a9 --- /dev/null +++ b/.github/workflows/release-candidate.yml @@ -0,0 +1,175 @@ +# Demo Workflow: Release Candidate Check +# This workflow demonstrates PM Command Center's release tracking +# Shows how PMs can monitor release readiness via @pm /release + +name: ๐ŸŽฏ Release Candidate + +on: + push: + branches: + - 'release/**' + - 'rc/**' + tags: + - 'v*' + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., 1.0.0)' + required: true + type: string + skip_tests: + description: 'Skip test suite' + required: false + type: boolean + default: false + +env: + NODE_VERSION: '20' + +jobs: + preflight: + name: โœˆ๏ธ Preflight Checks + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + is_prerelease: ${{ steps.version.outputs.is_prerelease }} + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: ๐Ÿท๏ธ Determine version + id: version + run: | + if [ "${{ github.event.inputs.version }}" != "" ]; then + VERSION="${{ github.event.inputs.version }}" + elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then + VERSION="${GITHUB_REF#refs/tags/v}" + else + VERSION="0.0.0-dev" + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + + if [[ "$VERSION" == *"-"* ]]; then + echo "is_prerelease=true" >> $GITHUB_OUTPUT + else + echo "is_prerelease=false" >> $GITHUB_OUTPUT + fi + + echo "## ๐Ÿท๏ธ Version Info" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Version:** $VERSION" >> $GITHUB_STEP_SUMMARY + + - name: ๐Ÿ“‹ Check release requirements + run: | + echo "## โœˆ๏ธ Preflight Checklist" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Requirement | Status |" >> $GITHUB_STEP_SUMMARY + echo "|-------------|--------|" >> $GITHUB_STEP_SUMMARY + + # Check package.json exists + if [ -f "package.json" ]; then + echo "| package.json | โœ… Found |" >> $GITHUB_STEP_SUMMARY + else + echo "| package.json | โŒ Missing |" >> $GITHUB_STEP_SUMMARY + fi + + # Check README exists + if [ -f "README.md" ]; then + echo "| README.md | โœ… Found |" >> $GITHUB_STEP_SUMMARY + else + echo "| README.md | โš ๏ธ Missing |" >> $GITHUB_STEP_SUMMARY + fi + + # Check for CHANGELOG + if [ -f "CHANGELOG.md" ]; then + echo "| CHANGELOG.md | โœ… Found |" >> $GITHUB_STEP_SUMMARY + else + echo "| CHANGELOG.md | โš ๏ธ Consider adding |" >> $GITHUB_STEP_SUMMARY + fi + + build-and-test: + name: ๐Ÿ—๏ธ Build & Test + runs-on: ubuntu-latest + needs: preflight + if: ${{ github.event.inputs.skip_tests != 'true' }} + + steps: + - name: ๐Ÿ“ฅ Checkout code + uses: actions/checkout@v4 + + - name: ๐Ÿ“ฆ Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: ๐Ÿ“š Install dependencies + run: npm ci + + - name: ๐Ÿงช Run test suite + run: npm test --if-present + + - name: ๐Ÿ—๏ธ Production build + run: npm run build + env: + NODE_ENV: production + + - name: ๐Ÿ“ฆ Archive build artifacts + uses: actions/upload-artifact@v4 + with: + name: release-build-${{ needs.preflight.outputs.version }} + path: dist/ + retention-days: 30 + + - name: ๐Ÿ“Š Build summary + run: | + echo "## ๐Ÿ—๏ธ Build Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY + echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY + if [ -d "dist" ]; then + SIZE=$(du -sh dist | cut -f1) + FILES=$(find dist -type f | wc -l) + echo "| Bundle Size | $SIZE |" >> $GITHUB_STEP_SUMMARY + echo "| Files | $FILES |" >> $GITHUB_STEP_SUMMARY + fi + echo "| Version | ${{ needs.preflight.outputs.version }} |" >> $GITHUB_STEP_SUMMARY + + release-gate: + name: ๐Ÿšฆ Release Gate + runs-on: ubuntu-latest + needs: [preflight, build-and-test] + if: always() + + steps: + - name: ๐Ÿ“Š Release readiness report + run: | + echo "## ๐Ÿšฆ Release Gate Status" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Version:** ${{ needs.preflight.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "**Pre-release:** ${{ needs.preflight.outputs.is_prerelease }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + echo "### Job Status" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY + echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY + echo "| Preflight | ${{ needs.preflight.result == 'success' && 'โœ… Passed' || 'โŒ Failed' }} |" >> $GITHUB_STEP_SUMMARY + echo "| Build & Test | ${{ needs.build-and-test.result == 'success' && 'โœ… Passed' || needs.build-and-test.result == 'skipped' && 'โญ๏ธ Skipped' || 'โŒ Failed' }} |" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "---" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "๐Ÿ“Š **Track this release in PM Command Center**" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "- Web: Check the **Release Readiness** tab" >> $GITHUB_STEP_SUMMARY + echo "- Chat: \`@pm /release\` for milestone status" >> $GITHUB_STEP_SUMMARY + echo "- Chat: \`@pm /cicd\` for pipeline health" >> $GITHUB_STEP_SUMMARY + + - name: ๐Ÿšฆ Gate decision + if: needs.preflight.result != 'success' || needs.build-and-test.result == 'failure' + run: | + echo "::error::Release gate failed - see summary for details" + exit 1 diff --git a/src/components/CICDPipelines.jsx b/src/components/CICDPipelines.jsx index 6b6976b..107dc88 100644 --- a/src/components/CICDPipelines.jsx +++ b/src/components/CICDPipelines.jsx @@ -156,6 +156,25 @@ export default function CICDPipelines({ onConfigureGitHub }) { : activeTab === 'failed' ? failed : recent + // Identify security-related workflows + const securityKeywords = ['security', 'scan', 'audit', 'codeql', 'dependabot', 'snyk', 'vulnerability', 'sast', 'dast'] + const securityWorkflows = workflows?.filter(wf => + securityKeywords.some(kw => wf.name.toLowerCase().includes(kw)) + ) || [] + + // Determine overall security status + const getSecurityStatus = () => { + if (securityWorkflows.length === 0) return 'none' + const lastRuns = securityWorkflows.map(wf => wf.lastRun).filter(Boolean) + if (lastRuns.length === 0) return 'none' + if (lastRuns.some(r => r.status === 'running')) return 'running' + if (lastRuns.every(r => r.status === 'success')) return 'passing' + if (lastRuns.some(r => r.status === 'failed')) return 'failing' + return 'unknown' + } + + const securityStatus = getSecurityStatus() + return (
{/* Summary Cards */} @@ -200,6 +219,114 @@ export default function CICDPipelines({ onConfigureGitHub }) {
+ {/* Security Scan Status */} +
+
+
+
+
+ {securityStatus === 'passing' ? '๐Ÿ›ก๏ธ' : + securityStatus === 'failing' ? 'โš ๏ธ' : + securityStatus === 'running' ? '๐Ÿ”„' : 'โ“'} +
+
+

+ Security Scans: { + securityStatus === 'passing' ? 'All Passing' : + securityStatus === 'failing' ? 'Attention Needed' : + securityStatus === 'running' ? 'In Progress' : + 'No Scans Detected' + } +

+

+ {securityWorkflows.length > 0 + ? `${securityWorkflows.length} security workflow${securityWorkflows.length > 1 ? 's' : ''} configured` + : 'No security workflows found in this repository'} +

+
+
+ {securityStatus !== 'none' && ( +
+ {securityStatus === 'passing' ? 'โœ… SECURE' : + securityStatus === 'failing' ? 'โŒ ACTION REQUIRED' : + securityStatus === 'running' ? 'โณ SCANNING' : + 'UNKNOWN'} +
+ )} +
+ + {/* Individual security workflow details */} + {securityWorkflows.length > 0 && ( +
+ {securityWorkflows.map(wf => ( +
+
+ {getStatusIcon(wf.lastRun?.status || 'unknown')} + {wf.name} + {getPlatformIcon(wf.platform)} +
+
+
+
+
= 80 ? 'bg-green-500' : + wf.successRate >= 50 ? 'bg-yellow-500' : 'bg-red-500' + }`} + style={{ width: `${wf.successRate}%` }} + /> +
+ {wf.successRate}% +
+ + Last: {wf.lastRun ? formatTimeAgo(wf.lastRun.createdAt) : 'never'} + + {wf.lastRun?.url && ( + + View โ†’ + + )} +
+
+ ))} +
+ )} +
+
+ {/* API Errors */} {apiErrors?.length > 0 && (