Skip to content

Improve yarn_run failure category to capture make .gitlab-yarn build failures

What does this MR do and why?

This MR enhances the yarn_run failure category to capture make .gitlab-yarn build failures that were previously falling into the generic ruby_generic_failure category. These errors occur when yarn package installation fails during the make build process.

Analysis

Problem identified: The ruby_generic_failure category analysis revealed that the second most frequent signature was make .gitlab-yarn build failures:

  • ruby_generic_failure__82eb8b73df2d8926 (59 occurrences) - make .gitlab-yarn failed errors

Root cause: Network failures during yarn package installation causing the make build process to fail, which then cascades through Ruby's rake task execution.

Example job logs:

Job 11452965139: https://gitlab.com/gitlab-org/gitlab/-/jobs/11452965139

error An unexpected error occurred: "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.2.tgz: Request failed \"502 Bad Gateway\"".
info If you think this is a bug, please open a bug report with the information provided in "/home/gdk/gdk/gitlab/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
make: *** [support/makefiles/Makefile.gitlab.mk:87: .gitlab-yarn] Error 1
/home/gdk/gdk/lib/tasks/update.rake:35:in `block (3 levels) in <top (required)>': `make .gitlab-yarn` failed. (Support::Rake::TaskWithLogger::MakeError)

While the error manifests as a Ruby rake failure, the root cause is a yarn registry network issue (502 Bad Gateway). The make command calls yarn, which fails due to network issues, causing the entire build chain to fail. This is fundamentally a yarn build failure, not a Ruby code issue.

Changes:

  1. Enhanced pattern matching: Added make .gitlab-yarn patterns to existing yarn_run category:
    • "update.rake.+make .gitlab-yarn.+failed"

Results

Before changes:

  • 59 make .gitlab-yarn failures in ruby_generic_failure category
  • Yarn build failures split across different categories based on execution path

After changes:

  • 59 failures moved from ruby_generic_failure to yarn_run
  • Unified categorization for all yarn-related build failures
  • Job 11452965139: ruby_generic_failure → yarn_run

Validation: Tested against actual job URL:

  • Job 11452965139: ruby_generic_failure → yarn_run with signature yarn_run__0eb94b8f9262cc16

Impact: Developers now receive actionable yarn_run categorization instead of generic Ruby failures, making it easier to identify network/infrastructure issues during frontend dependency installation. This consolidates yarn build failures under a single, meaningful category regardless of whether they're triggered directly or through make/rake.

How to validate

To validate these changes work correctly:

  1. Test individual jobs:

    bin/failure_category_analyzer https://gitlab.com/gitlab-org/gitlab/-/jobs/11452965139

    Should return yarn_run category instead of ruby_generic_failure.

  2. Test pattern matching:

    # Extract ruby_generic_failure jobs from existing analysis
    awk -F',' 'NR==1 {print "JOB_URL"} $2 == "ruby_generic_failure" {print $1}' <path/to/existing_results>.csv > input/ruby_generic_failure_yarn_run_jobs.csv
    
    # Re-analyze with new patterns
    bin/failure_category_analyzer --csv input/ruby_generic_failure_yarn_run_jobs.csv --output-csv output/ruby_generic_failure_yarn_run_reanalyzed.csv
    
    # Check results
    bin/analyze_signatures output/ruby_generic_failure_yarn_run_reanalyzed.csv

    Relates to gitlab-org/quality/analytics/team#297

Edited by Lohit Peesapati

Merge request reports

Loading