MCPcopy Create free account
hub / github.com/SethGammon/Citadel / renderReport

Function renderReport

scripts/pr-ready.js:130–174  ·  view source on GitHub ↗
(readiness)

Source from the content-addressed store, hash-verified

128}
129
130function renderReport(readiness) {
131 const lines = [
132 `# PR Readiness: ${readiness.branch}`,
133 '',
134 `Generated: ${readiness.generatedAt}`,
135 `Status: ${readiness.ready ? 'ready' : 'blocked'}`,
136 `PR: ${readiness.pr || '(missing)'}`,
137 `Branch: ${readiness.branch}`,
138 `Head: ${readiness.head || '(unknown)'}`,
139 '',
140 '## Gates',
141 '',
142 '| Gate | Status | Detail |',
143 '|---|---|---|',
144 `| Pull request URL | ${readiness.gates.prUrl.pass ? 'pass' : 'fail'} | ${readiness.gates.prUrl.detail} |`,
145 `| Git worktree | ${readiness.gates.git.pass ? 'pass' : 'fail'} | ${readiness.gates.git.detail} |`,
146 `| Dashboard repairs | ${readiness.gates.dashboard.pass ? 'pass' : 'fail'} | ${readiness.gates.dashboard.detail} |`,
147 `| Verification | ${readiness.gates.verification.pass ? 'pass' : 'fail'} | ${readiness.gates.verification.detail} |`,
148 '',
149 '## Verification Plan',
150 '',
151 `Profile: ${readiness.verificationProfile.id} (${readiness.verificationProfile.label})`,
152 `Reason: ${readiness.verificationProfile.reason}`,
153 `Primary command: ${readiness.verificationProfile.primaryCommand}`,
154 '',
155 '| Command | Role |',
156 '|---|---|',
157 ...readiness.verificationProfile.commands.map((command) => `| ${command} | ${command === readiness.verificationProfile.primaryCommand ? 'primary' : 'recommended'} |`),
158 '',
159 '## Next Action',
160 '',
161 readiness.ready
162 ? '- Mark the draft PR ready for review or ask for approval to merge.'
163 : `- Resolve blockers: ${readiness.blockers.join('; ')}`,
164 '',
165 '---HANDOFF---',
166 `- PR: ${readiness.pr || '(missing)'}`,
167 `- Branch: ${readiness.branch}`,
168 `- Readiness: ${readiness.ready ? 'ready' : 'blocked'}`,
169 `- Verification: ${readiness.verification.status} (${readiness.verification.command || 'none'})`,
170 '---',
171 '',
172 ];
173 return lines.join('\n');
174}
175
176function assessReadiness(projectRoot, options = {}) {
177 const root = path.resolve(projectRoot || process.cwd());

Callers 2

assessReadinessFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected