Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status page: do not error if migration details can't be fetched; show zeros instead #2390

Merged
merged 6 commits into from
Nov 28, 2024
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
36 changes: 27 additions & 9 deletions src/components/StatusDashboard/current_migrations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,18 @@ function TableContent({ collapsed, name, resort, rows, select, sort, fetched })
return (
<tr key={row.name}>
<td>
<Link href={href}
style={{ display: "block" }}
onClick={event => {
event.preventDefault();
setState(href);
}}>{row.name}</Link>
{row.success ?
<Link href={href}
style={{ display: "block" }}
onClick={event => {
event.preventDefault();
setState(href);
}}>{row.name}</Link>
: <>
<span title="Failed to load. Refresh the page to try again." style={{cursor: "pointer"}}>⚠️</span>
{" "}{row.name}
</>
}
</td>
<td>
<label className={styles.progress_bar}>
Expand Down Expand Up @@ -277,15 +283,27 @@ function fetchContent(onLoad, setState) {
for (const { name } of fetched[status]) {
promises.push(
(async (index) => {
let details, success;
try {
const url = urls.migrations.details.replace("<NAME>", name);
const response = await fetch(url);
const details = await response.json();
fetched[status][index].details = details;
fetched[status][index].progress = measureProgress(details);
details = await response.json();
success = true;
} catch (error) {
console.warn(`error loading migration: ${name}`, error);
details = {
"done": [],
"in-pr": [],
"awaiting-pr": [],
"awaiting-parents": [],
"not-solvable": [],
"bot-error": [],
}
success = false;
}
fetched[status][index].details = details;
fetched[status][index].progress = measureProgress(details);
fetched[status][index].success = success;
})(count++)
);
}
Expand Down
Loading