Fail if merge to enterprise causes compilation issues (#4027)

* check compilation of enterprise job

* test that enterprise merge job fails with compilation error

* Revert "test that enterprise merge job fails with compilation error"

This reverts commit 0eaccd58c207a4c15365186017bf47601cc95552.

* Update readme and use citus extbuilder:13beta3
pull/4083/head^2
SaitTalhaNisanci 2020-08-31 13:56:15 +03:00 committed by GitHub
parent 1c9dc80e8f
commit 2baf3e0bae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -488,7 +488,7 @@ jobs:
check-merge-to-enterprise:
docker:
- image: buildpack-deps:stretch
- image: citus/extbuilder:13beta3
working_directory: /home/circleci/project
steps:
- checkout

View File

@ -51,11 +51,13 @@ following:
This check exists to make sure that we can always merge the `master` branch of
`community` into the `enterprise-master` branch of the `enterprise` repo.
There are two conditions in which this check passes:
1. There are no merge conflicts between your PR branch and `enterprise-master`.
1. There are no merge conflicts between your PR branch and `enterprise-master` and after this merge the code compiles.
2. There are merge conflicts, but there is a branch with the same name in the
enterprise repo that:
1. Contains the last commit of the community branch with the same name.
2. Merges cleanly into `enterprise-master`
3. After merging, the code can be compiled.
If the job already passes, you are done, nothing further required! Otherwise
follow the below steps.

View File

@ -22,6 +22,12 @@ source ci/ci_helpers.sh
# are not shown in CI output (even though it's also filtered out by CircleCI)
set -x
check_compile () {
echo "INFO: checking if merged code can be compiled"
./configure --without-libcurl
make -j10
}
# Clone current git repo (which should be community) to a temporary working
# directory and go there
GIT_DIR_ROOT="$(git rev-parse --show-toplevel)"
@ -47,7 +53,9 @@ git fetch enterprise enterprise-master
git checkout "enterprise/enterprise-master"
if git merge --no-commit "origin/$PR_BRANCH"; then
echo "INFO: community PR branch could be merged into enterprise-master, so everything is good"
echo "INFO: community PR branch could be merged into enterprise-master"
# check that we can compile after the merge
check_compile
exit 0
fi
@ -73,3 +81,5 @@ fi
# Now check if we can merge the enterprise PR into enterprise-master without
# issues.
git merge --no-commit "enterprise/$PR_BRANCH"
# check that we can compile after the merge
check_compile