Skip to content

Compare changes

Choose two branches to see what one has that the other does not, then open a pull request for it.

Open a pull request

1 commit

2 files+25−20/2 viewed
+2−2
3333 const MERGE_MINUTES: u64 = 2;
3434 /// Who a merge made by a repository's settings is attributed to. Not an
3535 /// account: `g1t` cannot be registered.
36−const POLICY_ACTOR_ID: &str = "g1t_policy";
37−const POLICY_ACTOR_NAME: &str = "g1t";
36+pub(crate) const POLICY_ACTOR_ID: &str = "g1t_policy";
37+pub(crate) const POLICY_ACTOR_NAME: &str = "g1t";
3838 /// How much of a failed check's output the author is shown.
3939 const MAX_CHECK_OUTPUT_CHARS: usize = 4_000;
4040 const MANAGED_PAGE: u32 = 200;
+23−0
129129 .await?
130130 .results::<HeadRow>()?;
131131 for head in heads {
132+ // A pull request g1t stopped on picks back up once what stopped
133+ // it passes: its workflows, and its checks if it has any. The
134+ // lifecycle then decides again, within its usual limits.
135+ if facts.failed.is_empty() {
136+ let resumed = self
137+ .db
138+ .prepare(
139+ "UPDATE pulls SET stalled = NULL WHERE id = ? AND managed = 1 AND stalled IS NOT NULL
140+ AND (check_status IS NULL OR check_status = 'passed') RETURNING id AS value",
141+ )
142+ .bind(&[head.id.as_str().into()])?
143+ .first::<crate::rows::ValueRow>(None)
144+ .await?;
145+ if resumed.is_some() {
146+ self.note(
147+ &a.repo_id,
148+ head.number,
149+ (crate::lifecycle::POLICY_ACTOR_ID, crate::lifecycle::POLICY_ACTOR_NAME),
150+ "picked this back up: its workflows pass now",
151+ )
152+ .await?;
153+ }
154+ }
132155 self.publish_as(
133156 "checks.completed",
134157 &a.repo_id,