Is it possible to amend a failing build on Travis-CI - travis-ci

I submitted this pull request and the Travis-CI build failed.
I pushed another commit to fix the failing test and the second build failed.
I posted this comment asking why is it falling (I could not reproduce locally and I noticed this failure on other pull requests).
One day after I posted this comment I noticed that the build status is passing and the failing job which I linked to shows that the job finished successfully.
When I look in the pull request build history I notice my first failing build and my second build which it now says it passed.
But I cannot find my second failing build.
Can anyone explain how something like this can happen?
Is there any way to find and see that failing build?

Unfortunately, when you restart a build on Travis CI, the previous build log is lost at the moment.
It's possible that the build failure is intermittent hence restarting the build might make it fail again.

Related

Changes since last successful build does not work in Jenkins after installation

I have installed- https://plugins.jenkins.io/changes-since-last-success/ in my jenkins. But now, when my build has failed then the commits done for that particular build are not visible in the next successful build.
I can't see this changes since last success option in UI-
Am I required to do anything else other than this plugin installation. I mean do I have to perform any configuration to use it or make it work?
Your answer will help me a lot.

Jenkins Builds Failing - Failed to connect to repo

Let me begin by stating this entire process was set up by a former employee. I understand how to use Jenkins and set up new items, but that is about the extent of my knowledge. Everything has been working fine for years, but about a month ago all builds started failing.
When looking at the configuration for each job I see this message:
Comparing the console output from successful builds to that of failed builds I also notice some differences. I do not know what they mean though.
A successful build:
Then a few days later the same job failed to build. I do think there were plugin updates or something done in between.
Can anyone help me solve this to get our development flow back up and working properly? When files are pushed from Bitbucket it automatically kicks off a Jenkins build which pulls the files into our staging server. Since Jenkins is not working correctly I have to manually FTP any new files to our staging server which takes a lot of time.
It seems that you are missing the credentials for the Github repository.
Jenkins as extensive documentation on how you can add a credential secret:
https://www.jenkins.io/doc/book/using/using-credentials/
Here is a simple tutorial for it:
https://www.thegeekstuff.com/2016/10/jenkins-git-setup/#:~:text=Setup%20Jenkins%20Credentials%20for%20Git&text=To%20add%20a%20credential%2C%20click,Use%20default.

bitbucket-build-status-notifier plugin for jenkins reports wrong status

Jenkins should notify bitbucket if a job that is linked to a branch has passed or falied, and it does:
But for some reason, in the branch view, it doesn't notify about the result of the last build, and says it failed even if the last build has passed:
How do I make it refer to the result of the last build only?
Today it was released a new version of the plugin for jenkins bitbucket-build-status-notifier which allows exactly what you need to avoid the problem you describe. It's new config option "Only show latest build status", just ensure this checkbox is checked and enjoy it.
Hi I'm the maintainer of the bitbucket-build-status-notifier for Jenkins. Actually the plugin creates a new build status for every jenkins build execution for a given commit. That means that if you exec a build for a given commit id and it failed and later exec a new build for the same commir id and success, both status success and failed will remain in bitbucket, that's find and not an issue. Anyways I understand your problem or desires and you are not the only one since there's already a issue
for solving it.
At the moment I've not much time for developing this new features but I'll do it as soon as possible.

Jenkins automation

Is there any way in jenkins where as soon as we detect the failed build, job revert back the perforce code to the last successful build changelist and fire a build again.
Flow -
1. so as soon as we have failed build - Notifcation will be sent out to dev team with possible checkins which causing the build failure
Revert back the recent code to the last working code and submit it
Initiate a build.
It is possible, but I don't see any reasons or use case to do it as it is not a correct workflow and can be confusing.
But if you decided to do it, the next steps are required:
Example how to do it using Perforce source control.
Steps inside job settings:
Before build triggers you need to save latest changelist number $P4_CHANGELIST - 1
Perforce plugin for Jenkins: Perforce plugin for Jenkins
Build
Get last error code
Get last error code from the: batch
If code != 0 then checkout and build changelsit $P4_CHANGELIST - 1
Jenkins is not a production server. It runs tasks and do not have options that I know for that purpose.
What is your source code ? webapps ? others ?
What steps are you performing ?
Are you performing some automatic tests ?
My assumption is that you got some tests that may invalidate the build.
These tests should be runned :
* on a mock server to prevent deploying on your server
* or somewhere else
Like that, if build failed, nothing is deployed.
If build success, you can deploy your project normally.
If this not reply to your answer, please provide requested information to undestrand a bit more your job process.
If your using an artifact repository like Nexus or Artifactory to manage your project artifacts then you could always redeploy the previous working version of your application when a failure is detected.
Your not cancelling any checked in code that potentially broke the build but you are preserving your test environment. You can configure Jenkins to notify the user who checked in the latest erroneous change set and they can work on resolving the issue.
Jenkins also provides a rich API which allows you to delete a job, start a job, get information about previously run jobs. You could leverage some of these services along with your artifact repo to achieve the experience you described.

How to clean up Jenkins job so build stability is not affected

How would someone clean up a Jenkins job such that the build stability rating is reset and not affected by previous builds? I created a build job and through trial and error, I finally got the job to compile/build correctly. However, I don't want all the previous test builds to affect the build stability rating. I tried deleting all the builds and restarting Jenkins but it still says 20 of the last 25 builds failed. I looked in the $JENKINS_HOME directory (~/.jenkins) and couldn't find anything regarding build stability. Thanks.
When you configure the job you can tell it how long to keep the logs for - either days or build. Set this to one build to clear it out then reset it back again

Resources