Skip to content

fix(ci): skip a test whose name is too large and say which one - #1793

Open
sileht wants to merge 1 commit into
mainfrom
devs/sileht/mrgfy-8951-cli-skip-oversized-test-names/skip-test-whose-name-too-large-say-which-one--224cd6b7
Open

fix(ci): skip a test whose name is too large and say which one#1793
sileht wants to merge 1 commit into
mainfrom
devs/sileht/mrgfy-8951-cli-skip-oversized-test-names/skip-test-whose-name-too-large-say-which-one--224cd6b7

Conversation

@sileht

@sileht sileht commented Aug 31, 2026

Copy link
Copy Markdown
Member

A test name arrives from JUnit unbounded and goes straight onto the wire:
build_traces copies it into the span name and two attributes. INC-2436
was a Vitest title interpolating stringified React source at 31,207
characters, and nothing between the runner and the backend refused it.

Skip a case whose name exceeds 65,536 bytes and report it through the
path already built for cases too large to upload: the human report and,
on GitHub Actions, a ::warning:: annotation. The CI outcome is
untouched, so a skipped result never breaks a customer's build. A suite
left with no cases emits no span rather than an empty suite.

Skipped rather than truncated on purpose. The backend identifies a test
by uuid_generate_v5 of its name, so a truncated name is a different
test: the result would split its history, flakiness and quarantine state
in two. Not uploading it says so plainly, and names it so the owner can
rename the test.

Names are cut to 120 bytes for display in both surfaces, since the name
is itself what made the case too large.

Fixes MRGFY-8951
Related to MRGFY-8902

Copilot AI lite review requested due to automatic review settings August 31, 2026 10:07
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 31, 2026 10:08 Failure
@sileht
sileht deployed to func-tests-live August 31, 2026 10:08 — with GitHub Actions Active
@mergify

mergify Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 6 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 👀 Review Requirements 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 🤖 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
  • #review-threads-unresolved = 0
This rule is failing.
  • #review-requested = 0
  • #review-threads-unresolved = 0
  • #changes-requested-reviews-by = 0

Show 4 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The current merge of oversized case names clones potentially very large strings unnecessarily, which undermines the goal of safely handling oversized names and can cause avoidable memory/CPU overhead.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR hardens the mergify ci junit-process OTLP span generation and reporting against unbounded JUnit test names by skipping spans for cases with excessively long names and surfacing the skipped cases to users (including GitHub Actions annotations).

Changes:

  • Add a byte cap for test case names during span construction; skip oversized cases and omit suite spans that would otherwise contain zero cases.
  • Plumb skipped oversized case names through to the command orchestrator and unify them with “too large to upload” reporting.
  • Truncate skipped-case names for display in both the human report and GitHub Actions ::warning:: annotations, with regression tests.
File summaries
File Description
crates/mergify-ci/src/junit_process/spans.rs Enforces a max test-name byte limit during span building, tracks skipped case names, and avoids emitting empty suite spans.
crates/mergify-ci/src/junit_process/command.rs Merges skipped-by-name cases into the existing “skipped upload” reporting path and truncates displayed names in reports/annotations, with tests.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

/// Truncating would mint a second identity for the same test, which is the
/// one outcome worse than not having the result: the test would split into
/// two histories and its flakiness and quarantine state with it.
pub const MAX_TEST_NAME_BYTES: usize = 65_536;
Comment on lines +195 to +198
// Cases the span builder refused on name length join the ones the split
// refused on payload size: from the user's side both are "this result was
// not uploaded", and one list is what they need to act on.
oversized_cases.extend(built.oversized_case_names.iter().cloned());
@sileht
sileht marked this pull request as ready for review August 31, 2026 11:47
A test name arrives from JUnit unbounded and goes straight onto the wire:
`build_traces` copies it into the span name and two attributes. INC-2436
was a Vitest title interpolating stringified React source at 31,207
characters, and nothing between the runner and the backend refused it.

Skip a case whose name exceeds 65,536 bytes and report it through the
path already built for cases too large to upload: the human report and,
on GitHub Actions, a `::warning::` annotation. The CI outcome is
untouched, so a skipped result never breaks a customer's build. A suite
left with no cases emits no span rather than an empty suite.

Skipped rather than truncated on purpose. The backend identifies a test
by `uuid_generate_v5` of its name, so a truncated name is a different
test: the result would split its history, flakiness and quarantine state
in two. Not uploading it says so plainly, and names it so the owner can
rename the test.

Names are cut to 120 bytes for display in both surfaces, since the name
is itself what made the case too large.

Fixes MRGFY-8951
Related to MRGFY-8902

Change-Id: I224cd6b770d1228bc0ae884ec546b05a94102e3d
@sileht
sileht force-pushed the devs/sileht/mrgfy-8951-cli-skip-oversized-test-names/skip-test-whose-name-too-large-say-which-one--224cd6b7 branch from 42bb940 to 5062e98 Compare August 31, 2026 12:44
@sileht

sileht commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial 42bb940 2026-08-31 12:44 UTC
2 content 42bb940 → 5062e98 (raw) 2026-08-31 12:44 UTC

@sileht
sileht deployed to func-tests-live August 31, 2026 12:44 — with GitHub Actions Active
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 31, 2026 12:44 Failure
@mergify
mergify Bot requested a review from a team August 31, 2026 12:49
@sileht
sileht marked this pull request as draft September 3, 2026 06:58
@sileht
sileht marked this pull request as ready for review September 3, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants