Skip to content
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

Handle NOT_BUILT results more clearly #63

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

mattiasbpersson
Copy link
Contributor

@mattiasbpersson mattiasbpersson commented Mar 8, 2023

Jenkins job that have Result NOT_BUILT are reported as errors which confuses developers.

Context for NOT_BUILT: jenkinsci/workflow-job-plugin#200

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Copy link
Member

@justusbunsi justusbunsi left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. Sorry for not getting it done earlier. In general, this works. However, I noticed an odd behavior regarding the NOT_BUILT state in different build contexts. Nothing that blocks the merge - but maybe good to handle at some point in the future.
Given the following pipeline, the superseded build will either result in NOT_BUILT or ABORTED when a new build is triggered.

pipeline {
  agent any
  options {
    disableConcurrentBuilds(abortPrevious: true)
  }
  stages {
    stage('test') {
      steps {
         sleep 30
         input 'wait'
      }
    }
  }
}

In case the sleep is still running, the result will be NOT_BUILT and the commit has a "warning" status check.

[Pipeline] sleep
Sleeping for 30 Sekunden
Superseded by #15
[Pipeline] End of Pipeline
[Gitea] Notifying pull request build status: WARNING This commit was not built
[Gitea] Notified
Finished: NOT_BUILT

In case the build already awaits user interaction, the result will be ABORTED. So the status check will still be the "fatal build error".

[Pipeline] sleep
Sleeping for 30 Sekunden
[Pipeline] input
wait
Proceed or Abort
Superseded by #16
[Pipeline] End of Pipeline
Rejected by SYSTEM
[Gitea] Notifying pull request build status: ERROR Something is wrong with the build of this commit
[Gitea] Notified
Finished: ABORTED

@justusbunsi
Copy link
Member

@lafriks I suggest we merge #78 before this.

@justusbunsi justusbunsi merged commit 4618c82 into jenkinsci:master Jul 3, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants