Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

ci: notify other build status #521

Merged
merged 11 commits into from
May 12, 2020
Merged

Conversation

v1v
Copy link
Member

@v1v v1v commented May 8, 2020

What does this PR do?

Enable the build status reporting for some other use cases:

  • When it's aborted, add the reason if possible
  • When there are test failures.
  • When something else happens then report failed

See the tests to get an overall view of the new reporting

Why is it important?

This will help to distinguish what's the build status easily from the comment

Related issues

Closes #506
Notifies elastic/beats#18317

Tasks

  • Run some manual tests to validate the reporting behaves as expected
  • If aborted then add some comment with the reason if possible.

Tests

Aborted build (from following builds)

Caused by:

  • the build was aborted as there is a new build on-going.
Expand to view screenshots

image

Aborted build (some other use cases)

Caused by:

  • the build was aborted as there is a new build on-going.
  • someone with write privileges killed the build from the Jenkins UI
  • Timeout has been exceeded
Expand to view screenshots

image

Success

Caused by:

  • Everything went smooth
Expand to view screenshots

image

Test failures

Caused by:

  • Test failures
Expand to view screenshots

image

Caused by:

  • Test errors when they are reported as unstable.
Expand to view screenshots

image

image

Some other failures

Caused by:

  • Genuine failure
Expand to view screenshots

image

@v1v v1v self-assigned this May 8, 2020
@v1v v1v added the automation label May 8, 2020
@botelastic botelastic bot added the groovy label May 8, 2020
Comment on lines +25 to +32
def f

@Override
@Before
void setUp() throws Exception {
super.setUp()
f = new File("src/test/resources/console-100-lines.log")
env.TEST = "test"
Copy link
Member Author

Choose a reason for hiding this comment

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

Minor refactor to reuse once

@apmmachine
Copy link
Contributor

apmmachine commented May 8, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview stats

Expand to view the summary

Build stats

Test stats 🧪

Test Results
Failed 0
Passed 499
Skipped 18
Total 517

@elasticmachine
Copy link

elasticmachine commented May 8, 2020

💛 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Started by user anonymous, Replayed GitHub env step #13]

  • Start Time: 2020-05-08T15:16:35.309+0000

  • Duration: 3 min 39 sec (159359)

  • Commit: 9e3f191

Test stats 🧪

Test Results
Failed 9
Passed 491
Skipped 9
Total 509

Test errors

Expand to view the tests failures

  • Name: Check pre-commit / Check for case conflicts – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / Check for merge conflicts – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / Fix End of Files – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkabstractclassesandtrait – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkjsonslurperclass – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkunicodenonbreakingspaces – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / removeunicodenonbreakingspaces – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkendashes – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / removeendashes – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error

Log output

Expand to view the last 100 lines of log output

[2020-05-08T15:19:14.931Z] + file=steps-errors.json
[2020-05-08T15:19:14.931Z] + jqAppend http://localhost:8080/ 'map(with_entries(select(.key != "_links")) + ( .url = $a + ._links.self.href + "log"))' steps-errors.json
[2020-05-08T15:19:14.931Z] + argument=http://localhost:8080/
[2020-05-08T15:19:14.931Z] + query='map(with_entries(select(.key != "_links")) + ( .url = $a + ._links.self.href + "log"))'
[2020-05-08T15:19:14.931Z] + file=steps-errors.json
[2020-05-08T15:19:14.931Z] ++ mktemp
[2020-05-08T15:19:14.931Z] + tmp=/tmp/tmp.C2li9bRrrw
[2020-05-08T15:19:14.931Z] + jq --arg a http://localhost:8080/ 'map(with_entries(select(.key != "_links")) + ( .url = $a + ._links.self.href + "log"))' steps-errors.json
[2020-05-08T15:19:14.931Z] + mv /tmp/tmp.C2li9bRrrw steps-errors.json
[2020-05-08T15:19:14.932Z] + jqEdit 'map(del(._links))' steps-errors.json
[2020-05-08T15:19:14.932Z] + query='map(del(._links))'
[2020-05-08T15:19:14.932Z] + file=steps-errors.json
[2020-05-08T15:19:14.932Z] ++ mktemp
[2020-05-08T15:19:14.932Z] + tmp=/tmp/tmp.C3VdoSSOIN
[2020-05-08T15:19:14.932Z] + jq 'map(del(._links))' steps-errors.json
[2020-05-08T15:19:14.932Z] + mv /tmp/tmp.C3VdoSSOIN steps-errors.json
[2020-05-08T15:19:14.932Z] + jqEdit 'map(del(._class))' steps-errors.json
[2020-05-08T15:19:14.932Z] + query='map(del(._class))'
[2020-05-08T15:19:14.932Z] + file=steps-errors.json
[2020-05-08T15:19:14.932Z] ++ mktemp
[2020-05-08T15:19:14.932Z] + tmp=/tmp/tmp.oKt9KEeD3S
[2020-05-08T15:19:14.932Z] + jq 'map(del(._class))' steps-errors.json
[2020-05-08T15:19:14.932Z] + mv /tmp/tmp.oKt9KEeD3S steps-errors.json
[2020-05-08T15:19:14.932Z] + jqEdit 'map(del(.actions))' steps-errors.json
[2020-05-08T15:19:14.932Z] + query='map(del(.actions))'
[2020-05-08T15:19:14.932Z] + file=steps-errors.json
[2020-05-08T15:19:14.932Z] ++ mktemp
[2020-05-08T15:19:14.932Z] + tmp=/tmp/tmp.VH6z8o65g8
[2020-05-08T15:19:14.932Z] + jq 'map(del(.actions))' steps-errors.json
[2020-05-08T15:19:14.932Z] + mv /tmp/tmp.VH6z8o65g8 steps-errors.json
[2020-05-08T15:19:14.932Z] + fetchAndDefaultTestsErrors tests-errors.json 'http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED' '[ ]'
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] + url='http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED'
[2020-05-08T15:19:14.932Z] + default='[ ]'
[2020-05-08T15:19:14.932Z] + fetchAndDefault tests-errors.json 'http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED' '[ ]'
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] + url='http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED'
[2020-05-08T15:19:14.932Z] + default='[ ]'
[2020-05-08T15:19:14.932Z] + fetch tests-errors.json 'http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED'
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] + url='http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED'
[2020-05-08T15:19:14.932Z] + echo 'INFO: curl http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED -o tests-errors.json'
[2020-05-08T15:19:14.932Z] INFO: curl http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED -o tests-errors.json
[2020-05-08T15:19:14.932Z] + [[ -n http://localhost:8080/ ]]
[2020-05-08T15:19:14.932Z] + [[ -e /usr/local/bin/bash_standard_lib.sh ]]
[2020-05-08T15:19:14.932Z] + curlCommand tests-errors.json 'http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED'
[2020-05-08T15:19:14.932Z] + curl --silent --max-time 600 --connect-timeout 30 -o tests-errors.json 'http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/tests/?status=FAILED'
[2020-05-08T15:19:14.932Z] + '[' '!' -e tests-errors.json ']'
[2020-05-08T15:19:14.932Z] + '[' '!' -s tests-errors.json ']'
[2020-05-08T15:19:14.932Z] + jq -e 'select(.code==404)' tests-errors.json
[2020-05-08T15:19:14.932Z] + normaliseTests tests-errors.json
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] + jqEdit 'map(del(._links))' tests-errors.json
[2020-05-08T15:19:14.932Z] + query='map(del(._links))'
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] ++ mktemp
[2020-05-08T15:19:14.932Z] + tmp=/tmp/tmp.zWKGUmsN7T
[2020-05-08T15:19:14.932Z] + jq 'map(del(._links))' tests-errors.json
[2020-05-08T15:19:14.932Z] + mv /tmp/tmp.zWKGUmsN7T tests-errors.json
[2020-05-08T15:19:14.932Z] + jqEdit 'map(del(._class))' tests-errors.json
[2020-05-08T15:19:14.932Z] + query='map(del(._class))'
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] ++ mktemp
[2020-05-08T15:19:14.932Z] + tmp=/tmp/tmp.EVvt1np9OL
[2020-05-08T15:19:14.932Z] + jq 'map(del(._class))' tests-errors.json
[2020-05-08T15:19:14.932Z] + mv /tmp/tmp.EVvt1np9OL tests-errors.json
[2020-05-08T15:19:14.932Z] + jqEdit 'map(del(.state))' tests-errors.json
[2020-05-08T15:19:14.932Z] + query='map(del(.state))'
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] ++ mktemp
[2020-05-08T15:19:14.932Z] + tmp=/tmp/tmp.PBVOiUnFRl
[2020-05-08T15:19:14.932Z] + jq 'map(del(.state))' tests-errors.json
[2020-05-08T15:19:14.932Z] + mv /tmp/tmp.PBVOiUnFRl tests-errors.json
[2020-05-08T15:19:14.932Z] + jqEdit 'map(del(.hasStdLog))' tests-errors.json
[2020-05-08T15:19:14.932Z] + query='map(del(.hasStdLog))'
[2020-05-08T15:19:14.932Z] + file=tests-errors.json
[2020-05-08T15:19:14.932Z] ++ mktemp
[2020-05-08T15:19:14.932Z] + tmp=/tmp/tmp.0UrAM6ltBp
[2020-05-08T15:19:14.932Z] + jq 'map(del(.hasStdLog))' tests-errors.json
[2020-05-08T15:19:14.933Z] + mv /tmp/tmp.0UrAM6ltBp tests-errors.json
[2020-05-08T15:19:14.933Z] + jqEdit 'map(del(.errorStackTrace))' tests-errors.json
[2020-05-08T15:19:14.933Z] + query='map(del(.errorStackTrace))'
[2020-05-08T15:19:14.933Z] + file=tests-errors.json
[2020-05-08T15:19:14.933Z] ++ mktemp
[2020-05-08T15:19:14.933Z] + tmp=/tmp/tmp.sogNHuFnMY
[2020-05-08T15:19:14.933Z] + jq 'map(del(.errorStackTrace))' tests-errors.json
[2020-05-08T15:19:14.933Z] + mv /tmp/tmp.sogNHuFnMY tests-errors.json
[2020-05-08T15:19:14.933Z] + fetchAndDefault pipeline-log.txt http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/ '" "'
[2020-05-08T15:19:14.933Z] + file=pipeline-log.txt
[2020-05-08T15:19:14.933Z] + url=http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/
[2020-05-08T15:19:14.933Z] + default='" "'
[2020-05-08T15:19:14.933Z] + fetch pipeline-log.txt http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/
[2020-05-08T15:19:14.933Z] + file=pipeline-log.txt
[2020-05-08T15:19:14.933Z] + url=http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/
[2020-05-08T15:19:14.933Z] + echo 'INFO: curl http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/ -o pipeline-log.txt'
[2020-05-08T15:19:14.933Z] INFO: curl http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/ -o pipeline-log.txt
[2020-05-08T15:19:14.933Z] + [[ -n http://localhost:8080/ ]]
[2020-05-08T15:19:14.933Z] + [[ -e /usr/local/bin/bash_standard_lib.sh ]]
[2020-05-08T15:19:14.933Z] + curlCommand pipeline-log.txt http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/
[2020-05-08T15:19:14.933Z] + curl --silent --max-time 600 --connect-timeout 30 -o pipeline-log.txt http://localhost:8080/blue/rest/organizations/jenkins/pipelines/mbp/PR-521/runs/15/log/

@botelastic botelastic bot added the master label May 8, 2020
@v1v v1v added the enhancement New feature or request label May 8, 2020
@v1v v1v requested a review from a team May 8, 2020 12:14
@v1v v1v marked this pull request as ready for review May 8, 2020 12:14
@v1v v1v requested review from urso and andrewkroh May 8, 2020 12:23
Comment on lines +96 to +102
- wildcard: "*.*"
- wildcard: ".ci/**"
- wildcard: ".mvn/**"
- wildcard: "local/**"
- wildcard: "src/test/**"
- wildcard: "target/**"
- wildcard: "test-infra/**"
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated with the aim of this particular PR, it will help to run the pipelines locally a bit faster

@@ -1,4 +1,17 @@
## ${statusSuccess ? ':green_heart: Build Succeeded' : ':broken_heart: Build Failed'}
<%if (statusSuccess) {%>
## :green_heart: Build Succeeded
Copy link
Member Author

Choose a reason for hiding this comment

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

Identation is not allowed otherwise the markdown will do something like:

##  :green_heart: Build Succeeded

rather than

💚 Build Succeeded

<%} else {%>
<%if (buildStatus?.equals('ABORTED')) {%>
## :grey_exclamation: Build Aborted
${(build?.description?.toLowerCase().contains('aborted')) ? '> There is a new build on-going so the previous on-going builds have been aborted.' : ''}
Copy link
Member Author

Choose a reason for hiding this comment

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

This particular validation works since

setDescription(rawBuild, "Aborted from #${currentBuild.number}")
is in charge to add the reason of the failure

## :grey_exclamation: Build Aborted
${(build?.description?.toLowerCase()?.contains('aborted')) ? '> There is a new build on-going so the previous on-going builds have been aborted.' : ' > Either there was a build timeout or someone aborted the build.'}
<%} else if (buildStatus?.equals('UNSTABLE')) {%>
## :yellow_heart: Tests Failed
Copy link
Member Author

Choose a reason for hiding this comment

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

@cachedout , what do you think?

image

Copy link
Contributor

Choose a reason for hiding this comment

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

The more I think about this, the more I wonder if we should switch these around. Here is my reasoning:

Tests Failed

Here, we would use a red heart. For a developer, this is a condition that needs their attention, because something they did is probably wrong and needs to be fixed. Therefore, it should be given the strongest color (red).

Build did not succeed

Here we would use yellow heart. This means that things are still not quite right, but it's not something that the developer did wrong, so we use a less-severe color.

Build succeeded

Still a green heart. :)

WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

A bit of context, the unstable/success/abort/failed status that I followed where based on the Jenkins build terminology (here and here)

I'm not saying it's clear though, neither we do need to implement it. Glad in fact you have suggested to review it.

There are certain use cases, we might need to consider:

  • What if a particular pipeline gets unstable for a non-critical but cosmetic linting?
  • What if a particular pipeline gets unstable if the JUnit/coverage reporting got over certain threshold?

OTOH, the unstable status is handled by the pipeline itself, in other words, it's up to the developer/build engineer to decide what the pipeline should do if a particular stage got a linting/warning issue, in some cases, the pipeline should fail fast, or should move forward, or should be reported as success.

Maybe the GH PR comment should be more generic to support other kind of CI tools in the future, and here we got the chance to normalise the status to be clear among all the projects.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the historical CI status indicators (provided by Jenkins) are more helpful to Jenkins administrators than they are to actual end users. I don't think too many developers know (or care) what an "unstable" build means, for example.

So, I agree that we can and should handle specific uses cases even better. If developers are used to seeing a green heart as "ready to merge" and any other status as "something that needs more investigation", then we can add more failure categories that can help a developer quickly glance at the output to see what's wrong.

I like the idea of the PR comment statuses being more generic and free of the implementation of the CI underneath. I think in doing so that we can give developers feedback that's more tailored to an action that they might need to take to get a PR in a merge-able state.

Copy link
Contributor

Choose a reason for hiding this comment

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

The Build did not succeed status will report two different things "failed" and "abort" that are really different things. the thing is, Do we want to keep it simple? we should use a binary result (whatever names we use), or Do we want to keep it fine-tune? so we add some intelligence to analyze the result and provide more explanatory messages.

Copy link
Member Author

@v1v v1v May 11, 2020

Choose a reason for hiding this comment

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

For simplicity I think we can get rid of the unstable status, and ensure the pipeline will always report the below three status:

  • 💚 success.
  • 💔 failed (either compilation or test failures) Therefore unstable will always behave as a failed.
  • aborted (either manually aborted, timeout issue or cancel by the new build, or CI approval required). Timeout could be potentially something to be reported differently, but for the time being, I'd say let's keep it simple.

Regarding the fine granularity, we could potentially use the build.description to gather further details, and therefore to expose it , for instance see #522 (comment)
In other words, the result analyser could be done as a post build action to gather what's the high level information to be provided to the PR.

@elastic/observablt-robots , what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Build and test errors are now reported as 💔

image

even when the tests are not blocking the build but reported as unstable:

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Big 👍 on these changes, @v1v . I think this strikes a really good balance! Nicely done! 💯

@elasticmachine
Copy link

elasticmachine commented May 11, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

Test stats 🧪

Test Results
Failed 9
Passed 1
Skipped 9
Total 19

Test errors

Expand to view the tests failures

  • Name: Check pre-commit / Check for case conflicts – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / Check for merge conflicts – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / Fix End of Files – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkabstractclassesandtrait – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkjsonslurperclass – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkunicodenonbreakingspaces – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / removeunicodenonbreakingspaces – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / checkendashes – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error
  • Name: Check pre-commit / removeendashes – pre_commit.lint

    • Status: FAILED
    • Age: 1
    • Duration: 0
    • Error Details: error

Log output

Expand to view the last 100 lines of log output

[2020-05-11T16:18:21.937Z] ++ find /Users/vmartinez/.cache/pre-commit -type d -name scripts
[2020-05-11T16:18:21.937Z] ++ grep .ci/scripts
[2020-05-11T16:18:21.937Z] + searchFile=/Users/vmartinez/.cache/pre-commit/repo4hr715vn/.ci/scripts
[2020-05-11T16:18:21.937Z] + '[' -e /Users/vmartinez/.cache/pre-commit/repo4hr715vn/.ci/scripts ']'
[2020-05-11T16:18:21.937Z] + export PATH=/Users/vmartinez/bin:/Users/vmartinez/bin:/usr/local/bin:/Users/vmartinez/.gvm/bin:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/Users/vmartinez/tools/.purse:/Users/vmartinez/bin:/Users/vmartinez/.sdkman/candidates/java/current/bin:/Users/vmartinez/.nvm/versions/node/v12.16.2/bin:/Users/vmartinez/.gvm/bin:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/Users/vmartinez/tools/.purse:/Users/vmartinez/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/vmartinez/Library/Python/2.7/bin:/Users/vmartinez/Library/Python/2.7/bin:/Users/vmartinez/.cache/pre-commit/repo4hr715vn/.ci/scripts
[2020-05-11T16:18:21.937Z] + PATH=/Users/vmartinez/bin:/Users/vmartinez/bin:/usr/local/bin:/Users/vmartinez/.gvm/bin:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/Users/vmartinez/tools/.purse:/Users/vmartinez/bin:/Users/vmartinez/.sdkman/candidates/java/current/bin:/Users/vmartinez/.nvm/versions/node/v12.16.2/bin:/Users/vmartinez/.gvm/bin:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/Users/vmartinez/tools/.purse:/Users/vmartinez/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/vmartinez/Library/Python/2.7/bin:/Users/vmartinez/Library/Python/2.7/bin:/Users/vmartinez/.cache/pre-commit/repo4hr715vn/.ci/scripts
[2020-05-11T16:18:21.937Z] + set -e
[2020-05-11T16:18:21.937Z] + git diff-tree --no-commit-id --name-only -r 8eef759fe16dd31bd1396eca6caeb2546b9f3f68
[2020-05-11T16:18:21.937Z] + xargs pre-commit run --files
[2020-05-11T16:18:21.937Z] + tee pre-commit.out
[2020-05-11T16:18:22.519Z] Check for case conflicts.................................................Passed
[2020-05-11T16:18:22.519Z] Check that executables have shebangs.................(no files to check)Skipped
[2020-05-11T16:18:22.519Z] Check JSON...........................................(no files to check)Skipped
[2020-05-11T16:18:22.519Z] Check for merge conflicts................................................Passed
[2020-05-11T16:18:22.519Z] Check Yaml...........................................(no files to check)Skipped
[2020-05-11T16:18:22.519Z] Check Xml............................................(no files to check)Skipped
[2020-05-11T16:18:22.787Z] Fix End of Files.........................................................Passed
[2020-05-11T16:18:22.788Z] Shellscript: lint....................................(no files to check)Skipped
[2020-05-11T16:18:22.788Z] Yaml: lint...........................................(no files to check)Skipped
[2020-05-11T16:18:22.788Z] check-bash-syntax....................................(no files to check)Skipped
[2020-05-11T16:18:22.788Z] check-abstract-classes-and-trait.........................................Passed
[2020-05-11T16:18:23.051Z] check-jsonslurper-class..................................................Passed
[2020-05-11T16:18:23.051Z] check-jenkins-pipelines..............................(no files to check)Skipped
[2020-05-11T16:18:23.051Z] - hook id: check-jenkins-pipelines
[2020-05-11T16:18:23.051Z] check-unicode-non-breaking-spaces........................................Passed
[2020-05-11T16:18:23.051Z] remove-unicode-non-breaking-spaces.......................................Passed
[2020-05-11T16:18:23.051Z] check-en-dashes..........................................................Passed
[2020-05-11T16:18:23.325Z] remove-en-dashes.........................................................Passed
[2020-05-11T16:18:23.325Z] check-jjbb...........................................(no files to check)Skipped
[2020-05-11T16:18:23.325Z] - hook id: check-jjbb
[2020-05-11T16:18:23.336Z] $ ssh-agent -k
[2020-05-11T16:18:23.343Z] unset SSH_AUTH_SOCK;
[2020-05-11T16:18:23.343Z] unset SSH_AGENT_PID;
[2020-05-11T16:18:23.343Z] echo Agent pid 33848 killed;
[2020-05-11T16:18:23.386Z] [ssh-agent] Stopped.
[2020-05-11T16:18:23.473Z] Archiving artifacts
[2020-05-11T16:18:23.489Z] Recording test results
[2020-05-11T16:18:28.463Z] Running in /tmp/workspace/mbp_PR-521/src/github.com/elastic/apm-pipeline-library
[2020-05-11T16:18:28.768Z] + ./mvnw clean compile --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
[2020-05-11T16:18:29.731Z] [INFO] Scanning for projects...
[2020-05-11T16:18:30.314Z] [WARNING] 
[2020-05-11T16:18:30.314Z] [WARNING] Some problems were encountered while building the effective model for co.elastic:jenkins-library:jar:1.1.96-SNAPSHOT
[2020-05-11T16:18:30.314Z] [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 138, column 15
[2020-05-11T16:18:30.314Z] [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ line 190, column 15
[2020-05-11T16:18:30.314Z] [WARNING] 
[2020-05-11T16:18:30.314Z] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[2020-05-11T16:18:30.314Z] [WARNING] 
[2020-05-11T16:18:30.314Z] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[2020-05-11T16:18:30.314Z] [WARNING] 
[2020-05-11T16:18:30.314Z] [INFO] 
[2020-05-11T16:18:30.314Z] [INFO] ---------------------< co.elastic:jenkins-library >---------------------
[2020-05-11T16:18:30.314Z] [INFO] Building APM Pipeline Shared Library 1.1.96-SNAPSHOT
[2020-05-11T16:18:30.314Z] [INFO] --------------------------------[ jar ]---------------------------------
[2020-05-11T16:18:30.858Z] [INFO] 
[2020-05-11T16:18:30.858Z] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jenkins-library ---
[2020-05-11T16:18:30.858Z] [INFO] 
[2020-05-11T16:18:30.858Z] [INFO] --- maven-enforcer-plugin:3.0.0-M2:display-info (display-info) @ jenkins-library ---
[2020-05-11T16:18:30.858Z] [INFO] Maven Version: 3.5.4
[2020-05-11T16:18:30.858Z] [INFO] JDK Version: 1.8.0_242 normalized as: 1.8.0-242
[2020-05-11T16:18:30.858Z] [INFO] OS Info: Arch: x86_64 Family: mac Name: mac os x Version: 10.15.4
[2020-05-11T16:18:30.858Z] [INFO] 
[2020-05-11T16:18:30.858Z] [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (display-info) @ jenkins-library ---
[2020-05-11T16:18:30.858Z] [INFO] 
[2020-05-11T16:18:30.858Z] [INFO] --- groovy-eclipse-compiler:2.9.2-01:add-groovy-build-paths (default-add-groovy-build-paths) @ jenkins-library ---
[2020-05-11T16:18:30.858Z] [INFO] Adding /src/main/groovy to the list of source folders
[2020-05-11T16:18:30.858Z] [INFO] Adding /src/test/groovy to the list of test source folders
[2020-05-11T16:18:30.858Z] [INFO] 
[2020-05-11T16:18:30.858Z] [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ jenkins-library ---
[2020-05-11T16:18:31.121Z] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[2020-05-11T16:18:31.121Z] [INFO] Copying 27 resources
[2020-05-11T16:18:31.121Z] [INFO] 
[2020-05-11T16:18:31.121Z] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jenkins-library ---
[2020-05-11T16:18:31.121Z] [INFO] No sources to compile
[2020-05-11T16:18:31.121Z] [INFO] 
[2020-05-11T16:18:31.121Z] [INFO] --- gmavenplus-plugin:1.7.1:compile (default) @ jenkins-library ---
[2020-05-11T16:18:31.387Z] [INFO] No sources specified for compilation. Skipping.
[2020-05-11T16:18:31.387Z] [INFO] ------------------------------------------------------------------------
[2020-05-11T16:18:31.387Z] [INFO] BUILD SUCCESS
[2020-05-11T16:18:31.387Z] [INFO] ------------------------------------------------------------------------
[2020-05-11T16:18:31.387Z] [INFO] Total time: 1.574 s
[2020-05-11T16:18:31.387Z] [INFO] Finished at: 2020-05-11T17:18:31+01:00
[2020-05-11T16:18:31.387Z] [INFO] ------------------------------------------------------------------------
Post stage
[2020-05-11T16:18:33.034Z] Archiving artifacts
[2020-05-11T16:18:33.199Z] ‘${BASE_DIR}/**/mail-out-test*.html’ doesn’t match anything: even ‘${BASE_DIR}’ doesn’t exist
[2020-05-11T16:18:33.199Z] No artifacts found that match the file pattern "${BASE_DIR}/**/mail-out-test*.html". Configuration error?
[2020-05-11T16:18:33.213Z] Recording test results
[2020-05-11T16:18:33.223Z] None of the test reports contained any result
[2020-05-11T16:18:35.369Z] Running in /tmp/workspace/mbp_PR-521/src/github.com/elastic/apm-pipeline-library
[2020-05-11T16:18:35.486Z] Declarative Pipeline file '.ci/Jenkinsfile' is valid.
[2020-05-11T16:18:35.528Z] Declarative Pipeline file '.ci/buildBeatsDockerImages.groovy' is valid.
[2020-05-11T16:18:35.588Z] Declarative Pipeline file '.ci/buildDockerImages.groovy' is valid.
[2020-05-11T16:18:35.624Z] Declarative Pipeline file '.ci/dockerImagesOpbeans.groovy' is valid.
[2020-05-11T16:18:35.648Z] Declarative Pipeline file '.ci/schedule-daily.groovy' is valid.
[2020-05-11T16:18:35.669Z] Declarative Pipeline file '.ci/schedule-weekly.groovy' is valid.
[2020-05-11T16:18:35.747Z] Declarative Pipeline file 'resources/JenkinsfileTemplate.groovy' is valid.
Stage "Release" skipped due to when conditional
[2020-05-11T16:18:37.702Z] Running on Jenkins in /var/jenkins_home/workspace/mbp_PR-521
[2020-05-11T16:18:37.731Z] [INFO] getVaultSecret: Getting secrets
[2020-05-11T16:18:37.754Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID

## :grey_exclamation: Build Aborted
${(build?.description?.toLowerCase()?.contains('aborted')) ? '> There is a new build on-going so the previous on-going builds have been aborted.' : ' > Either there was a build timeout or someone aborted the build.'}
<%} else {%>
## :broken_heart: ${(testsSummary?.failed != 0) ? 'Tests Failed' : 'Build Failed'}
Copy link
Member Author

Choose a reason for hiding this comment

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

unstable and failed builds are equally the same, the only difference might be if there are failed tests, and if so the icon will remain for both but the description will be more accurate

@@ -6,10 +6,10 @@
"href": "/blue/rest/organizations/jenkins/pipelines/apm-shared/pipelines/apm-apm-pipeline-library-mbp/pipelines/develop/runs/49/blueTestSummary/"
}
},
"existingFailed": 1,
"failed": 1,
"existingFailed": 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

Test reporting does require this file with the failed tests, therefore it's required another file for testing purposes

v1v added 3 commits May 12, 2020 10:08
…orting

* upstream/master:
  ci: CI approval aborted rather than failed (#522)
  ci: avoid template when no PRs (#526)
  test: move to apm-ci folder (#524)
  test: use a different port (#523)
…-library into feature/abort-reporting

* 'feature/abort-reporting' of github.com:v1v/apm-pipeline-library:
Comment on lines +5 to +11
<%if (build?.description?.toLowerCase()?.contains('aborted')) {%>
> There is a new build on-going so the previous on-going builds have been aborted.
<%} else if (build?.description?.toLowerCase()?.contains('allowed')) {%>
> ${build.description}
<%} else {%>
> Either there was a build timeout or someone aborted the build.'}
<%}%>
Copy link
Member Author

Choose a reason for hiding this comment

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

Identify the reason of the aborted build using the build description field.

@v1v v1v merged commit 022adf0 into elastic:master May 12, 2020
@v1v v1v deleted the feature/abort-reporting branch May 12, 2020 09:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[notifications] If build gets aborted then what to do?
7 participants