Skip to content

Commit 2690c75

Browse files
feat: implement anti-pattern review recommendations
IMMEDIATE ACTIONS (T-0): Remove hardcoded tokens from .npmrc - use environment variables Add CODEOWNERS file for code review governance Consolidate duplicate workflows (20+ 3 consolidated workflows) Create branch protection configuration ARCHITECTURE DECOMPOSITION: Extract ModelTrainingOrchestrator src/ai/training/ Extract AdaptiveRetrievalEngine src/ai/retrieval/ Extract MultiModalProcessor src/ai/multimodal/ Extract FederatedLearningCoordinator src/ai/federation/ Refactor AI module index to use bounded contexts ENTERPRISE FEATURES: Add structured logging with correlation IDs Implement config schema validation with JSON Schema Enhanced security and audit logging capabilities WORKFLOW CONSOLIDATION: - consolidated-ci.yml: Security, testing, and deployment - consolidated-docs.yml: Documentation and release blogs - consolidated-roadmap.yml: Project management automation This addresses P1 risks: Monolithic AI Module, Workflow Proliferation, Secret Management Gaps identified in the anti-pattern review.
1 parent fc86ea6 commit 2690c75

File tree

882 files changed

+2254
-125412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

882 files changed

+2254
-125412
lines changed

.github/branch-protection.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Branch Protection Configuration
2+
# This file defines branch protection rules for GitHub repository
3+
# Apply using GitHub CLI: gh api repos/:owner/:repo/branches/main/protection --method PUT --input branch-protection.yml
4+
5+
main:
6+
required_status_checks:
7+
strict: true
8+
contexts:
9+
- "ci/test"
10+
- "ci/lint"
11+
- "ci/security"
12+
- "ci/build"
13+
enforce_admins: true
14+
required_pull_request_reviews:
15+
required_approving_review_count: 2
16+
dismiss_stale_reviews: true
17+
require_code_owner_reviews: true
18+
require_last_push_approval: true
19+
restrictions:
20+
users: []
21+
teams: ["core-maintainers", "senior-developers"]
22+
allow_force_pushes: false
23+
allow_deletions: false
24+
block_creations: false
25+
26+
develop:
27+
required_status_checks:
28+
strict: true
29+
contexts:
30+
- "ci/test"
31+
- "ci/lint"
32+
enforce_admins: false
33+
required_pull_request_reviews:
34+
required_approving_review_count: 1
35+
dismiss_stale_reviews: true
36+
require_code_owner_reviews: true
37+
require_last_push_approval: false
38+
restrictions:
39+
users: []
40+
teams: ["developers", "core-maintainers"]
41+
allow_force_pushes: false
42+
allow_deletions: false
43+
block_creations: false
44+
45+
# Commands to apply protection rules:
46+
# gh api repos/DevilsDev/rag-pipeline-utils/branches/main/protection --method PUT --field required_status_checks='{"strict":true,"contexts":["ci/test","ci/lint","ci/security","ci/build"]}' --field enforce_admins=true --field required_pull_request_reviews='{"required_approving_review_count":2,"dismiss_stale_reviews":true,"require_code_owner_reviews":true}' --field restrictions='{"users":[],"teams":["core-maintainers"]}' --field allow_force_pushes=false --field allow_deletions=false
47+
48+
# gh api repos/DevilsDev/rag-pipeline-utils/branches/develop/protection --method PUT --field required_status_checks='{"strict":true,"contexts":["ci/test","ci/lint"]}' --field enforce_admins=false --field required_pull_request_reviews='{"required_approving_review_count":1,"dismiss_stale_reviews":true,"require_code_owner_reviews":true}' --field restrictions='{"users":[],"teams":["developers","core-maintainers"]}' --field allow_force_pushes=false --field allow_deletions=false
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Consolidated CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
workflow_dispatch:
9+
10+
env:
11+
NODE_VERSION: '18'
12+
CACHE_VERSION: v1
13+
14+
jobs:
15+
# Security and validation checks
16+
security:
17+
name: Security & Validation
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ env.NODE_VERSION }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Security audit
30+
run: npm audit --audit-level=moderate
31+
32+
- name: License check
33+
run: npx license-checker --onlyAllow 'MIT;Apache-2.0;BSD-3-Clause'
34+
35+
- name: Dependency review
36+
uses: actions/dependency-review-action@v4
37+
if: github.event_name == 'pull_request'
38+
39+
# Code quality and testing
40+
test:
41+
name: Test & Quality
42+
runs-on: ubuntu-latest
43+
needs: security
44+
strategy:
45+
matrix:
46+
test-type: [unit, integration, contract]
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: ${{ env.NODE_VERSION }}
52+
cache: 'npm'
53+
54+
- name: Install dependencies
55+
run: npm ci
56+
57+
- name: ESLint
58+
run: npm run lint:strict
59+
60+
- name: Run tests
61+
run: |
62+
case "${{ matrix.test-type }}" in
63+
unit) npm run test:unit ;;
64+
integration) npm run test:integration ;;
65+
contract) npm run test -- __tests__/ci/contract-schema-validation.test.js ;;
66+
esac
67+
68+
- name: Upload coverage
69+
uses: codecov/codecov-action@v4
70+
if: matrix.test-type == 'unit'
71+
with:
72+
token: ${{ secrets.CODECOV_TOKEN }}
73+
74+
# Build and deployment
75+
build:
76+
name: Build & Deploy
77+
runs-on: ubuntu-latest
78+
needs: [security, test]
79+
if: github.ref == 'refs/heads/main'
80+
steps:
81+
- uses: actions/checkout@v4
82+
- uses: actions/setup-node@v4
83+
with:
84+
node-version: ${{ env.NODE_VERSION }}
85+
cache: 'npm'
86+
87+
- name: Install dependencies
88+
run: npm ci
89+
90+
- name: Build documentation
91+
run: npm run build:docs
92+
93+
- name: Semantic release
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
97+
run: npx semantic-release
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Documentation & Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['docs/**', 'README.md', '*.md']
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
jobs:
12+
# Documentation build and deployment
13+
docs:
14+
name: Build & Deploy Docs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build documentation
27+
run: npm run build:docs
28+
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v3
31+
if: github.ref == 'refs/heads/main'
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./docs-site/build
35+
36+
# Release blog generation
37+
release-blog:
38+
name: Generate Release Blog
39+
runs-on: ubuntu-latest
40+
if: github.event_name == 'release'
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: '18'
46+
cache: 'npm'
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Generate release blog
52+
run: npm run release:tag
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Commit blog post
57+
run: |
58+
git config --local user.email "action@github.com"
59+
git config --local user.name "GitHub Action"
60+
git add docs-site/blog/
61+
git commit -m "docs: add release blog for ${{ github.event.release.tag_name }}" || exit 0
62+
git push
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Roadmap & Project Management
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * 1' # Weekly on Monday
6+
issues:
7+
types: [opened, closed, labeled]
8+
workflow_dispatch:
9+
10+
jobs:
11+
# Roadmap maintenance and label sync
12+
roadmap-sync:
13+
name: Roadmap Synchronization
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: '18'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Sync roadmap labels
26+
run: npm run labels:sync
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Close completed roadmap items
31+
run: npm run roadmap:close
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Update roadmap maintenance
36+
run: node scripts/roadmap-maintenance.js
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)