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

Investigate skipping build if no changes #678

Open
akurtakov opened this issue Nov 20, 2022 · 6 comments
Open

Investigate skipping build if no changes #678

akurtakov opened this issue Nov 20, 2022 · 6 comments

Comments

@akurtakov
Copy link
Member

Today's build https://download.eclipse.org/eclipse/downloads/drops4/I20221119-1800/ contains no changes as per https://download.eclipse.org/eclipse/downloads/drops4/I20221119-1800/gitLog.php :

Git log from I20221119-0600 (previous) to I20221119-1800 (current)
The tagging, and this report, were done at about 20221119-1806

It would be nice to investigate whether such builds can be skipped with "No changes thus no I20221119-1800 build" mail sent.

@akurtakov
Copy link
Member Author

@SDawley take a look and evaluate how much that would cost. If not too costy it's worth saving some effort.

@sravanlakkimsetti
Copy link
Member

This is actually a very good idea. There are couple of places where we can deduce the changes

  1. git commit -m "Build input for build $BUILD_ID"
    at this place if there is no new commit created that means there are no changes in any of the source repositories
  2. this is the place we create gitLog. If we detect no changes we can exit from here.

@HannesWell
Copy link
Member

This is actually a very good idea. There are couple of places where we can deduce the changes

That's right. But at the same time it should be considered if the previous build succeeded or not.
E.g. imagine a case where the infrastructure is flaky and an I-build failed for an external reason. If one then just restarts the build, it's not desired that exits early because no code changes happened in the meantime.

@laeubi
Copy link
Contributor

laeubi commented Dec 6, 2024

Maybe one can just have one Job that check if something has changed once a day and then triggers the actual ibuild (and let the ibuild only be triggered manually or by this job)

@HannesWell
Copy link
Member

Maybe one can just have one Job that check if something has changed once a day and then triggers the actual ibuild (and let the ibuild only be triggered manually or by this job)

Sounds good to me. In general this should be easily achievable using the pollSCM trigger:
https://www.jenkins.io/doc/book/pipeline/syntax/#triggers

But I fear that doesn't consider submodules, does it?

@HannesWell
Copy link
Member

This is actually a very good idea. There are couple of places where we can deduce the changes

That's right. But at the same time it should be considered if the previous build succeeded or not. E.g. imagine a case where the infrastructure is flaky and an I-build failed for an external reason. If one then just restarts the build, it's not desired that exits early because no code changes happened in the meantime.

Actually the build could only be aborted on no changes, if the build was triggered by the cron-trigger, which can be checked for example as suggested in: https://stackoverflow.com/a/56151318
There is even a built-in triggeredBy condition for when{ }: https://www.jenkins.io/doc/book/pipeline/syntax/#when

With that combination I think everything should be as desired. I can have a look in implementing it accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants