Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 60 additions & 37 deletions .github/workflows/nightly-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,17 @@ jobs:
// ── Gather results from the current run's needs context ─
const needs = ${{ toJSON(needs) }};
const today = formatDate(new Date());
const isDispatch = context.eventName === 'workflow_dispatch';
const requestedJobsRaw = isDispatch ? '${{ inputs.jobs }}'.trim() : '';
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const requestedJobs = requestedJobsRaw
? requestedJobsRaw.split(',').map((name) => name.trim()).filter(Boolean)
: [];
const isSelectiveDispatch = isDispatch && requestedJobs.length > 0;
const runMode = isSelectiveDispatch
? 'Selective dispatch'
: isDispatch
? 'Manual full run'
: 'Scheduled full nightly';

const entries = Object.entries(needs).filter(([name]) => !EXCLUDED_JOBS.has(name));
let success = 0;
Expand All @@ -2358,58 +2369,70 @@ jobs:

// ── Fetch prior-day run for trend comparison ────────────
let trendLine = '';
try {
const WORKFLOW_FILE = 'nightly-e2e.yaml';
const now = new Date();
const since48h = new Date(now.getTime() - 48 * 60 * 60 * 1000).toISOString();
const since24h = new Date(now.getTime() - 24 * 60 * 60 * 1000).toISOString();

const { data } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: WORKFLOW_FILE,
created: `>=${since48h}`,
per_page: 50,
});

// Find completed scheduled runs from 24–48h ago
const priorRuns = data.workflow_runs.filter(r =>
r.status === 'completed' &&
r.event === 'schedule' &&
new Date(r.created_at) < new Date(since24h)
);

if (priorRuns.length > 0) {
// Check the most recent prior run
const priorRun = priorRuns[0];
const priorPerfect = priorRun.conclusion === 'success';
if (perfect && priorPerfect) {
trendLine = 'Trend: ➡️ Stable (perfect both days)';
} else if (perfect && !priorPerfect) {
trendLine = 'Trend: ↗️ Improving (yesterday had failures → today perfect)';
} else if (!perfect && priorPerfect) {
trendLine = 'Trend: ↘️ Degrading (yesterday perfect → today has failures)';
if (isSelectiveDispatch) {
trendLine = 'Trend: ⊘ Not shown for selective dispatches';
} else {
try {
const WORKFLOW_FILE = 'nightly-e2e.yaml';
const now = new Date();
const since48h = new Date(now.getTime() - 48 * 60 * 60 * 1000).toISOString();
const since24h = new Date(now.getTime() - 24 * 60 * 60 * 1000).toISOString();

const { data } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: WORKFLOW_FILE,
created: `>=${since48h}`,
per_page: 50,
});

// Find completed scheduled runs from 24–48h ago
const priorRuns = data.workflow_runs.filter(r =>
r.status === 'completed' &&
r.event === 'schedule' &&
new Date(r.created_at) < new Date(since24h)
);

if (priorRuns.length > 0) {
// Check the most recent prior run
const priorRun = priorRuns[0];
const priorPerfect = priorRun.conclusion === 'success';
if (perfect && priorPerfect) {
trendLine = 'Trend: ➡️ Stable (perfect both days)';
} else if (perfect && !priorPerfect) {
trendLine = 'Trend: ↗️ Improving (yesterday had failures → today perfect)';
} else if (!perfect && priorPerfect) {
trendLine = 'Trend: ↘️ Degrading (yesterday perfect → today has failures)';
} else {
trendLine = 'Trend: ➡️ Stable (failures both days)';
}
} else {
trendLine = 'Trend: ➡️ Stable (failures both days)';
trendLine = 'Trend: ⊘ No prior-day data for comparison';
}
} else {
trendLine = 'Trend: ⊘ No prior-day data for comparison';
} catch (e) {
trendLine = `Trend: ⊘ Could not fetch prior-day data (${e.message})`;
}
} catch (e) {
trendLine = `Trend: ⊘ Could not fetch prior-day data (${e.message})`;
}

// ── Build scorecard ─────────────────────────────────────
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const lines = [
`## 🌅 NemoClaw Nightly Scorecard — ${today}`,
'',
`**Run mode:** ${runMode}`,
];

if (isSelectiveDispatch) {
lines.push(`**Requested jobs:** ${requestedJobs.map((name) => `\`${name}\``).join(', ')}`);
}

lines.push(
`**Jobs run:** ${ran} of ${total}`,
` ✅ ${success} passed`,
` ❌ ${failure} failed`,
` ⊘ ${cancelled} cancelled`,
` ⏭️ ${skipped} skipped`,
];
);

if (failedJobs.length > 0) {
lines.push('');
Expand Down
Loading