[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST 2/5] Handle osstest's own local push gate in non-master production instances



We want to arrange that the master XenProject instance continues to
test its own pretest branch while any downstream instances will pickup
changes from the master instance's production (i.e. tested) branch,
which is published at git://xenbits.xen.org/osstest.git#master.

Add a new configuration option OsstestUpstream which by default is
"git://xenbits.xen.org/osstest.git master" and which is cleared to
nothing on the master instance via production-config.

If the option is not set then the existing behaviour is unchanged.

If the option is set then osstest branch flights proceed by merging,
the referenced branch into the local pretest branch and testing the
result.

This must be done:
 - in a clone not in the main testing.git in order to avoid inserting
   merge conflict markers into the active set of scripts.
 - in a non-bare repo because git merge requires it.

$repos/osstest is a bare repo which we want to keep that way because
using repo_tree_rev_fetch_git to fetch the remote branch is
convenient.

So we use $repos/osstest-merge as a temporary merge repo and reclone
from the active local repo each time.

All of this happens in ap-fetch version which also fetches the result
into FETCH_HEAD into the active repo (the one running the test), such
that the existing hard reset in cr-daily-branch can find the commit.

If the merge fails then manual intervention (i.e. a manual merge and
push to the _local_ pretest) will be required.

In ap-push we stop pushing to xenbits#master except for the master
instance if an upstream is defined. At some point it might be useful
to add a configuration option for where to push to but I don't have
that requirement right now.

ap-fetch-version-old requires no changes.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 Osstest.pm        |  2 ++
 ap-common         |  3 +++
 ap-fetch-version  | 19 ++++++++++++++++++-
 ap-push           |  8 +++++++-
 production-config |  2 ++
 5 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/Osstest.pm b/Osstest.pm
index 7989129..7f72bc6 100644
--- a/Osstest.pm
+++ b/Osstest.pm
@@ -102,6 +102,8 @@ sub readglobalconfig () {
     return if $readglobalconfig_done;
     $readglobalconfig_done=1;
 
+    $c{OsstestUpstream} = 'git://xenbits.xen.org/osstest.git master';
+
     $c{HostProp_DhcpWatchMethod} = 'leases dhcp3 infra:5556';
     $c{AuthorizedKeysFiles} = '';
     $c{AuthorizedKeysAppend} = '';
diff --git a/ap-common b/ap-common
index 64749e3..fadeb2b 100644
--- a/ap-common
+++ b/ap-common
@@ -21,6 +21,8 @@
 
 : ${XENBITS:=osstest@xxxxxxxxxxxxxxx}
 
+: ${TREEBRANCH_OSSTEST_UPSTREAM=`getconfig OsstestUpstream`}
+
 : ${TREE_XEN:=git://xenbits.xen.org/xen.git}
 : ${PUSH_TREE_XEN:=$XENBITS:/home/xen/git/xen.git}
 
@@ -76,6 +78,7 @@ fi
 : ${TREE_LINUX2639:=${KERNEL_SCM}/konrad/xen.git}
 : ${TAG_LINUX2639:=stable/2.6.39.x}
 
+: ${LOCALREV_OSSTEST:=daily-cron.$branch}
 : ${LOCALREV_XEN:=daily-cron.$branch}
 : ${LOCALREV_LINUX:=daily-cron.$branch}
 : ${LOCALREV_LIBVIRT:=daily-cron.$branch}
diff --git a/ap-fetch-version b/ap-fetch-version
index 33aaf00..efd3139 100755
--- a/ap-fetch-version
+++ b/ap-fetch-version
@@ -90,7 +90,24 @@ ovmf)
                $TREE_OVMF_UPSTREAM master $LOCALREV_OVMF
        ;;
 osstest)
-       if [ "x$OSSTEST_USE_HEAD" != "xy" ] ; then
+       if [ x"$TREEBRANCH_OSSTEST_UPSTREAM" != x ] ; then
+           OSSTEST_REVISION_MERGE=`repo_tree_rev_fetch_git osstest \
+               $TREEBRANCH_OSSTEST_UPSTREAM $LOCALREV_OVMF`
+           echo >&2 "$TREEBRANCH_OSSTEST_UPSTREAM = $OSSTEST_REVISION_MERGE"
+
+           rm -rf $repos/osstest-merge >&2
+           git clone -b pretest $HOME/testing.git $repos/osstest-merge >&2
+
+           git -C $repos/osstest-merge \
+               fetch $repos/osstest $LOCALREV_OVMF:ap-merge >&2
+           git -C $repos/osstest-merge merge --no-edit \
+               -m "Automerge of $TREEBRANCH_OSSTEST_UPSTREAM into pretest" \
+               ap-merge >&2
+
+           # cr-daily-branch will reset the local tree to this version.
+           git fetch $repos/osstest-merge pretest
+           git rev-parse FETCH_HEAD^0
+       elif [ "x$OSSTEST_USE_HEAD" != "xy" ] ; then
            git fetch $HOME/testing.git pretest:ap-fetch >&2
             git rev-parse ap-fetch^0
        else
diff --git a/ap-push b/ap-push
index c141464..5967b42 100755
--- a/ap-push
+++ b/ap-push
@@ -99,7 +99,13 @@ ovmf)
        ;;
 osstest)
        git push $HOME/testing.git $revision:production
-       git push $XENBITS:/home/xen/git/osstest.git $revision:master
+       if [ x"$TREEBRANCH_OSSTEST_UPSTREAM" != x ] ; then
+           # could push to instance specific location, but
+           # certainly not to master instance's xenbits repo!
+           :
+       else
+           git push $XENBITS:/home/xen/git/osstest.git $revision:master
+       fi
        ;;
 *)
        echo >&2 "branch $branch ?"
diff --git a/production-config b/production-config
index 2ffefdd..9983025 100644
--- a/production-config
+++ b/production-config
@@ -15,6 +15,8 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# This is the master instance, therefore it has no upstream
+OsstestUpstream ''
 
 JobDB Executive
 HostDB Executive
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.