Skip to content

Fix #3415: Spurious clone failures in CI #3432

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

Merged
merged 1 commit into from
Nov 3, 2017

Conversation

allanrenucci
Copy link
Contributor

This is a workaround for a bug where GitHub asks Drone to build a branch
that does not exist yet. We simply sleep for 5s before cloning to make
sure the branch is created

@allanrenucci allanrenucci requested a review from Duhemm November 3, 2017 12:32
Copy link
Contributor

@Duhemm Duhemm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

.drone.yml Outdated
- git init
- git remote add origin $DRONE_REMOTE_URL
- git fetch --no-tags origin $DRONE_COMMIT_REF
- if [ $DRONE_BUILD_EVENT == "push" ]; then git reset --hard -q $DRONE_COMMIT_SHA; else git checkout -qf FETCH_HEAD; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the most portable way to compare strings in shell scripts is =.

This is a workaround for a bug where GitHub asks Drone to build a branch
that does not exist yet. We simply sleep for 5s before cloning to make
sure the branch is created
- sleep 5s
- git init
- git remote add origin $DRONE_REMOTE_URL
- git fetch --no-tags origin $DRONE_COMMIT_REF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is the merged PR branch reference, as it was before?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolasstucki From the log:

+ git fetch --no-tags origin $DRONE_COMMIT_REF
From https://github.com/lampepfl/dotty
 * branch                refs/pull/3432/merge -> FETCH_HEAD

http://dotty-ci.epfl.ch/lampepfl/dotty/1227

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect :)

@allanrenucci allanrenucci merged commit 22ff8a4 into scala:master Nov 3, 2017
@allanrenucci allanrenucci deleted the fix-#3415 branch November 3, 2017 14:28
allanrenucci added a commit to dotty-staging/dotty that referenced this pull request Nov 8, 2017
allanrenucci added a commit to dotty-staging/dotty that referenced this pull request Nov 8, 2017
allanrenucci added a commit to dotty-staging/dotty that referenced this pull request Nov 8, 2017
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

Successfully merging this pull request may close these issues.

3 participants