Skip to content

Commit c2ef103

Browse files
committed
Large suites: plain copy ("Nothing changed since #7.", "29 of 30 groups unchanged since #8."), the how in a (?) tooltip; the CLI says the same
1 parent e63b082 commit c2ef103

2 files changed

Lines changed: 32 additions & 23 deletions

File tree

‎crates/visualci-cli/src/main.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ fn send_snapshots(client: &Client, build_id: &str, snapshots: &[Snapshot]) -> Re
836836
.collect::<Result<Vec<_>>>()?;
837837
let check = client.check_groups(build_id, &entries, group_depth)?;
838838
if let Some(n) = check.same_as_build {
839-
eprintln!("{} snapshots, all the same as build #{n}: nothing to send", snapshots.len());
839+
eprintln!("{} snapshots: nothing changed since build #{n}", snapshots.len());
840840
return Ok(());
841841
}
842842
let grouping = group_depth
@@ -846,10 +846,10 @@ fn send_snapshots(client: &Client, build_id: &str, snapshots: &[Snapshot]) -> Re
846846
snapshots.iter().filter(|s| changed.contains(grouping.key(&s.name).as_str())).cloned().collect();
847847
let (registered, uploaded) = if send.is_empty() { (0, 0) } else { client.add_snapshots(build_id, &send)? };
848848
eprintln!(
849-
"{} snapshots: {} groups unchanged ({} snapshots not sent), {registered} sent, {uploaded} uploaded",
849+
"{} snapshots: {} of {} groups unchanged; {registered} sent, {uploaded} uploaded",
850850
snapshots.len(),
851851
check.unchanged.len(),
852-
snapshots.len() - send.len()
852+
check.unchanged.len() + check.changed.len()
853853
);
854854
Ok(())
855855
}

‎server/frontend/src/pages/BuildPage.tsx‎

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -555,34 +555,43 @@ function environmentTitle(build: BuildDetail) {
555555
return [info.user, info.machine].filter(Boolean).join(' on ') || build.environment
556556
}
557557

558-
/** A large suite's matched groups: carried forward from the build they're the same as, listed on demand. */
558+
/** A large suite's groups: how many didn't change since the build they match, listed on demand. */
559559
function GroupsNotice({ groups }: { groups: BuildGroups }) {
560560
const { org, project } = route.useParams()
561561
const same = groups.same_as_build
562+
const total = groups.unchanged_groups + groups.changed_groups.length
563+
const since = same ? (
564+
<Link to="/$org/$project/builds/$number" params={{ org, project, number: same }}>
565+
#{same}
566+
</Link>
567+
) : (
568+
'the baseline'
569+
)
562570
return (
563571
<div className="notice groups-notice">
564572
<p>
565-
<strong>{groups.manifest_matched ? 'Nothing changed:' : `${n(groups.unchanged_groups)} ${groups.unchanged_groups === 1 ? 'group' : 'groups'} unchanged:`}</strong>{' '}
566-
{n(groups.unchanged_snapshots)} snapshots {groups.manifest_matched ? 'are' : 'in them are'} the same as{' '}
567-
{same ? (
568-
<Link to="/$org/$project/builds/$number" params={{ org, project, number: same }}>
569-
#{same}
570-
</Link>
573+
{groups.manifest_matched ? (
574+
<>Nothing changed since {since}.</>
571575
) : (
572-
'their baselines'
573-
)}
574-
, checked by group and carried forward.
575-
{groups.changed_groups.length > 0 &&
576-
` ${n(groups.changed_groups.length)} ${groups.changed_groups.length === 1 ? 'group changed and was' : 'groups changed and were'} compared snapshot by snapshot.`}
576+
<>
577+
{n(groups.unchanged_groups)} of {n(total)} groups unchanged since {since}.
578+
</>
579+
)}{' '}
580+
<Help label="How large runs are compared">
581+
A run of 500 or more snapshots is compared group by group first. A group that matches its baseline isn&rsquo;t
582+
sent again, and costs 1 credit.
583+
</Help>
577584
</p>
578-
<details>
579-
<summary>Unchanged groups</summary>
580-
<ul className="groups-list mono">
581-
{groups.unchanged_group_keys.map((k) => (
582-
<li key={k}>{k || '(top level)'}</li>
583-
))}
584-
</ul>
585-
</details>
585+
{!groups.manifest_matched && (
586+
<details>
587+
<summary>Unchanged groups</summary>
588+
<ul className="groups-list mono">
589+
{groups.unchanged_group_keys.map((k) => (
590+
<li key={k}>{k || '(top level)'}</li>
591+
))}
592+
</ul>
593+
</details>
594+
)}
586595
</div>
587596
)
588597
}

0 commit comments

Comments
 (0)