Skip to main content
Video tutorial · 0:59

Re-running checks

Merge Pilot re-evaluates a merge request on its own whenever something it depends on changes (see When controls run), and the periodic re-check of open merge requests recovers events whose webhook was lost. When a result looks out of date anyway, for example after a scan failed or the tracker was down, the merge request page has actions to run things again.

At a glance​

Action (label in the UI)WhereRuns againWho
RefreshPage headerNothing: reloads the page from Merge PilotEveryone who can open the page
ResyncPage headerReads CI and the change approval again from the VCS and the tracker, retries a failed change approval or tracker move, and processes the merge request againEveryone in the company except auditors
Re-scanSecret scan card (open merge requests)The secret scan of the latest commitEveryone in the company except auditors
Re-scanDependency scan (SCA) card (open merge requests)The dependency scan of the latest commit (vulnerabilities, licenses, package health, dependency sources)Everyone in the company except auditors
Re-scanCI configuration check card (open merge requests)The CI configuration check of the latest commit (GitHub and GitLab)Everyone in the company except auditors
Scan the container images againContainer image scan card (open merge requests)The container image scan of the latest commitEveryone in the company except auditors
Check the infrastructure files againInfrastructure check card (open merge requests)The infrastructure check of the latest commitEveryone in the company except auditors
Reset usage of <KEY>Issue tracker cardRestarts a work item's usage count and checks the merge request againCompany admins, platform admins
Sync with <GitLab or GitHub>Merge requests pageQueues a background check of whether open merge requests were merged or closedEveryone in the company except auditors

Platform admins also see Debug flow, which opens the merge request in the debug console.

Resync​

Read CI and the change approval again from <GitLab or GitHub> and the tracker, and re-evaluate. Use it when the page does not show something that happened on the VCS or in the tracker, or after fixing the cause of a failure.

Shown for an open merge request, and for a merged or closed one whose change approval still owes a move in the tracker. Auditors do not see it.

On an open merge request, in this order:

  1. A tracker move Merge Pilot gave up on (after its automatic retries) gets its retries back.
  2. A change approval that could not be opened is tried again at once, without waiting for the pause between automatic retries.
  3. The CI runs of the latest commit are read from the VCS; runs whose state differs from what Merge Pilot has are recorded, as if their events had arrived.
  4. The change approval's status is read from the tracker: a move Merge Pilot owes the tracker is made first; otherwise a decision made in the tracker (approval or rejection), a withdrawn approval, or a deleted change approval is applied, as its event would have.
  5. The merge request is queued to be processed again: the policy is matched, the change approval brought up to date with the latest commit, the scans the policy needs and has not run for that commit are started, risk is assessed, work items are read, and the merge request is evaluated. This runs in the background, after live events.

On a merged or closed merge request, Resync only makes the tracker moves it is owed (to the merged or cancelled status, or the decision). It never runs scans or re-evaluates: what was recorded at the merge stays as it was.

On any merge request, Resync also moves superseded change approvals that could not be moved to the cancelled status (see Change approval).

Resync does not run scans again for a commit already scanned: use Re-scan. The toast says Resync started; the page reloads shortly after.

AnswerWhen
200 with actionsDone; actions lists what was done (for example pipelines:2, change approval:approve, change_approval_retry, processed, moved:<status>, or moved:<KEY>:<status> for a superseded change approval)
409The merge request is not open and owes no tracker move (only open merge requests, or ones whose change approval could not be moved, can be resynced)
502The VCS could not be read (resync failed: …), or the owed tracker move failed (moving the change approval failed: …, moving a superseded change approval failed: …)

API: POST /api/v1/merge-requests/{id}/resync. Audit: mr_resync, with the actions in its details.

Re-scan​

Each scan card of an open merge request has a Re-scan button (Re-scan dependencies and Check the CI configuration again to screen readers). It scans the merge request's latest commit again:

  1. The card shows the scan as pending (Scan in progress, Dependency scan in progress) for that commit; the last result stays on the merge request until the new one replaces it.
  2. The scan runs in the background.
  3. When it finishes, the result replaces the previous one, the scan's comment on the merge request is updated, and the merge request is evaluated again.
ScanWhat runsCard (label in the UI)Refused when
Secret scanThe secret scan with the company's and policy's current settings (see Secret scan)Secret scan—
Dependency scanThe changed dependency manifests are read again and looked up for vulnerabilities, licenses and package health, and their sources are checked, for the controls the policy runs (see Dependency scan)Dependency scan (SCA)—
CI configuration checkThe GitHub Actions workflows, or the GitLab CI configuration, the merge request adds or changes (see CI configuration check)CI configuration checkIts policy does not run the check (the merge request's policy does not run the CI configuration check, HTTP 400)
Container image scanThe container images of the latest commit (see Container image scan)Container image scanIts policy does not run the scan (the merge request's policy does not run the container image scan, HTTP 400)
Infrastructure checkThe infrastructure files of the latest commit (see Infrastructure check)Infrastructure checkIts policy does not run the check (the merge request's policy does not run the infrastructure check, HTTP 400)

For every scan:

  • A re-scan of a merged or closed merge request is refused (the merge request is merged: only open merge requests are scanned again; its recorded scans stay as they were, HTTP 409). Its scans are the record of what was merged, and the button is not shown.
  • A re-scan of a merge request in a watched repository is refused while the company does not scan watched merge requests (scans are off for watched repositories (Company → Repositories)).

Limits:

  • One at a time per scan. While a scan of the merge request is waiting or running, its button is disabled; through the API, a second request answers scan already in progress and starts nothing. There is no other cooldown.
  • The latest commit only. A re-scan is for the commit Merge Pilot last recorded as the merge request's head. A scan of an older commit that finishes after a newer one never overwrites the newer result.
  • A card is shown only once the scan has been started for the merge request, so a scan the policy never ran has no card and no button.

Scans also run again on their own: once for each new commit, and after a failure when the company's or policy's When the scan cannot finish is set to retry automatically (after a pause). Otherwise a failed scan (Scan failed: …) waits for someone to re-scan. A scan failed only by a limit or by a file list the VCS cut short is never retried by itself and says Trying again would not change this: change the merge request or the company's scan settings (When a scan cannot see everything, see Scanning), then re-scan.

API: POST /api/v1/merge-requests/{id}/rescan with {"scan": "secret"}, {"scan": "sca"}, {"scan": "workflow"}, {"scan": "image"} or {"scan": "iac"}. It answers rescan started with the job_id. Audit: secret_rescan, sca_rescan, workflow_rescan, image_rescan, iac_rescan, with the job ID.

Reset usage of a work item​

When the work items control reports that a work item was already used as many times as the policy allows, company admins see Reset usage of <KEY> on the Issue tracker card. Merged merge requests before the reset no longer count, and an open merge request is checked again at once (as Resync does). API: POST /api/v1/merge-requests/{id}/work-items/{key}/reset-usage. Audit: work_item_usage_reset. See Work items.

Sync with the VCS​

On the Merge requests page, Sync with <GitLab or GitHub> (Sync with the VCS for a company on both) queues a background check of the company's open merge requests: the VCS is asked for their state, and those that were merged or closed meanwhile are recorded as their events would have. A merge found this way is recorded with unknown (found by state sync) as who merged. The page also asks for this once when it opens.

The check never runs inside the page's request and is kept cheap:

  • One per VCS connection at a time. Each connection with open merge requests gets one check; while one is waiting or running, another is not queued.
  • Not too often. A check that the page asks for when it opens is skipped when one was queued for that connection in the last 5 minutes; Sync with <GitLab or GitHub> is skipped when one was queued in the last minute.
  • Bounded. One check reads at most 300 open merge requests, those checked longest ago first; a larger backlog is covered by the following checks.
  • Behind live work. It is background work: it runs after live events and stops while the VCS's rate limit is down to the share kept for live events, going on after the limit resets.

The merge requests found merged or closed show their new state once the check has run (usually within seconds). API: POST /api/v1/merge-requests/sync-states (?force=true for the manual sync), answers queued, running and recent: how many connections got a new check, already had one waiting or running, or were checked within the interval.

Who may use them​

  • Auditors read the page only: they see none of the buttons, and the API refuses them.
  • Re-scan (open merge requests only), Resync and Sync with <GitLab or GitHub> are open to every other role of the company (users, policy managers, company admins) and to platform admins. Through the API they also accept service tokens.
  • Reset usage is for company admins and platform admins.

Audit log​

ActionWhen
mr_resyncSomeone resynced a merge request (with what was done)
secret_rescanSomeone started the secret scan of a merge request again
sca_rescanSomeone started the dependency scan of a merge request again
workflow_rescanSomeone started the CI configuration check of a merge request again
image_rescanSomeone started the container image scan of a merge request again
iac_rescanSomeone started the infrastructure check of a merge request again
work_item_usage_resetAn admin restarted a work item's usage count

The scans' own results are recorded as they always are (secrets_detected, sca_scan, dependency_sources_detected, workflow_problems_detected, image_vulnerabilities_detected, iac_problems_detected). See Audit log.

Video tutorial

Short videos of this feature working on real GitLab and Jira projects. English audio, English and Turkish subtitles. All video tutorials →

When a Merge Request Looks Stuck — ResyncYouTube ↗