Repository navigation
ci: fix API tests in upgrade testing - #1209
Ashim-Stha wants to merge 1 commit into
Conversation
8a80d4d to
a481413
Compare
a481413 to
1f7271f
Compare
| TAG=$(echo "${STABLE_RELEASE_TAGS}" | grep "^v${VERSION}\." | head -n1) | ||
| if [ -z "$TAG" ]; then | ||
| TAG=$(echo "${STABLE_RELEASE_TAGS}" | head -n1) | ||
| fi |
There was a problem hiding this comment.
TAG value must be lower or equal (<=) to the VERSION
There was a problem hiding this comment.
make sure that the major and minor versions number matches for stable branch. Next version will always be patch level for release branch.
Make sure STABLE_RELEASE_TAGS is sorted in desc order.
ca6c7c9 to
f76e10f
Compare
Signed-off-by: Ashim Shrestha <ashimshrestha2384@gmail.com>
f76e10f to
0ec9913
Compare
PHP Code CoverageCoverage after merging port/fix/upgrade-test into master will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||
| schedule: | ||
| - cron: '0 22 * * *' # run at 10 PM UTC | ||
| pull_request: |
| BRANCH_VERSION=$(grep -oPm1 '(?<=<version>)[^<]+' integration_openproject/appinfo/info.xml | sed 's/-.*//') | ||
| SERIES=$(echo "$BRANCH_VERSION" | cut -d. -f1,2) | ||
|
|
||
| STABLE_RELEASE_TAGS=$(gh release list --repo "${REPO}" --json tagName -q '.[].tagName' \ |
There was a problem hiding this comment.
it should be possible to use GITHUB_REPOSITORY directly.
| STABLE_RELEASE_TAGS=$(gh release list --repo "${REPO}" --json tagName -q '.[].tagName' \ | |
| STABLE_RELEASE_TAGS=$(gh release list --repo "${GITHUB_REPOSITORY}" --json tagName -q '.[].tagName' \ |
| - name: Install stable integration_openproject app | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| REPO: ${{ github.repository }} |
There was a problem hiding this comment.
| REPO: ${{ github.repository }} |
| GH_TOKEN: ${{ github.token }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| BRANCH_VERSION=$(grep -oPm1 '(?<=<version>)[^<]+' integration_openproject/appinfo/info.xml | sed 's/-.*//') |
There was a problem hiding this comment.
we can omit sed
| BRANCH_VERSION=$(grep -oPm1 '(?<=<version>)[^<]+' integration_openproject/appinfo/info.xml | sed 's/-.*//') | |
| BRANCH_VERSION=$(grep -oPm1 '(?<=<version>)[^<][\d.]+' integration_openproject/appinfo/info.xml') |
| REPO: ${{ github.repository }} | ||
| run: | | ||
| BRANCH_VERSION=$(grep -oPm1 '(?<=<version>)[^<]+' integration_openproject/appinfo/info.xml | sed 's/-.*//') | ||
| SERIES=$(echo "$BRANCH_VERSION" | cut -d. -f1,2) |
There was a problem hiding this comment.
| SERIES=$(echo "$BRANCH_VERSION" | cut -d. -f1,2) | |
| SERIES=$(echo "$BRANCH_VERSION" | cut -d . -f1,2) |
| SERIES=$(echo "$BRANCH_VERSION" | cut -d. -f1,2) | ||
|
|
||
| STABLE_RELEASE_TAGS=$(gh release list --repo "${REPO}" --json tagName -q '.[].tagName' \ | ||
| | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -rV) |
There was a problem hiding this comment.
| | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -rV) | |
| | grep -P '^[\d.]+$' | sort -rV) |
| fi | ||
| [ -n "$TAG" ] || { echo "No stable release found"; exit 1; } | ||
|
|
||
| gh release download "${TAG}" --repo "${REPO}" --pattern '*.tar.gz' --dir /tmp/app |
There was a problem hiding this comment.
| gh release download "${TAG}" --repo "${REPO}" --pattern '*.tar.gz' --dir /tmp/app | |
| # download and enable the app | |
| gh release download "${TAG}" --repo "${REPO}" --pattern '*.tar.gz' --dir /tmp/app |
| if [ -z "$TAG" ]; then | ||
| TAG=$(echo "${STABLE_RELEASE_TAGS}" | head -n1) | ||
| fi |
There was a problem hiding this comment.
| if [ -z "$TAG" ]; then | |
| TAG=$(echo "${STABLE_RELEASE_TAGS}" | head -n1) | |
| fi | |
| if [ -z "$TAG" ]; then | |
| TAG=$(echo "${STABLE_RELEASE_TAGS}" | head -n1) | |
| fi |
| BRANCH_VERSION=$(grep -oPm1 '(?<=<version>)[^<]+' integration_openproject/appinfo/info.xml | sed 's/-.*//') | ||
| SERIES=$(echo "$BRANCH_VERSION" | cut -d. -f1,2) | ||
|
|
||
| STABLE_RELEASE_TAGS=$(gh release list --repo "${REPO}" --json tagName -q '.[].tagName' \ |
There was a problem hiding this comment.
| STABLE_RELEASE_TAGS=$(gh release list --repo "${REPO}" --json tagName -q '.[].tagName' \ | |
| # sorted list of stable releases (excluding nightly releases) | |
| STABLE_RELEASE_TAGS=$(gh release list --repo "${REPO}" --json tagName -q '.[].tagName' \ |
| TAG=$(echo "${STABLE_RELEASE_TAGS}" | grep "^v${SERIES}\." \ | ||
| | while read -r t; do | ||
| version="${t#v}" | ||
| if [ "$(printf '%s\n%s\n' "$version" "$BRANCH_VERSION" | sort -V | head -n1)" = "$version" ]; then | ||
| echo "$t" | ||
| break | ||
| fi | ||
| done) |
There was a problem hiding this comment.
maybe we can do this. get the patch list and grab the first one as it will be the latest one.
| TAG=$(echo "${STABLE_RELEASE_TAGS}" | grep "^v${SERIES}\." \ | |
| | while read -r t; do | |
| version="${t#v}" | |
| if [ "$(printf '%s\n%s\n' "$version" "$BRANCH_VERSION" | sort -V | head -n1)" = "$version" ]; then | |
| echo "$t" | |
| break | |
| fi | |
| done) | |
| PATCH_VERSIONS=$(echo "${STABLE_RELEASE_TAGS}" | grep "v${SERIES}") | |
| LATEST_TAG=$(echo "${PATCH_VERSIONS}" | head -n1) |
| fi | ||
| done) | ||
|
|
||
| if [ -z "$TAG" ]; then |
There was a problem hiding this comment.
| if [ -z "$TAG" ]; then | |
| if [ -z "$LATEST_TAG" ]; then |
Description
master: install latest stable release -> bump branch minor version -> upgrade
stable: install latest stabled defined in the branch -> bump branch patch version -> upgrade
Related Issue or Workpackage
successful CI runs:
Screenshots (if appropriate):
Types of changes
Checklist:
CHANGELOG.mdfile