Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 377666 - test and fix "no changes detected" parts of build scripts
Summary: test and fix "no changes detected" parts of build scripts
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Releng (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.2 RC1   Edit
Assignee: David Williams CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 376229 376460 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-25 12:35 EDT by David Williams CLA
Modified: 2012-05-13 13:41 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2012-04-25 12:35:25 EDT
During milestone week, with 3 builds scheduled, per day, there are occasionally times when in fact no changes have been made, so the build should not run. 

That part of our automated script likely needs work. The mail message part is, I think, in place, but untested. 

The part that needs work is the "reference" tag we use during auto-tagging step. 

As it is now, we set the old (previous) ID, compute what the new one should be (if changes are found) and then put that into the property file to use for the next run as the old (previous) ID -- and then we run the auto-tagging script and that's when we'd discover no changes were detected, and send out the mail, and not do a build with no changes. 

The questionable point in those steps is that the property file with old/previous build ID will be inaccurate. 

I'm not exactly sure what the effects will be on the next round of auto-tagging, but ... doesn't seem like it would know that to accurately compare to. So ... should at least test and/or add script to "roll back" the "old build tag" if no changes were found.
Comment 1 David Williams CLA 2012-04-30 17:26:16 EDT
I've moved the code to update the Ibuild.properties file (which essentially holds the current build number, so for the next build, it will be the previous build number) to the end of the masterBuilder script. That will prevent update if there is no build, and, will also prevent update if the build fails for unexpected reasons. (as it did for the git check out failure today). 

I think more is needed here, but that's move if one step.
Comment 2 David Williams CLA 2012-05-13 12:57:09 EDT
I've enabled the "real" email and logic now. 

And, in the course of this, and trying to get test automation running, I have realized sometimes we will want a "real build", even though no changes detected, since there could be changes in infrastructure or the builder itself that would require it, so the variable 
continueBuildOnNoChange
will be mentioned in some messages (when it is set to true). 


FYI, the code "around" all this logic is fairly spaghetti-ish but, will leave that clean/up refactoring to another day/bug.
Comment 3 David Williams CLA 2012-05-13 12:59:23 EDT
*** Bug 376229 has been marked as a duplicate of this bug. ***
Comment 4 David Williams CLA 2012-05-13 13:00:55 EDT
*** Bug 376460 has been marked as a duplicate of this bug. ***
Comment 5 David Williams CLA 2012-05-13 13:16:15 EDT
Well, sort of worked. 

But, message "subject" was wrong. This part:

No changes from previous build were detected, but continueBuildOnNoChange was set to true.

Was supposed to be in the body of message ... not the subject line. 

I'll need to see what's different form other examples? 
Maybe need an empty line to terminate subject?
Comment 6 David Williams CLA 2012-05-13 13:25:06 EDT
In the one "sendmail" that has been working, the "Subject: " is followed by a variable, then a blank line. That's only difference I see between it, and the new messages, so will just try using a variable ... instead of understanding it :/ 


    (
    echo "From: e4Builder@eclipse.org"
    echo "To: ${toAddress}"
    echo "MIME-Version: 1.0"
    echo "Content-Type: text/plain; charset=utf-8"
    echo "Subject: $buildsubject"
    echo " "
    echo "$eclipseStream Build: $buildId started"
    echo " "
    echo "   Report of changes based on comparaison to" 
    echo "   previous build or tag of $oldBuildTag"
    echo " "
    echo "$reporttext" 
    echo " "
    ) | /usr/lib/sendmail -t


        (
        echo "From: e4Builder@eclipse.org"
        echo "To: ${toAddress}"
        echo "MIME-Version: 1.0"
        echo "Content-Type: text/plain; charset=utf-8"
        echo "Subject: $eclipseStream Build: $buildId started."
        echo " "
        echo " No changes from previous build were detected, but "
        echo " continueBuildOnNoChange was set to true."
        echo " "
        ) | /usr/lib/sendmail -t
Comment 7 David Williams CLA 2012-05-13 13:41:25 EDT
Maybe needed escaped quotes for something in second case, but ... if the variable works, I'm happy. 

I've made that change (to use variable) and will closed as "fixed" ... the opportunity to see this "no changes but continuing anyway" will be rare.