Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
pulpbot committed Feb 15, 2024
1 parent 6ff863b commit 6ca4ff3
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .ci/ansible/Containerfile.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM {{ ci_base | default("ghcr.io/pulp/pulp-ci-centos:" + pulp_container_tag) }}
FROM {{ ci_base | default(pulp_default_container) }}

# Add source directories to container
{% for item in plugins %}
Expand All @@ -11,7 +11,7 @@ ADD ./{{ item.name }} ./{{ item.name }}

RUN pip3 install
{%- if s3_test | default(false) -%}
{{ " " }}git+https://github.com/fabricio-aguiar/botocore.git@fix-100-continue
{{ " " }}git+https://github.com/gerrod3/botocore.git@fix-100-continue
{%- endif -%}
{%- for item in plugins -%}
{{ " " }}{{ item.source }}
Expand Down
13 changes: 8 additions & 5 deletions .ci/scripts/check_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def main():
"--branches",
default="supported",
help="A comma separated list of branches to check for releases. Can also use keyword: "
"'supported'. Defaults to 'supported', see `ci_update_branches` in "
"'supported'. Defaults to 'supported', see `supported_release_branches` in "
"`plugin_template.yml`.",
)
opts = parser.parse_args()
Expand All @@ -46,12 +46,15 @@ def main():
if branches == "supported":
with open(f"{d}/template_config.yml", mode="r") as f:
tc = yaml.safe_load(f)
branches = tc["ci_update_branches"]
branches.append(DEFAULT_BRANCH)
branches = set(tc["supported_release_branches"])
latest_release_branch = tc["latest_release_branch"]
if latest_release_branch is not None:
branches.add(latest_release_branch)
branches.add(DEFAULT_BRANCH)
else:
branches = branches.split(",")
branches = set(branches.split(","))

if diff := set(branches) - set(available_branches):
if diff := branches - set(available_branches):
print(f"Supplied branches contains non-existent branches! {diff}")
exit(1)

Expand Down
8 changes: 5 additions & 3 deletions .ci/scripts/collect_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
CHANGELOG_FILE = tc_settings.get("filename", "NEWS.rst")
START_STRING = tc_settings.get(
"start_string",
"<!-- towncrier release notes start -->\n"
if CHANGELOG_FILE.endswith(".md")
else ".. towncrier release notes start\n",
(
"<!-- towncrier release notes start -->\n"
if CHANGELOG_FILE.endswith(".md")
else ".. towncrier release notes start\n"
),
)
TITLE_FORMAT = tc_settings.get("title_format", "{name} {version} ({project_date})")

Expand Down
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-304-gc53c1e3
2021.08.26-315-g8ecb63d
15 changes: 14 additions & 1 deletion .github/workflows/create-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install bump2version jinja2 pyyaml
pip install bump2version jinja2 pyyaml packaging
echo ::endgroup::
- name: "Setting secrets"
Expand Down Expand Up @@ -71,6 +71,19 @@ jobs:
run: |
find CHANGES -type f -regex ".*\.\(bugfix\|doc\|feature\|misc\|deprecation\|removal\)" -exec git rm {} +
- name: Checkout plugin template
uses: actions/checkout@v3
with:
repository: pulp/plugin_template
path: plugin_template
fetch-depth: 0

- name: Update CI branches in template_config
working-directory: plugin_template
run: |
python3 ./plugin-template pulp_file --github --latest-release-branch "${NEW_BRANCH}"
git add -A
- name: Make a PR with version bump and without CHANGES/*
uses: peter-evans/create-pull-request@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: "File Publish Release"
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]"
- "[0-9]+.[0-9]+.[0-9]+"

defaults:
run:
Expand All @@ -22,7 +22,7 @@ jobs:

build-bindings-docs:
needs:
- "build-artifacts"
- "build"
runs-on: "ubuntu-latest"
# Install scripts expect TEST to be set, 'docs' is most appropriate even though we don't run tests
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
fetch-depth: 0
path: "pulp_file"
token: ${{ secrets.RELEASE_TOKEN }}

- uses: "actions/setup-python@v4"
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ cat >> vars/main.yaml << VARSYAML
pulp_env: {}
pulp_settings: {"allowed_content_checksums": ["sha1", "sha224", "sha256", "sha384", "sha512"], "allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"]}
pulp_scheme: https
pulp_container_tag: "latest"
pulp_default_container: ghcr.io/pulp/pulp-ci-centos:latest
VARSYAML

SCENARIOS=("pulp" "performance" "azure" "gcp" "s3" "generate-bindings" "lowerbounds")
Expand Down
Empty file modified .github/workflows/scripts/release.sh
100644 → 100755
Empty file.
23 changes: 11 additions & 12 deletions .github/workflows/scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,30 +129,29 @@ echo "Checking for uncommitted migrations..."
cmd_user_prefix bash -c "django-admin makemigrations file --check --dry-run"

# Run unit tests.
cmd_user_prefix bash -c "PULP_DATABASES__default__USER=postgres pytest -v -r sx --color=yes -p no:pulpcore --pyargs pulp_file.tests.unit"
cmd_user_prefix bash -c "PULP_DATABASES__default__USER=postgres pytest -v -r sx --color=yes --suppress-no-test-exit-code -p no:pulpcore --pyargs pulp_file.tests.unit"

# Run functional tests
if [[ "$TEST" == "performance" ]]; then
if [[ -z ${PERFORMANCE_TEST+x} ]]; then
cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance"
cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --suppress-no-test-exit-code --capture=no --durations=0 --pyargs pulp_file.tests.performance"
else
cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance.test_${PERFORMANCE_TEST}"
cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --suppress-no-test-exit-code --capture=no --durations=0 --pyargs pulp_file.tests.performance.test_${PERFORMANCE_TEST}"
fi
exit
fi

if [ -f "$FUNC_TEST_SCRIPT" ]; then
source "$FUNC_TEST_SCRIPT"
else
if [[ "$GITHUB_WORKFLOW" == "File Nightly CI/CD" ]]
then
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8 --nightly"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel' --nightly"

else
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel'"
fi
if [[ "$GITHUB_WORKFLOW" =~ "Nightly" ]]
then
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8 --nightly"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m 'not parallel' --nightly"
else
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m 'not parallel'"
fi
fi
export PULP_FIXTURES_URL="http://pulp-fixtures:8080"
pushd ../pulp-cli
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/scripts/update_backport_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ def random_color():
assert response.status_code == 200
old_labels = set([x["name"] for x in response.json() if x["name"].startswith("backport-")])

# get ci_update_branches from template_config.yml
# get list of branches from template_config.yml
with open("./template_config.yml", "r") as f:
plugin_template = yaml.safe_load(f)
new_labels = set(["backport-" + x for x in plugin_template["ci_update_branches"]])
branches = set(plugin_template["supported_release_branches"])
latest_release_branch = plugin_template["latest_release_branch"]
if latest_release_branch is not None:
branches.add(latest_release_branch)
new_labels = {"backport-" + x for x in branches}

# delete old labels that are not in new labels
for label in old_labels.difference(new_labels):
Expand Down
2 changes: 1 addition & 1 deletion docs/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-304-gc53c1e3
2021.08.26-315-g8ecb63d
2 changes: 1 addition & 1 deletion functest_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aiofiles
aiohttp
beautifulsoup4
pytest
pytest<8
pytest-custom_exit_code
pytest-xdist
proxy.py~=2.4.1
Expand Down
2 changes: 1 addition & 1 deletion lint_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# For more info visit https://github.com/pulp/plugin_template

# python packages handy for developers, but not required by pulp
black
black==23.12.1
check-manifest
flake8
flake8-black
Expand Down
20 changes: 9 additions & 11 deletions template_config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
# This config represents the latest values used when running the plugin-template. Any settings that
# were not present before running plugin-template have been added with their default values.

# generated with [email protected]301-g83f0607
# generated with [email protected]315-g8ecb63d

additional_repos:
- branch: main
name: pulp-certguard
api_root: /pulp/
black: true
check_commit_message: true
check_gettext: true
check_manifest: true
check_stray_pulpcore_imports: true
ci_base_image: ghcr.io/pulp/pulp-ci-centos
ci_env: {}
ci_trigger: '{pull_request: {branches: [''*'']}}'
ci_update_branches:
- '1.10'
- '1.11'
- '1.12'
- '1.13'
- '1.14'
ci_update_docs: true
ci_update_release_behavior: null
cli_package: pulp-cli
cli_repo: https://github.com/pulp/pulp-cli.git
core_import_allowed: []
Expand All @@ -39,6 +30,7 @@ flake8_ignore: []
github_org: pulp
issue_tracker: github
kanban: true
latest_release_branch: null
lint_requirements: true
noissue_marker: '[noissue]'
parallel_test_workers: 8
Expand Down Expand Up @@ -82,6 +74,12 @@ stalebot: true
stalebot_days_until_close: 30
stalebot_days_until_stale: 90
stalebot_limit_to_pulls: true
supported_release_branches:
- '1.10'
- '1.11'
- '1.12'
- '1.13'
- '1.14'
sync_ci: true
test_azure: true
test_cli: true
Expand Down
1 change: 1 addition & 0 deletions unittest_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mock
pytest-django
pytest<8

0 comments on commit 6ca4ff3

Please sign in to comment.