Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: gce/uploader_iteration.sh

Issue 1370443006: [chrome-devtools-frontend] Updates after Blink+Chromium merge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chrome-devtools-frontend
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gce/uploader_bisect_helper.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gce/uploader_iteration.sh
diff --git a/gce/uploader_iteration.sh b/gce/uploader_iteration.sh
index a9ac7412e8c6d37bcf9ee10d533ca29ce9c85dfa..236b7e9d463b246da4219e5539a954ecf21e77e9 100755
--- a/gce/uploader_iteration.sh
+++ b/gce/uploader_iteration.sh
@@ -30,8 +30,11 @@ cd "$SOURCE_DIR"
mark_step 'Updating chromium'
unlock_git_repo Chromium || exit $EXIT_CHROMIUM_UPDATE
-git reset --hard master || exit $EXIT_CHROMIUM_UPDATE
-git pull || exit $EXIT_CHROMIUM_UPDATE
+git bisect reset || exit $EXIT_CHROMIUM_UPDATE
+git reset --hard || exit $EXIT_CHROMIUM_UPDATE
+git clean -df || exit $EXIT_CHROMIUM_UPDATE
+git checkout master || exit $EXIT_CHROMIUM_UPDATE
+git pull origin || exit $EXIT_CHROMIUM_UPDATE
CHROMIUM_GYP_REVISION="$(cat DEPS | $SCRIPT_DIR/uploader_helper.py --find_project_revision='src/tools/gyp')"
mark_step 'Updating gyp'
@@ -41,15 +44,48 @@ git fetch || exit $EXIT_GYP_UPDATE
git reset --hard $CHROMIUM_GYP_REVISION || exit $EXIT_GYP_UPDATE
popd
-mark_step 'Getting the last Blink revision for which the frontend has been uploaded'
+# The commits where LASTCHANGE.blink got fixed. All branches after the Blink merge
+# should use the same as for master branch, but branches for M45 and M46 have
+# their own commits.
+mark_step 'Figuring out the list of branches'
+declare -A FIRST_GOOD_COMMITS_AFTER_MERGE=(
+ ["master"]=f880f0071d47ec1aa9608245222ad0b6f350e48c
+ ["branch-heads/2454"]=2d9701ab99b7de44897c731ff8f16dafb8fd7834
+ ["branch-heads/2490"]=9a2f5e019e324fab91c29681c18937c4435c309b
+)
+# Special branches.
+BRANCHES_LIST="master branch-heads/2454 branch-heads/2490"
+# Get a list of branches that were branched after the "first good commit"
+# (post-merge) on master. This can take a lot of time, unfortunately,
+# because the number of branches is excessive.
+BRANCHES_LIST="$BRANCHES_LIST $(git branch -r --contains ${FIRST_GOOD_COMMITS_AFTER_MERGE[master]} --list 'branch-heads/*')"
+
+mark_step 'Getting the list of commits to upload'
GS_PATH=gs://chrome-devtools-frontend
KNOWN_REVISIONS_DIR="$GS_PATH/revs"
-ALL_UPLOADED_REVS=$(gsutil ls "$KNOWN_REVISIONS_DIR") || exit $EXIT_LAST_UPLOADED_BLINK_REV
-LAST_BLINK_REVISION=$(echo "$ALL_UPLOADED_REVS" | sed -e "s#^$KNOWN_REVISIONS_DIR/@##" | sort -nr | head -n 1)
-if [ -z "$LAST_BLINK_REVISION" ]; then
- exit $EXIT_LAST_UPLOADED_BLINK_REV
-fi
-echo "Last uploaded was for Blink revision $LAST_BLINK_REVISION"
+REVISION_LIST=""
+for BRANCH in $BRANCHES_LIST; do
+ echo "Branch $BRANCH"
+ # Use bisect to find the first not yet uploaded commit.
+ # First, make sure that master hasn't been uploaded and thus is "bad",
+ # otherwise bisect will be confused.
+ if gsutil ls "$KNOWN_REVISIONS_DIR/@$(git rev-parse $BRANCH)"; then
+ echo "On $BRANCH no new commits since the last upload"
+ else
+ FIRST_GOOD=${FIRST_GOOD_COMMITS_AFTER_MERGE["$BRANCH"]}
+ if [ -z "$FIRST_GOOD" ]; then
+ FIRST_GOOD=${FIRST_GOOD_COMMITS_AFTER_MERGE["master"]}
+ fi
+ git bisect start --no-checkout $BRANCH $FIRST_GOOD || exit $EXIT_LAST_UPLOADED_BLINK_REV
+ git bisect run sh -c "$SCRIPT_DIR/uploader_bisect_helper.sh $KNOWN_REVISIONS_DIR/@" || exit $EXIT_LAST_UPLOADED_BLINK_REV
+ # BISECT_HEAD now points to the last "good" commit.
+ # There is some kind of a side effect, we need to retrieve it first.
+ git rev-parse BISECT_HEAD
+ # Get the list of all "bad" commits, starting from the oldest commit.
+ REVISION_LIST="$REVISION_LIST $(git rev-list --reverse $BRANCH ^BISECT_HEAD)"
+ git bisect reset || exit $EXIT_LAST_UPLOADED_BLINK_REV
+ fi
+done
mark_step 'Getting Blink revisions blacklist'
BLINK_REVISIONS_BLACKLIST_FILE=$GS_PATH/blink_revisions_blacklist
@@ -58,17 +94,6 @@ if gsutil ls "$BLINK_REVISIONS_BLACKLIST_FILE"; then
BLINK_REVISIONS_BLACKLIST=$(gsutil cat "$BLINK_REVISIONS_BLACKLIST_FILE")
fi
-mark_step 'Working out SVN revisions list'
-pushd third_party/WebKit
-git fetch || exit $EXIT_BLINK_UPDATE
-HEAD_BLINK_REVISION=$(git log -n 1 --all --grep="git-svn-id:" --pretty=medium | grep -Po "git-svn-id:[^@]*@\d+" | grep -Po "@\d+" | grep -Po "\d+")
-popd
-echo "Last committed was Blink revision $HEAD_BLINK_REVISION"
-REVISION_LIST=$(seq $[LAST_BLINK_REVISION+1] $HEAD_BLINK_REVISION)
-if [ -z "$REVISION_LIST" ]; then
- exit $EXIT_NO_UPDATED_BRANCHES
-fi
-
mark_step 'Building DevTools frontend for revisions and uploading to Cloud Storage'
for REVISION in $REVISION_LIST; do
LOCAL_STORAGE_DIR=/uploader/storage
@@ -86,19 +111,14 @@ for REVISION in $REVISION_LIST; do
continue
fi
- pushd third_party/WebKit
- REVISION_COMMIT=$(git log -n 1 --all --grep="git-svn-id:[^@]*@$REVISION" --pretty=oneline | awk '{ print $1; }')
- if [ -z "$REVISION_COMMIT" ]; then
- echo "@$REVISION ==> missing!"
- popd
- continue
- fi
- echo "@$REVISION ==> $REVISION_COMMIT"
- unlock_git_repo Blink || exit $EXIT_BLINK_UPDATE
- git reset --hard $REVISION_COMMIT || exit $EXIT_BLINK_UPDATE
+ echo "Processing $REVISION"
+ git reset --hard || exit $EXIT_BLINK_UPDATE
+ git clean -df || exit $EXIT_BLINK_UPDATE
+ git checkout $REVISION || exit $EXIT_BLINK_UPDATE
# Exclude "trunk" to work around branches that accidentally have a second
# copy of Blink sources inside it. See http://crbug.com/450975
+ pushd third_party/WebKit
DEVTOOLS_GYP=$(find . -type f -name devtools.gyp -not -path "*/trunk/*")
if [ -z "$DEVTOOLS_GYP" ]; then
exit $EXIT_DEVTOOLS_GYP_FILE
« no previous file with comments | « gce/uploader_bisect_helper.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698