Skip to content

ncu-ci: create INFRA_FAILURES category #441

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.

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

Merged
merged 1 commit into from
Jul 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions lib/ci/ci_failure_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ const JENKINS_FAILURE = 'JENKINS_FAILURE';
const GIT_FAILURE = 'GIT_FAILURE';
const NCU_FAILURE = 'NCU_FAILURE';
const RESUME_FAILURE = 'RESUME_FAILURE';
const INFRA_FAILURE = 'INFRA_FAILURE';

const FAILURE_TYPES = {
BUILD_FAILURE, JS_TEST_FAILURE, CC_TEST_FAILURE,
JENKINS_FAILURE, GIT_FAILURE, NCU_FAILURE, RESUME_FAILURE
JENKINS_FAILURE, GIT_FAILURE, NCU_FAILURE, RESUME_FAILURE,
INFRA_FAILURE
};

class CIResult {
Expand All @@ -60,6 +62,14 @@ class BuildFailure extends CIResult {
}
}

// Usually needs to fix something in the Jenkins agent (or just restart it)
class InfraFailure extends CIResult {
constructor(ctx, reason) {
super(ctx, reason);
this.type = INFRA_FAILURE;
}
}

// Usually needs a fix in the test or the core
class JSTestFailure extends CIResult {
constructor(ctx, reason) {
Expand Down Expand Up @@ -126,6 +136,25 @@ function failureMatcher(Failure, patterns, ctx, text) {

// The elements are ranked by priority
const FAILURE_FILTERS = [{
// NOTE(mmarchini): infra-related issues should have the highest priority, as
// they can cause other issues to happen.
filter(ctx, text) {
const patterns = [{
pattern: /Read-only file system/g,
context: { index: 0, contextBefore: 1, contextAfter: 0 }
},
{
pattern: /Device or resource busy/g,
context: { index: 0, contextBefore: 1, contextAfter: 0 }
},
{
pattern: /There is not enough space in the file system./g,
context: { index: 0, contextBefore: 1, contextAfter: 0 }
}
];
return failureMatcher(InfraFailure, patterns, ctx, text);
}
}, {
// TODO: match indentation to avoid skipping context with '...'
filter(ctx, text) {
const pattern = /not ok \d+[\s\S]+? {2}\.\.\.\r?\n/mg;
Expand Down Expand Up @@ -203,9 +232,6 @@ const FAILURE_FILTERS = [{
}, {
filter(ctx, text) {
const patterns = [{
pattern: /There is not enough space in the file system./g,
context: { index: 0, contextBefore: 0, contextAfter: 5 }
}, {
pattern: /sh: line /g,
context: { index: 0, contextBefore: 0, contextAfter: 1 }
}, {
Expand Down