GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(gitlab): a watch reports a pipeline retry that fails again by royalaid · Pull Request #33671 · pingdotgg/t3code

fix(gitlab): a watch reports a pipeline retry that fails again #33671

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.

Sign up for GitHub

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

Open
royalaid wants to merge 1 commit into pingdotgg:fix/issue-32277
base: fix/issue-32277
Loading
Loading
from Fisi-Development:fix/gitlab-pipeline-rerun-identity
+67 −3
Open

fix(gitlab): a watch reports a pipeline retry that fails again #33671

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
8b2e312
fix(gitlab): a watch reports a pipeline retry that fails again
royalaid Nov 10, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

23 changes: 23 additions & 0 deletions 23 apps/server/src/orchestration-v2/pullRequestWatch.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,29 @@ describe("evaluatePullRequestWatch", () => {
}
});

it("reports a retry that fails again where the run keeps its URL", () => {
// GitLab retries failed jobs inside the same pipeline, so only the run ID moves.
const pipeline = (finishedAt: string): PullRequestCheck => ({
...check("Pipeline", "failure"),
url: "https://gitlab.example/o/r/-/pipelines/7",
runId: `7@${finishedAt}`,
});
const first = pipeline("2026-11-10T00:28:57.000Z");
const again = pipeline("2026-11-10T00:39:53.000Z");
const told = evaluatePullRequestWatch(watch(), detail({ checks: [first] }), noRemarks);
assert.deepEqual(told.changes, [{ kind: "checks-failed", failed: [first] }]);
assert.deepEqual(
evaluatePullRequestWatch(told.next, detail({ checks: [first] }), noRemarks).changes,
[],
);
const retried = evaluatePullRequestWatch(told.next, detail({ checks: [again] }), noRemarks);
assert.deepEqual(retried.changes, [{ kind: "checks-failed", failed: [again] }]);
assert.deepEqual(
evaluatePullRequestWatch(retried.next, detail({ checks: [again] }), noRemarks).changes,
[],
);
});

it("does not repeat a failure an older watch told by name", () => {
const older = watch({ headSha: "aaaaaaaaaa", failedChecks: ["lint"] });
const failed = detail({ checks: [check("lint", "failure")] });
Expand Down
9 changes: 6 additions & 3 deletions 9 apps/server/src/orchestration-v2/pullRequestWatch.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ export function evaluatePullRequestWatch(
const failed = checks.filter(isFailedCheck);
const awaiting = checks.filter((check) => check.status === "action-required");
if (checks.length > 0) {
// A new run URL under a failing name is a rerun that failed again between reads.
// A new run under a failing name is a rerun that failed again between reads. A run is its
// URL, or the host's run ID where the URL stays the same across reruns.
const toldRuns = failedRuns;
const runOf = (check: PullRequestCheck) =>
check.url === null ? null : JSON.stringify([check.name, check.url]);
const runOf = (check: PullRequestCheck) => {
const run = check.runId ?? check.url;
return run === null ? null : JSON.stringify([check.name, run]);
};
const newlyFailed = failed.filter((check) => {
const run = runOf(check);
return (
Expand Down
5 changes: 5 additions & 0 deletions 5 packages/contracts/src/pullRequest.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ export const PullRequestCheck = Schema.Struct({
* approval when that read fails, so nothing waits on it or counts it as passing.
*/
placeholder: Schema.optional(Schema.Boolean),
/**
* Tells this run of the check apart from earlier ones where its URL does not change on a
* rerun, such as a GitLab pipeline whose failed jobs were retried in place.
*/
runId: Schema.optional(TrimmedNonEmptyString),
});
export type PullRequestCheck = typeof PullRequestCheck.Type;

Expand Down
26 changes: 26 additions & 0 deletions 26 packages/source-control-gitlab/src/server/gitLabMergeRequestJson.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,32 @@ describe("decodeMergeRequestDetailJson", () => {
]);
});

it("tells each finish of a pipeline apart, since a job retry keeps its URL", () => {
const pipelineCheck = (pipeline: Record<string, unknown>) =>
expectSuccess(decodeMergeRequestDetailJson(detailJson({ head_pipeline: pipeline })))
.checks[0];
const failed = (finishedAt: string) =>
pipelineCheck({
id: 3047545127,
status: "failed",
web_url: "https://gitlab.com/acme/web/-/pipelines/3047545127",
finished_at: finishedAt,
});

const first = failed("2026-11-10T00:28:57.753Z");
const retried = failed("2026-11-10T00:39:53.753Z");
expect(first?.url).toBe(retried?.url);
expect(first?.runId).toBe("3047545127@2026-11-10T00:28:57.753Z");
expect(retried?.runId).toBe("3047545127@2026-11-10T00:39:53.753Z");
// A running pipeline has no finish time yet, and one without an ID has nothing to key on.
expect(pipelineCheck({ id: 3047545127, status: "running", finished_at: null })?.runId).toBe(
undefined,
);
expect(
pipelineCheck({ status: "failed", finished_at: "2026-11-10T00:39:53.753Z" })?.runId,
).toBe(undefined);
});

it.each(["canceled", "canceling"])("maps a %s pipeline to cancelled", (status) => {
const detail = expectSuccess(
decodeMergeRequestDetailJson(detailJson({ head_pipeline: { status } })),
Expand Down
7 changes: 7 additions & 0 deletions 7 packages/source-control-gitlab/src/server/gitLabMergeRequestJson.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const RawPipelineSchema = Schema.Struct({
status: Schema.optional(Schema.NullOr(Schema.String)),
web_url: Schema.optional(Schema.NullOr(Schema.String)),
source: Schema.optional(Schema.NullOr(Schema.String)),
finished_at: Schema.optional(Schema.NullOr(Schema.String)),
});

const RawTriggerJobSchema = Schema.Struct({
Expand Down Expand Up @@ -306,12 +307,18 @@ function toChecks(
): ReadonlyArray<PullRequestCheck> {
const pipeline = raw.head_pipeline;
if (!pipeline) return [];
// Retrying jobs reruns them inside the same pipeline, so its URL stays the same. Each time it
// finishes again, its finish time moves, and that tells a retry that failed again apart.
const finishedAt = trimmed(pipeline.finished_at);
return [
{
name: "Pipeline",
status: toPipelineStatus(pipeline.status),
description: trimmed(pipeline.source),
url: trimmed(pipeline.web_url),
...(pipeline.id == null || finishedAt === null
? {}
: { runId: `${pipeline.id}@${finishedAt}` }),
},
];
}
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.