Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .ci/ansible/smash-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,5 @@
}
}
}
],
"custom": {
"fixtures_origin": "http://pulp-fixtures:8080/"
}
]
}
2 changes: 1 addition & 1 deletion .ci/ansible/start_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
follow_redirects: none
register: result
until: result.status == 200
retries: 6
retries: 12
delay: 5
rescue:
- name: "Output pulp container log"
Expand Down
22 changes: 22 additions & 0 deletions .ci/scripts/check_gettext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_python' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template

# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../..

set -uv

# check for imports not from pulpcore.plugin. exclude tests
MATCHES=$(grep -n -r --include \*.py "_(f")

if [ $? -ne 1 ]; then
printf "\nERROR: Detected mix of f-strings and gettext:\n"
echo "$MATCHES"
exit 1
fi
2 changes: 1 addition & 1 deletion .ci/scripts/publish_client_gem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo "---
:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
sudo chmod 600 ~/.gem/credentials

export REPORTED_VERSION=$(http pulp/pulp/api/v3/status/ | jq --arg plugin pulp_python -r '.versions[] | select(.component == $plugin) | .version')
export REPORTED_VERSION=$(http pulp/pulp/api/v3/status/ | jq --arg plugin python -r '.versions[] | select(.component == $plugin) | .version')
export DESCRIPTION="$(git describe --all --exact-match `git rev-parse HEAD`)"
if [[ $DESCRIPTION == 'tags/'$REPORTED_VERSION ]]; then
export VERSION=${REPORTED_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/publish_client_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cd "$(dirname "$(realpath -e "$0")")"/../..

pip install twine

export REPORTED_VERSION=$(http pulp/pulp/api/v3/status/ | jq --arg plugin pulp_python -r '.versions[] | select(.component == $plugin) | .version')
export REPORTED_VERSION=$(http pulp/pulp/api/v3/status/ | jq --arg plugin python -r '.versions[] | select(.component == $plugin) | .version')
export DESCRIPTION="$(git describe --all --exact-match `git rev-parse HEAD`)"
if [[ $DESCRIPTION == 'tags/'$REPORTED_VERSION ]]; then
export VERSION=${REPORTED_VERSION}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
- name: Check for pulpcore imports outside of pulpcore.plugin
run: sh .ci/scripts/check_pulpcore_imports.sh

- name: Check for gettext problems
run: sh .ci/scripts/check_gettext.sh

test:
runs-on: ubuntu-latest
# run only after lint finishes
Expand Down Expand Up @@ -120,3 +123,4 @@ jobs:
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp pip3 list
62 changes: 62 additions & 0 deletions .github/workflows/fips.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_python' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template
---
name: Pulp FIPS CI
on:

workflow_dispatch:

jobs:
vagrant:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- test_type: pulp3-source-centos8-fips
- test_type: pulp3-source-centos7-fips
steps:
- uses: actions/checkout@v2.3.1
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Ansible
run: |
pip3 install -U pip
pip3 install "ansible>2.9,<3"
ansible --version
- name: Pulp Installer
run: |
cd ..
git clone --depth=1 https://github.com/pulp/pulp_installer
- name: Install Vagrant
shell: bash
run: |
cd ../pulp_installer/
git submodule update --init
.github/workflows/scripts/install.sh ${{ matrix.test_type }}
cd ..
git clone https://github.com/pulp/pulpcore
- name: Run Vagrant
shell: bash
run: |
cd ../pulp_installer
sed -e "s/pulp-file/pulp-python/g" -e "s/pulp_file/pulp_python/g" -e "/pulp_source_dir/a pulp_webserver_disable_https: true" example.dev-config.yml > local.dev-config.yml
echo "vagrant ssh \$1 -c \"workon pulp && cd devel/pulp_python && pip install -r functest_requirements.txt\"" >> .github/workflows/scripts/script.sh
echo "vagrant ssh \$1 -c \"workon pulp && cd devel/pulp_python/ && pytest -v -r sx --color=yes --pyargs pulp_python.tests.functional\"" >> .github/workflows/scripts/script.sh
.github/workflows/scripts/script.sh ${{ matrix.test_type }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: After failure
if: failure()
run: |
cd ../pulp_installer
.github/workflows/scripts/after_failure.sh ${{ matrix.test_type }}
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ jobs:
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp pip3 list
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@ jobs:
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp pip3 list
13 changes: 6 additions & 7 deletions .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ REPO_ROOT="$PWD"

set -euv

source .github/workflows/scripts/utils.sh

if [ "${GITHUB_REF##refs/tags/}" = "${GITHUB_REF}" ]
then
TAG_BUILD=0
Expand Down Expand Up @@ -75,12 +77,9 @@ cat >> vars/main.yaml << VARSYAML
pulp_settings: null
VARSYAML

if [[ "$TEST" == "pulp" || "$TEST" == "performance" || "$TEST" == "s3" || "$TEST" == "plugin-from-pypi" ]]; then
sed -i -e '/^services:/a \
- name: pulp-fixtures\
image: docker.io/pulp/pulp-fixtures:latest\
env: {BASE_URL: "http://pulp-fixtures:8080"}' vars/main.yaml
fi

ansible-playbook build_container.yaml
ansible-playbook start_container.yaml

echo ::group::PIP_LIST
cmd_prefix bash -c "pip3 list && pip3 install pipdeptree && pipdeptree"
echo ::endgroup::
6 changes: 3 additions & 3 deletions .github/workflows/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#
# For more info visit https://github.com/pulp/plugin_template

PULP_CONTAINER=pulp
PULP_CI_CONTAINER=pulp

# Run a command
cmd_prefix() {
docker exec "$PULP_CONTAINER" "$@"
docker exec "$PULP_CI_CONTAINER" "$@"
}

# Run a command, and pass STDIN
cmd_stdin_prefix() {
docker exec -i "$PULP_CONTAINER" "$@"
docker exec -i "$PULP_CI_CONTAINER" "$@"
}
4 changes: 2 additions & 2 deletions functest_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git+https://github.com/PulpQE/pulp-smash.git#egg=pulp-smash
pytest
git+https://github.com/pulp/pulp-smash.git#egg=pulp-smash
pytest
2 changes: 1 addition & 1 deletion pulp_python/tests/functional/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
def set_up_module():
"""Skip tests Pulp 3 isn't under test or if pulp_python isn't installed."""
require_pulp_3(SkipTest)
require_pulp_plugins({"pulp_python"}, SkipTest)
require_pulp_plugins({"python"}, SkipTest)


def gen_python_client():
Expand Down
5 changes: 4 additions & 1 deletion template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
additional_plugins: []
black: false
check_commit_message: true
check_gettext: true
check_manifest: true
check_stray_pulpcore_imports: true
cherry_pick_automation: false
Expand All @@ -13,7 +14,7 @@ deploy_client_to_rubygems: true
deploy_daily_client_to_pypi: true
deploy_daily_client_to_rubygems: true
deploy_to_pypi: true
docker_fixtures: true
docker_fixtures: false
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I turned it off and ran plugin-template

docs_test: true
plugin_app_label: python
plugin_camel: PulpPython
Expand All @@ -22,6 +23,7 @@ plugin_caps: PULP_PYTHON
plugin_caps_short: PYTHON
plugin_dash: pulp-python
plugin_dash_short: python
plugin_default_branch: master
plugin_name: pulp_python
plugin_snake: pulp_python
publish_docs_to_pulpprojectdotorg: false
Expand All @@ -35,6 +37,7 @@ redmine_project: null
stable_branch: null
test_bindings: false
test_cli: false
test_fips_nightly: false
test_performance: false
test_released_plugin_with_next_pulpcore_release: false
test_s3: false
Expand Down
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ flake8-docstrings
flake8-tuple
flake8-quotes
mock
git+https://github.com/PulpQE/pulp-smash.git#egg=pulp-smash
git+https://github.com/pulp/pulp-smash.git#egg=pulp-smash
pydocstyle<4
pytest