Skip to content

Allow using updated CircleCi without rebasing PRs#7770

Merged
dlang-bot merged 1 commit intodlang:masterfrom
wilzbach:circleci-no-rebase
Jan 25, 2018
Merged

Allow using updated CircleCi without rebasing PRs#7770
dlang-bot merged 1 commit intodlang:masterfrom
wilzbach:circleci-no-rebase

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Jan 24, 2018

The CircleCi setup was updated in #7420
This leads to MODEL being undefined as no CIRCLECI_STAGE is defined.
As the circleci.yml is only read once in the beginning, PRs would be need to
be rebased for it to take effect.
This change avoids the need to rebase existing PRs.

(this is a bit hard to test - it's based on the error message in #7769)

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach
Copy link
Contributor Author

Looking closer at the log of https://circleci.com/gh/dlang/dmd/9422 - the problem seems to be that for old PRs CIRCLE_STAGE is set to "build":

+ HOST_DMD_VER=2.072.2
++ curl --version
++ head -n 1
+ CURL_USER_AGENT='CirleCI curl 7.38.0 (x86_64-pc-linux-gnu) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3'
+ N=4
+ CIRCLE_NODE_INDEX=0
+ CIRCLE_STAGE=build
+ CIRCLE_PROJECT_REPONAME=dmd
+ BUILD=debug
+ DMD=dmd
+ PIC=1
+ case $CIRCLE_STAGE in
+ case $1 in
+ echo 'removed - use '\''all'\'''
removed - use 'all'
+ coverage

# Defined by old, existing PRs
# Added to avoid needing to rebase them
build)
;&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From https://circleci.com/gh/dlang/dmd/9422:

Using build environment variables:
  BASH_ENV=/tmp/.bash_env-5a68c715c9e77c00017dcb69-0-build
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=pull/7769
  CIRCLE_BUILD_NUM=9422
  CIRCLE_BUILD_URL=https://circleci.com/gh/dlang/dmd/9422
  CIRCLE_COMPARE_URL=
  CIRCLE_JOB=build
  CIRCLE_NODE_INDEX=0
  CIRCLE_NODE_TOTAL=2
  CIRCLE_PREVIOUS_BUILD_NUM=9415
  CIRCLE_PROJECT_REPONAME=dmd
  CIRCLE_PROJECT_USERNAME=dlang
  CIRCLE_PR_NUMBER=7769
  CIRCLE_PR_REPONAME=dmd
  CIRCLE_PR_USERNAME=ntrel
  CIRCLE_PULL_REQUEST=https://github.com/dlang/dmd/pull/7769
  CIRCLE_PULL_REQUESTS=https://github.com/dlang/dmd/pull/7769
  CIRCLE_REPOSITORY_URL=git@github.com:dlang/dmd.git
  CIRCLE_SHA1=554828455a3e5651d0e1c1379a7f0daa6b93e615
  CIRCLE_SHELL_ENV=/tmp/.bash_env-5a68c715c9e77c00017dcb69-0-build
  CIRCLE_STAGE=build

;& is the bash fall-through for switch cases. It's already used at the end of this script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI this is due to CircleCi being the only CI who doesn't merge a PR with its target branch. We have to do that manually and hence the YAML doesn't get updated as its read initially before the bash scripts are run.
So the "old" PRs are based on this config: https://github.com/dlang/dmd/blob/c4d0269dd434068230a4f83eb9d8137fa0147133/.circleci/config.yml which defines build

@dlang-bot dlang-bot merged commit 18ba25d into dlang:master Jan 25, 2018
@wilzbach wilzbach deleted the circleci-no-rebase branch March 13, 2018 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants