Skip to content

Commit

Permalink
Update CI from plugin_template. (#897)
Browse files Browse the repository at this point in the history
Update CI from plugin_template
Removed Django as a hard dependency
Updated the No-Issue check message
Added dev/Dockerfile to gitleaks to avoid security alerts on encryption keys to be added there
Simplified the lock_requirements logic

No-Issue
  • Loading branch information
rochacbruno authored Aug 25, 2021
1 parent 8348eaa commit f7c1141
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.04.08-88-ga67f224-dirty
2021.04.08-99-gd8b54c6
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# For more info visit https://github.com/pulp/plugin_template
---
name: Pulp CI
name: Galaxy CI
on: {pull_request: {branches: ['*']}, push: {branches: ['*']}}
jobs:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
- name: Make a PR with version bump
uses: peter-evans/create-pull-request@v3
with:
committer: pulpbot <pulp[email protected]>
author: pulpbot <pulp[email protected]>
committer: ansible <ansible[email protected]>
author: ansible <ansible[email protected]>
branch: minor-version-bump
base: master
title: Bump minor version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# For more info visit https://github.com/pulp/plugin_template
---
name: Pulp Nightly CI/CD
name: Galaxy Nightly CI/CD
on:
schedule:
# * is a special character in YAML so you have to quote this string
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
pip install bandersnatch bump2version gitpython python-redmine towncrier==19.9.0 wheel
echo ::endgroup::
- name: Configure Git with pulpbot name and email
- name: Configure Git with ansible name and email
run: |
git config --global user.name 'pulpbot'
git config --global user.email 'pulp[email protected]'
git config --global user.name 'ansible'
git config --global user.email 'ansible[email protected]'
- name: Setting secrets
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
Expand Down Expand Up @@ -202,10 +202,10 @@ jobs:
with:
ruby-version: "2.6"

- name: Configure Git with pulpbot name and email
- name: Configure Git with ansible name and email
run: |
git config --global user.name 'pulpbot'
git config --global user.email 'pulp[email protected]'
git config --global user.name 'ansible'
git config --global user.email 'ansible[email protected]'
- name: Untar repository
run: |
Expand Down Expand Up @@ -249,13 +249,14 @@ jobs:
- name: Create Pull Request for Changelog
uses: peter-evans/create-pull-request@v3
with:
committer: pulpbot <pulp[email protected]>
author: pulpbot <pulp[email protected]>
branch: ${{ github.event.inputs.release }}-changelog
committer: ansible <ansible[email protected]>
author: ansible <ansible[email protected]>
branch: changelog/${{ github.event.inputs.release }}
base: master
title: 'Building changelog for ${{ github.event.inputs.release }}'
body: '[noissue]'
commit-message: |
Building changelog for ${{ github.event.inputs.release }}
[noissue]
delete-branch: true
22 changes: 14 additions & 8 deletions .github/workflows/scripts/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ COMMIT_MSG=$(git log --format=%B --no-merges -1)
export COMMIT_MSG

if [[ "$TEST" == "upgrade" ]]; then
pip install -r functest_requirements.txt
git checkout -b ci_upgrade_test
cp -R .github /tmp/.github
cp -R .ci /tmp/.ci
git checkout $FROM_GALAXY_NG_BRANCH
rm -rf .ci .github
cp -R /tmp/.github .
cp -R /tmp/.ci .
# Pin deps
sed -i "s/~/=/g" requirements.txt
fi

if [[ "$TEST" == "plugin-from-pypi" ]]; then
Expand Down Expand Up @@ -115,6 +114,7 @@ fi
git clone --depth=1 https://github.com/pulp/pulpcore.git --branch 3.14

cd pulpcore

if [ -n "$PULPCORE_PR_NUMBER" ]; then
git fetch --depth=1 origin pull/$PULPCORE_PR_NUMBER/head:$PULPCORE_PR_NUMBER
git checkout $PULPCORE_PR_NUMBER
Expand All @@ -123,29 +123,35 @@ cd ..


git clone --depth=1 https://github.com/pulp/pulp_ansible.git --branch 0.9.0
cd pulp_ansible

if [ -n "$PULP_ANSIBLE_PR_NUMBER" ]; then
cd pulp_ansible
git fetch --depth=1 origin pull/$PULP_ANSIBLE_PR_NUMBER/head:$PULP_ANSIBLE_PR_NUMBER
git checkout $PULP_ANSIBLE_PR_NUMBER
cd ..
fi

cd ..

git clone --depth=1 https://github.com/pulp/pulp_container.git --branch 2.7.1
cd pulp_container

if [ -n "$PULP_CONTAINER_PR_NUMBER" ]; then
cd pulp_container
git fetch --depth=1 origin pull/$PULP_CONTAINER_PR_NUMBER/head:$PULP_CONTAINER_PR_NUMBER
git checkout $PULP_CONTAINER_PR_NUMBER
cd ..
fi

cd ..

git clone --depth=1 https://github.com/ansible/galaxy-importer.git --branch v0.3.4
cd galaxy-importer

if [ -n "$GALAXY_IMPORTER_PR_NUMBER" ]; then
cd galaxy-importer
git fetch --depth=1 origin pull/$GALAXY_IMPORTER_PR_NUMBER/head:$GALAXY_IMPORTER_PR_NUMBER
git checkout $GALAXY_IMPORTER_PR_NUMBER
cd ..
fi

cd ..



# Intall requirements for ansible playbooks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/check_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pip3 install requests

echo ::endgroup::

for sha in $(curl $GITHUB_CONTEXT | jq '.[].sha' | sed 's/"//g')
for sha in $(curl -H "Authorization: token $GITHUB_TOKEN" $GITHUB_CONTEXT | jq '.[].sha' | sed 's/"//g')
do
python3 .ci/scripts/validate_commit_message.py $sha
VALUE=$?
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/update_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Configure Git with pulpbot name and email
- name: Configure Git with ansible name and email
run: |
git config --global user.name 'pulpbot'
git config --global user.email 'pulp[email protected]'
git config --global user.name 'ansible'
git config --global user.email 'ansible[email protected]'
- name: Run update
run: |
Expand All @@ -36,14 +36,13 @@ jobs:
- name: Create Pull Request for CI files
uses: peter-evans/create-pull-request@v3
with:
committer: pulpbot <[email protected]>
author: pulpbot <[email protected]>
branch: ${GITHUB_REF#refs/heads/}-update-ci-files
base: ${GITHUB_REF#refs/heads/}
title: 'Update CI for ${GITHUB_REF#refs/heads/}'
body: '[noissue]'
token: ${{ secrets.RELEASE_TOKEN }}
committer: ansible <[email protected]>
author: ansible <[email protected]>
title: 'Update CI files'
body: 'No-Issue'
commit-message: |
Update CI files for ${GITHUB_REF#refs/heads/}
Update CI files
[noissue]
No-Issue
delete-branch: true
2 changes: 1 addition & 1 deletion .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[allowlist]
description = "Our test install exports a test only MINIO ACCESS KEY"
files = [ '''.github/workflows/scripts/install.sh''' ]
files = [ '''.github/workflows/scripts/install.sh''', '''dev/Dockerfile.base''' ]
15 changes: 7 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def run(self):


requirements = [
"Django~=2.2.23",
"galaxy-importer==0.3.4",
"pulpcore>=3.14.0,<3.15.0",
"pulp-ansible>=0.9.0,<0.10.0",
Expand All @@ -98,12 +97,9 @@ def run(self):
"django-automated-logging"
]


is_on_dev_environment = (
"COMPOSE_PROFILE" in os.environ and "DEV_SOURCE_PATH" in os.environ
and os.environ.get("LOCK_REQUIREMENTS") == "0"
)
if is_on_dev_environment:
# next line can be replaced via sed in ci scripts/post_before_install.sh
unpin_requirements = os.getenv("LOCK_REQUIREMENTS") == "0"
if unpin_requirements:
"""
To enable the installation of local dependencies e.g: a local fork of
pulp_ansible checked out to specific branch/version.
Expand All @@ -112,7 +108,10 @@ def run(self):
ref: https://github.com/ansible/galaxy_ng/wiki/Development-Setup
#steps-to-run-dev-environment-with-specific-upstream-branch
"""
DEV_SOURCE_PATH = os.environ.get("DEV_SOURCE_PATH", "").split(":")
DEV_SOURCE_PATH = os.getenv(
"DEV_SOURCE_PATH",
default="pulpcore:pulp_ansible:pulp_container:galaxy_importer"
).split(":")
DEV_SOURCE_PATH += [path.replace("_", "-") for path in DEV_SOURCE_PATH]
requirements = [
re.sub(r"""(=|^|~|<|>|!)([\S]+)""", "", req)
Expand Down
47 changes: 25 additions & 22 deletions template_config.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
# 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]87-g2136629-dirty
# generated with [email protected]99-gd8b54c6

additional_repos:
- name: pulp_ansible
org: pulp
bindings: true
branch: 0.9.0
- name: pulp_container
org: pulp
bindings: true
branch: 2.7.1
- name: galaxy-importer
bindings: false
org: ansible
branch: v0.3.4
- bindings: true
branch: 0.9.0
name: pulp_ansible
org: pulp
- bindings: true
branch: 2.7.1
name: pulp_container
org: pulp
- bindings: false
branch: v0.3.4
name: galaxy-importer
org: ansible
black: false
check_commit_message: false
check_gettext: true
check_manifest: true
check_openapi_schema: true
check_stray_pulpcore_imports: true
core_import_allowed:
- "pulpcore.app.*viewsets"
- "pulpcore\\.app.*admin"
- "ProgressReportSerializer"
cherry_pick_automation: false
ci_trigger: "{pull_request: {branches: ['*']}, push: {branches: ['*']}}"
ci_env: {}
ci_trigger: '{pull_request: {branches: [''*'']}, push: {branches: [''*'']}}'
core_import_allowed:
- pulpcore.app.*viewsets
- pulpcore\.app.*admin
- ProgressReportSerializer
coverage: false
deploy_client_to_pypi: false
deploy_client_to_rubygems: false
Expand All @@ -38,6 +39,7 @@ docker_fixtures: false
docs_test: false
flake8: true
issue_tracker: null
noissue_marker: 'No-Issue'
plugin_app_label: galaxy
plugin_camel: GalaxyNG
plugin_camel_short: Galaxy
Expand All @@ -48,12 +50,12 @@ plugin_dash_short: galaxy
plugin_default_branch: master
plugin_name: galaxy_ng
plugin_snake: galaxy_ng
post_job_template:
post_job_template:
name: update_manifest
path: "galaxy_ng/.github/post-job-template.yml.j2"
path: galaxy_ng/.github/post-job-template.yml.j2
pre_job_template:
name: check_commit
path: "galaxy_ng/.github/pre-job-template.yml.j2"
path: galaxy_ng/.github/pre-job-template.yml.j2
publish_docs_to_pulpprojectdotorg: false
pulp_scheme: http
pulp_settings:
Expand All @@ -62,11 +64,13 @@ pulp_settings:
rh_entitlement_required: insights
pulpcore_branch: '3.14'
pulpcore_pip_version_specifier: null
pulpcore_revision: null
pulpprojectdotorg_key_id: null
pydocstyle: true
pypi_username: null
python_version: '3.8'
redmine_project: null
release_email: [email protected]
release_user: ansible
stable_branch: stable
sync_ci: true
Expand All @@ -80,4 +84,3 @@ travis_notifications: null
update_redmine: false
upgrade_range: []


0 comments on commit f7c1141

Please sign in to comment.