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 (
+ {securityWorkflows.length > 0 + ? `${securityWorkflows.length} security workflow${securityWorkflows.length > 1 ? 's' : ''} configured` + : 'No security workflows found in this repository'} +
+