Skip to content

Commit 44e5599

Browse files
committed
Update CI from template
[noissue]
1 parent 8d32c36 commit 44e5599

File tree

6 files changed

+47
-11
lines changed

6 files changed

+47
-11
lines changed

.ci/scripts/cherrypick.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,42 @@ issue="$2"
2323
backport="$3"
2424
commit_message=$(git log --format=%B -n 1 $commit)
2525

26-
if ! echo $commit_message | grep -q "\[noissue\]"
26+
if ! echo $commit_message | tr '[:upper:]' '[:lower:]' | grep -q "\[noissue\]"
2727
then
28-
if ! echo $commit_message | grep -q -E "(fixes|closes).*#$issue"
28+
if ! echo $commit_message | tr '[:upper:]' '[:lower:]' | grep -q -E "(fixes|closes).*#$issue"
2929
then
3030
echo "Error: issue $issue not detected in commit message." && exit 1
3131
fi
3232
fi
3333

34-
git cherry-pick --no-commit "$commit"
34+
if [ "$4" = "--continue" ]
35+
then
36+
echo "Continue after manually resolving conflicts..."
37+
elif [ "$4" = "" ]
38+
then
39+
if ! git cherry-pick --no-commit "$commit"
40+
then
41+
echo "Please resolve and add merge conflicts and restart this command with appended '--continue'."
42+
exit 1
43+
fi
44+
else
45+
exit 1
46+
fi
3547

3648
for file in $(find CHANGES -name "$issue.*")
3749
do
38-
git mv "$file" "${file/$issue/$backport}"
50+
newfile="${file/$issue/$backport}"
51+
git mv "$file" "$newfile"
52+
sed -i -e "\$a (backported from #$issue)" "$newfile"
53+
git add "$newfile"
3954
done
4055

41-
commit_message="$(printf "$commit_message" | sed -E 's/(fixes|closes)/backports/')"
56+
commit_message="$(printf "$commit_message" | sed -E 's/(fixes|closes)/backports/i')"
4257
commit_message="$commit_message
4358
4459
fixes #$backport
4560
4661
(cherry picked from commit $commit)"
47-
git commit -a -m "$commit_message"
62+
git commit -m "$commit_message"
4863

49-
printf "\nSuccessfully backported commit $1."
64+
printf "\nSuccessfully backported commit $1.\n"

.github/workflows/scripts/before_install.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ else
2727
BRANCH="${GITHUB_REF##refs/tags/}"
2828
fi
2929

30+
if [[ "$TEST" == "upgrade" ]]; then
31+
git checkout -b ci_upgrade_test
32+
cp -R .github /tmp/.github
33+
cp -R .ci /tmp/.ci
34+
git checkout $FROM_PULPCORE_BRANCH
35+
rm -rf .ci .github
36+
cp -R /tmp/.github .
37+
cp -R /tmp/.ci .
38+
# Pin deps
39+
sed -i "s/~/=/g" requirements.txt
40+
fi
41+
3042
if [[ "$TEST" == "plugin-from-pypi" ]]; then
3143
COMPONENT_VERSION=$(http https://pypi.org/pypi/pulpcore/json | jq -r '.info.version')
3244
else
@@ -72,8 +84,11 @@ else
7284
export CI_BASE_IMAGE=
7385
fi
7486

87+
7588
cd ..
7689

90+
91+
7792
git clone --depth=1 https://github.com/pulp/pulp-openapi-generator.git
7893
if [ -n "$PULP_OPENAPI_GENERATOR_PR_NUMBER" ]; then
7994
cd pulp-openapi-generator
@@ -94,13 +109,14 @@ fi
94109
cd pulp-cli
95110
pip install -e .
96111
pulp config create --base-url http://pulp --location tests/settings.toml
112+
sed -i "s/true/false/g" tests/settings.toml
113+
mkdir ~/.config/pulp
114+
cp tests/settings.toml ~/.config/pulp/settings.toml
97115
cd ..
98116

99117

100118

101119

102-
103-
104120
git clone --depth=1 https://github.com/pulp/pulp_file.git --branch master
105121
if [ -n "$PULP_FILE_PR_NUMBER" ]; then
106122
cd pulp_file
@@ -117,6 +133,8 @@ if [ -n "$PULP_CERTGUARD_PR_NUMBER" ]; then
117133
cd ..
118134
fi
119135

136+
137+
120138
# Intall requirements for ansible playbooks
121139
pip install docker netaddr boto3 ansible
122140

.github/workflows/scripts/before_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ tail -v -n +1 .ci/ansible/vars/main.yaml
2929
echo "PULP CONFIG:"
3030
tail -v -n +1 .ci/ansible/settings/settings.* ~/.config/pulp_smash/settings.json
3131

32-
if [[ "$TEST" == 'pulp' || "$TEST" == 'performance' || "$TEST" == 's3' || "$TEST" == "plugin-from-pypi" ]]; then
32+
if [[ "$TEST" == 'pulp' || "$TEST" == 'performance' || "$TEST" == 'upgrade' || "$TEST" == 's3' || "$TEST" == "plugin-from-pypi" ]]; then
3333
# Many functional tests require these
3434
cmd_prefix dnf install -yq lsof which dnf-plugins-core
3535
fi

.github/workflows/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cat >> vars/main.yaml << VARSYAML
6666
pulp_settings: {"allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"]}
6767
VARSYAML
6868

69-
if [[ "$TEST" == "pulp" || "$TEST" == "performance" || "$TEST" == "s3" || "$TEST" == "plugin-from-pypi" ]]; then
69+
if [[ "$TEST" == "pulp" || "$TEST" == "performance" || "$TEST" == "upgrade" || "$TEST" == "s3" || "$TEST" == "plugin-from-pypi" ]]; then
7070
sed -i -e '/^services:/a \
7171
- name: pulp-fixtures\
7272
image: docker.io/pulp/pulp-fixtures:latest\

.github/workflows/scripts/script.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ cmd_prefix bash -c "PULP_DATABASES__default__USER=postgres django-admin test --n
9898
# Run functional tests
9999
export PYTHONPATH=$REPO_ROOT${PYTHONPATH:+:${PYTHONPATH}}
100100

101+
102+
101103
if [[ "$TEST" == "performance" ]]; then
102104
if [[ -z ${PERFORMANCE_TEST+x} ]]; then
103105
pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulpcore.tests.performance

template_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ travis_notifications:
6464
- 'Build details : %{build_url}'
6565
- '%{message}'
6666
update_redmine: true
67+
upgrade_range: []
6768

0 commit comments

Comments
 (0)