devtest -c with --offline and specific DIB_REPOREF_<project>'s fails if cache is older than refs

Bug #1301435 reported by stephen mulcahy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Expired
Medium
Unassigned

Bug Description

Hopefully not the worst bug summary ever

Scenario

1. run devtest.sh --trash-my-machine on Monday
2. on Tuesday, export DIB_REPOREF_<project> e.g. DIB_REPOREF_cinder to a SHA1 that I want to use in my next devtest run (a SHA1 that didn't exist when I ran devtest.sh on Monday).
3. ~/.cache/tripleo/overcloud-control.qcow2 (because I want to rebuild this)
4. run devtest.sh --trash-my-machine -c (with export DIB_COMMON_ELEMENTS="... --offline ..."

It will fail with an unknown ref error when refreshing

Updating cache of http://git.openstack.org/openstack/cinder in /home/smulcahy/.cache/image-create/source-repositories/cinder_637f286880ed8db5fda9cb38d33f8a4133ab1599 with ref 429445d97b292aad63b8ffec6e47555b7cabd0d0
error: no such remote ref 429445d97b292aad63b8ffec6e47555b7cabd0d0

Revision history for this message
stephen mulcahy (stephen-mulcahy) wrote :

Looking at diskimage-builder/elements/source-repositories/extra-data.d/98-source-repositories the problematic section seems to be

               HAS_REF=$(git --git-dir=$CACHE_PATH/.git name-rev $REPOREF 2>/dev/null || true)
                if [ -z "$DIB_OFFLINE" -o -z "$HAS_REF" ] ; then
                    echo "Updating cache of $REPOLOCATION in $CACHE_PATH with ref $REPOREF"
                    git --git-dir=$CACHE_PATH/.git fetch --update-head-ok $REPOLOCATION ${REPOREF}:${REPOREF}
                fi

changing

                    git --git-dir=$CACHE_PATH/.git fetch --update-head-ok $REPOLOCATION ${REPOREF}:${REPOREF}
to
                    git --git-dir=$CACHE_PATH/.git fetch --update-head-ok $REPOLOCATION

eliminates this error - while this may make the fetch more extensive, and slightly slower, given its only updating cached repos and the other approach results in errors, I think the fix is preferable

Changed in tripleo:
status: New → Confirmed
Changed in tripleo:
assignee: nobody → Jon-Paul Sullivan (jonpaul-sullivan)
Dan Prince (dan-prince)
Changed in tripleo:
importance: Undecided → Medium
Revision history for this message
Jon-Paul Sullivan (jonpaul-sullivan) wrote :

That fix will work for sha1's, but will not work for master.

Looking to see what we can do to resolve that and solve for both use-cases.

Revision history for this message
Jon-Paul Sullivan (jonpaul-sullivan) wrote :

A general solution may be to fetch all of the remote branches and make them local branches, as follows:

git --git-dir=$CACHE_PATH/.git fetch --update-head-ok $REPOLOCATION +refs/heads/*:refs/heads/*

This is the fix I will propose.

Revision history for this message
Robert Collins (lifeless) wrote :

The general solution fails for gerrit, which is a key use case for this - I've opened a new bug about the regression.

Revision history for this message
Brent Eagles (beagles) wrote :

This seems like it is probably no longer relevant.

Changed in tripleo:
status: Confirmed → Incomplete
Revision history for this message
Emilien Macchi (emilienm) wrote :

This bug is > 365 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in tripleo:
assignee: Jon-Paul Sullivan (jonpaul-sullivan) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for tripleo because there has been no activity for 60 days.]

Changed in tripleo:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.