RepoPulse: update documentation and frontend/e2e
Public changes compared with the previous published export: 4 files changed. Affected areas: - documentation: 3 files - frontend/e2e: 1 file Changed files: - Updated: "README.md" - Updated: "docs/screenshots/demo-explorer.png" - Updated: "docs/screenshots/demo-portfolio.png" - Updated: "frontend/e2e/mock-api.mjs" Export provenance/manifests refreshed; excluded from the change summary. Publish curated RepoPulse source from c169a522e1f0714275362f556f56cf00a5e77241
This commit is contained in:
1 parent
cf93423588
commit
ab703eec45
6 files changed
+19
-16
No files matched your search
@@ -1,5 +1,8 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { createServer } from 'node:http'
|
||||
|
||||
const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'))
|
||||
|
||||
const now = '2026-09-14T08:00:00.000Z'
|
||||
const policy = { auto_scan: true, min_health_score: 0, max_blockers: 0, require_tests: false, require_ci: false, suppressions: [] }
|
||||
const guidance = {
|
||||
@@ -21,13 +24,13 @@ const report = {
|
||||
release_gate: { status: 'BLOCKED', checks: [{ key: 'security', label: 'Security basics', state: 'pass', detail: 'No secret findings' }, { key: 'dependencies', label: 'Dependency hygiene', state: 'block', detail: 'Lockfile missing' }] },
|
||||
coverage: { limits: { max_files: 10000, max_text_bytes_per_file: 2000000, max_findings: 2000, max_secret_findings: 20 }, discovered_files: 5, scanned_files: 5, skipped_files_by_budget: 0, skipped_files_by_size: 0, text_bytes_scanned: 256, truncated: false, notes: [] }, compacted: false,
|
||||
}
|
||||
function repository(id, fullName, readiness = 'READY') {
|
||||
function repository(id, fullName, latestScan = null) {
|
||||
const name = fullName.split('/')[1]
|
||||
const blocked = readiness === 'BLOCKED'
|
||||
return { id, provider: 'gitea', provider_repository_id: id.slice(-1), owner: 'Jens', name, full_name: fullName, description: `${name} fixture repository`, html_url: null, clone_url: null, default_branch: 'main', private: true, archived: false, available: true, latest_revision: 'a'.repeat(40), latest_revision_at: now, last_synced_at: now, sync_error: null, state: 'current', stale: false, active_job_id: null, last_scan_id: id === 'gitea:1' ? report.id : null, last_scan_at: id === 'gitea:1' ? now : null, last_scan_health: id === 'gitea:1' ? 88 : 96, last_scan_readiness: readiness, last_scan_revision: 'a'.repeat(40), last_scan_blockers: blocked ? 1 : 0, last_scan_warnings: 0, last_scan_primary_signal: blocked ? { code: finding.code, category: finding.category, severity: finding.severity, message: finding.message, count: 1, guidance } : null, last_scan_health_delta: 0, last_scan_added_findings: 0, last_scan_resolved_findings: 0, last_scan_priority: blocked ? 800 : 0, last_scan_priority_rationale: blocked ? guidance.priority_rationale : null, policy }
|
||||
const blocked = latestScan?.release_readiness === 'BLOCKED'
|
||||
return { id, provider: 'gitea', provider_repository_id: id.split(':')[1], owner: 'Jens', name, full_name: fullName, description: `${name} fixture repository`, html_url: null, clone_url: null, default_branch: 'main', private: true, archived: false, available: true, latest_revision: 'a'.repeat(40), latest_revision_at: now, last_synced_at: now, sync_error: null, state: latestScan ? 'current' : 'never_scanned', stale: false, active_job_id: null, last_scan_id: latestScan?.id ?? null, last_scan_at: latestScan?.scanned_at ?? null, last_scan_health: latestScan?.health_score ?? null, last_scan_readiness: latestScan?.release_readiness ?? null, last_scan_revision: latestScan?.source.actual_revision ?? null, last_scan_blockers: blocked ? 1 : 0, last_scan_warnings: 0, last_scan_primary_signal: blocked ? { code: finding.code, category: finding.category, severity: finding.severity, message: finding.message, count: 1, guidance } : null, last_scan_health_delta: 0, last_scan_added_findings: 0, last_scan_resolved_findings: 0, last_scan_priority: blocked ? 800 : 0, last_scan_priority_rationale: blocked ? guidance.priority_rationale : null, policy }
|
||||
}
|
||||
const repositories = [
|
||||
repository('gitea:1', 'Jens/Alpha', 'BLOCKED'),
|
||||
repository('gitea:1', 'Jens/Alpha', report),
|
||||
repository('gitea:2', 'Jens/Beta'),
|
||||
...Array.from({ length: 23 }, (_unused, index) => repository(`gitea:${index + 3}`, `Jens/Gamma-${String(index + 1).padStart(2, '0')}`)),
|
||||
]
|
||||
@@ -38,7 +41,7 @@ createServer((request, response) => {
|
||||
const url = new URL(request.url, 'http://127.0.0.1:8001')
|
||||
const path = decodeURIComponent(url.pathname)
|
||||
if (path === '/health') return send(response, 200, { status: 'ok' })
|
||||
if (path === '/api/v1/meta') return send(response, 200, { name: 'RepoPulse', version: '1.5.0', stage: 'v1.5.0', scan_root_restricted: true, scan_root: '/scan', max_concurrent_scans: 1, requested_max_concurrent_scans: 1, repository_count: repositories.length, repository_states: { current: 2 }, current_repositories: 2, stale_repositories: 0, queue_depth: 0, active_jobs: 0, completed_jobs: 1, failed_jobs: 0, worker_heartbeat: now, gitea: { configured: true, url: 'http://gitea.local', last_sync: { synced_at: now } }, storage: { database_bytes: 1024, journal_bytes: 0, mirror_count: 2, mirror_cache_bytes: 2048, worktree_count: 0, scan_count: 1, compacted_scan_count: 0, oldest_scan_at: now, newest_scan_at: now, history_per_repository: 200, full_reports_per_repository: 30, report_retention_days: 365 }, database_recovery: { status: 'healthy' }, mutation_authentication: 'perimeter_required' })
|
||||
if (path === '/api/v1/meta') return send(response, 200, { name: 'RepoPulse', version, stage: 'v' + version, scan_root_restricted: true, scan_root: '/scan', max_concurrent_scans: 1, requested_max_concurrent_scans: 1, repository_count: repositories.length, repository_states: { current: 1, never_scanned: repositories.length - 1 }, current_repositories: 1, stale_repositories: 0, queue_depth: 0, active_jobs: 0, completed_jobs: 1, failed_jobs: 0, worker_heartbeat: now, gitea: { configured: true, url: 'http://gitea.local', last_sync: { synced_at: now } }, storage: { database_bytes: 1024, journal_bytes: 0, mirror_count: 2, mirror_cache_bytes: 2048, worktree_count: 0, scan_count: 1, compacted_scan_count: 0, oldest_scan_at: now, newest_scan_at: now, history_per_repository: 200, full_reports_per_repository: 30, report_retention_days: 365 }, database_recovery: { status: 'healthy' }, mutation_authentication: 'perimeter_required' })
|
||||
if (path === '/api/v1/repositories' && request.method === 'GET') return send(response, 200, repositories)
|
||||
if (path === '/api/v1/repositories/sync' && request.method === 'POST') return send(response, 200, { provider: 'gitea', discovered: 2, created: 0, updated: 2, unavailable: 0, errors: [], partial: false, branch_failures: 0, listing_complete: true, synced_at: now })
|
||||
if (path === '/api/v1/repositories/gitea:1' && request.method === 'GET') return send(response, 200, { ...repositories[0], latest_scan: report })
|
||||
|
||||
Reference in new issue
Block a user