Skip to content

Commit

Permalink
Merge branch '6.14.z' into cherry-pick-6.14.z-89c80a3158c3364fcb3235d…
Browse files Browse the repository at this point in the history
…12fc4aba855bd778a
  • Loading branch information
pondrejk authored May 7, 2024
2 parents af09235 + 5f8ae85 commit ee4d1be
Show file tree
Hide file tree
Showing 474 changed files with 5,409 additions and 3,188 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/auto_cherry_pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: auto_cherry_pick_commits

on:
pull_request_target:
types: [closed, labeled]
types: [closed]

# Github & Parent PR Env vars
env:
Expand All @@ -23,11 +23,12 @@ jobs:
prt_comment: ${{steps.fc.outputs.comment-body}}
steps:
- name: Find Comment
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ env.number }}
body-includes: "trigger: test-robottelo"
direction: last

# Auto CherryPicking and Failure Recording
auto-cherry-pick:
Expand All @@ -40,6 +41,12 @@ jobs:
label: ${{ github.event.pull_request.labels.*.name }}

steps:
# Needed to avoid out-of-memory error
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10

## Robottelo Repo Checkout
- uses: actions/checkout@v4
if: ${{ startsWith(matrix.label, '6.') && matrix.label != github.base_ref }}
Expand Down Expand Up @@ -69,12 +76,13 @@ jobs:

- name: Add Parent PR's PRT comment to Auto_Cherry_Picked PR's
id: add-parent-prt-comment
if: ${{ always() && steps.cherrypick.outcome == 'success' }}
uses: mshick/add-pr-comment@v2
if: ${{ always() && needs.find-the-parent-prt-comment.outputs.prt_comment != '' && steps.cherrypick.outcome == 'success' }}
uses: thollander/actions-comment-pull-request@v2
with:
issue: ${{ steps.cherrypick.outputs.number }}
message: ${{ needs.find-the-parent-prt-comment.outputs.prt_comment }}
repo-token: ${{ secrets.CHERRYPICK_PAT }}
message: |
${{ needs.find-the-parent-prt-comment.outputs.prt_comment }}
pr_number: ${{ steps.cherrypick.outputs.number }}
GITHUB_TOKEN: ${{ secrets.CHERRYPICK_PAT }}

- name: is autoMerging enabled for Auto CherryPicked PRs ?
if: ${{ always() && steps.cherrypick.outcome == 'success' && contains(github.event.pull_request.labels.*.name, 'AutoMerge_Cherry_Picked') }}
Expand All @@ -89,10 +97,25 @@ jobs:
labels: ["AutoMerge_Cherry_Picked"]
})
## Failure Logging to issues and GChat Group
- name: Check if cherrypick pr is created
id: search_pr
if: always()
run: |
PR_TITLE="[${{ matrix.label }}] ${{ env.title }}"
API_URL="https://api.github.com/repos/${{ github.repository }}/pulls?state=open"
PR_SEARCH_RESULT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$API_URL" | jq --arg title "$PR_TITLE" '.[] | select(.title == $title)')
if [ -n "$PR_SEARCH_RESULT" ]; then
echo "pr_found=true" >> $GITHUB_OUTPUT
echo "PR is Found with title $PR_TITLE"
else
echo "pr_found=false" >> $GITHUB_OUTPUT
echo "PR is not Found with title $PR_TITLE"
fi
## Failure Logging to issues
- name: Create Github issue on cherrypick failure
id: create-issue
if: ${{ always() && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }}
if: ${{ always() && steps.search_pr.outputs.pr_found == 'false' && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }}
uses: dacbd/create-issue-action@main
with:
token: ${{ secrets.CHERRYPICK_PAT }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prt_labels.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Remove the PRT label, for the new commit

on:
pull_request:
pull_request_target:
types: ["synchronize"]

jobs:
prt_labels_remover:
name: remove the PRT label when amendments or new commits added to PR
runs-on: ubuntu-latest
if: "(contains(github.event.pull_request.labels.*.name, 'PRT-Passed') || contains(github.event.pull_request.labels.*.name, 'PRT-Failed'))"
if: "(contains(github.event.pull_request.labels.*.name, 'PRT-Passed'))"
steps:
- name: Avoid the race condition as PRT result will be cleaned
run: |
Expand All @@ -23,7 +23,7 @@ jobs:
wait-interval: 2
count: 5

- name: remove the PRT Passed/Failed label, for new commit
- name: remove the PRT Passed label, for new commit
if: always() && ${{steps.prt.outputs.result}} == 'not_found'
uses: actions/github-script@v7
with:
Expand All @@ -35,7 +35,7 @@ jobs:
repo: context.repo.repo,
issue_number: prNumber,
});
const labelsToRemove = ['PRT-Failed', 'PRT-Passed'];
const labelsToRemove = ['PRT-Passed'];
const labelsToRemoveFiltered = labelsToRemove.filter(label => issue.data.labels.some(({ name }) => name === label));
if (labelsToRemoveFiltered.length > 0) {
await Promise.all(labelsToRemoveFiltered.map(async label => {
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:
env:
PYCURL_SSL_LIBRARY: openssl
ROBOTTELO_BUGZILLA__API_KEY: ${{ secrets.BUGZILLA_KEY }}
ROBOTTELO_JIRA__API_KEY: ${{ secrets.JIRA_KEY }}

jobs:
codechecks:
name: Code Quality
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
steps:
- name: Checkout Robottelo
uses: actions/checkout@v4
Expand All @@ -41,9 +42,6 @@ jobs:
cp broker_settings.yaml.example broker_settings.yaml
cp .env.example .env
- name: Pre Commit Checks
uses: pre-commit/[email protected]

- name: Collect Tests
run: |
# To skip vault login in pull request checks
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: [3.12]
steps:
- name: Checkout Robottelo
uses: actions/checkout@v4
Expand Down Expand Up @@ -55,6 +55,7 @@ jobs:
id: cscheck
env:
ROBOTTELO_BUGZILLA__API_KEY: ${{ secrets.BUGZILLA_KEY }}
ROBOTTELO_JIRA__API_KEY: ${{ secrets.JIRA_KEY }}

- name: Customer scenario status
run: |
Expand Down
56 changes: 30 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
# configuration for pre-commit git hooks

ci:
autofix_prs: false # disable autofixing PRs

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: tests/foreman/data/
- id: check-yaml
- id: debug-statements
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: local
hooks:
- id: fix-uuids
name: Robottelo Custom Fix UUIDs script
description: This hook runs the scripts/fix_uuids.sh script
language: script
entry: scripts/fix_uuids.sh
verbose: true
types: [text]
require_serial: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: tests/foreman/data/
- id: check-yaml
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: local
hooks:
- id: fix-uuids
name: Robottelo Custom Fix UUIDs script
description: This hook runs the scripts/fix_uuids.sh script
language: script
entry: scripts/fix_uuids.sh
verbose: true
types: [text]
require_serial: true
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks
101 changes: 101 additions & 0 deletions conf/fam.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
FAM:
SERVER:
# Parameter for all tests
foreman_username: admin
foreman_password: "changeme"
foreman_server_url: "https://foreman.example.com"
foreman_validate_certs: false

foreman_proxy: "foreman.example.com"

# Parameter for snapshot test
snapshot_host_name: "test_host"

# Parameter for job invocation test
foreman_host: "foreman.example.com"

# Parameter for subscription_manifest test
subscription_manifest_path: "data/manifest_foreman-ansible-modules.zip"

# Parameter for redhat_manifest test
manifest_name: "katello.example.com"
rhsm_username: "john-smith"
rhsm_password: "changeme"
rhsm_pool_id: 8a85f99a7db4827d017dc512fcad00b0
rhsm_validate_certs: false

# Parameter for scc_product test
scc_account_name_for_scc_product: testaccount
scc_account_login_for_scc_product: testuser
scc_account_password_for_scc_product: testpass

# Parameter for external_usergroup testing
auth_source_ldap_host: ldap.example.com
auth_source_ldap_account: ansible
auth_source_ldap_account_password: pass
auth_source_ldap_base_dn: dc=example,dc=com
auth_source_ldap_attr_login: uid
auth_source_ldap_groups_base: cn=groups,cn=accounts,dc=example,dc=com
external_usergroup_name: "admins"

COMPUTE_PROFILE:
libvirt:
compute_resource:
name: libvirt-cr01
organizations:
- Test Organization
locations:
- Test Location
params:
url: qemu+ssh://libvirtuser@localhost/system
compute_profile:
name: app-small
attrs:
cpus: 1
memory: 2147483648
nics_attributes:
0:
type: bridge
bridge: ""
model: virtio
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 0G
format_type: raw
ovirt:
compute_resource:
name: ovirt-cr01
organizations:
- Test Organization
locations:
- Test Location
params:
url: "https://ovirt.example.com/ovirt-engine/api"
user: compute-user@internal
password: ovirtcompute123
use_v4: true
datacenter: c1479626-99a2-44eb-8401-14b5630f417f
ovirt_quota: 502a76bb-a3fe-42f1-aed6-2a7c892a6786
compute_profile:
name: app-small
attrs:
cluster: Devel-Infra
cores: 2
sockets: 1
memory: 1073741824
ha: 0
interfaces_attributes:
0:
name: ""
network: ovirtmgmt
interface: virtio
volumes_attributes:
0:
size_gb: '16'
storage_domain: 'Local-IBM'
preallocate: '1'
wipe_after_delete: '0'
interface: 'virtio_scsi'
bootable: 'true'
5 changes: 5 additions & 0 deletions conf/jira.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
JIRA:
# url default value is set to 'https://issues.redhat.com' even if not provided.
URL: https://issues.redhat.com
# Provide api_key to access Jira REST API
API_KEY: replace-with-jira-api-key
6 changes: 5 additions & 1 deletion conf/oscap.yaml.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
OSCAP:
CONTENT_PATH: /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml
RHEL_MAJOR_VERSION: "@jinja {{this.server.version.rhel_version | int }}"
CONTENT_PATH: '@format /usr/share/xml/scap/ssg/content/ssg-rhel{this.oscap.rhel_major_version}-ds.xml'
# see: robottelo/constants/__init__.py OSCAP_PROFILE
PROFILE: '@format security{this.oscap.rhel_major_version}'
CONTENT_DIR: /usr/share/xml/scap/ssg/content
2 changes: 2 additions & 0 deletions conf/provisioning.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ PROVISIONING:
HOST_ROOT_PASSWORD:
HOST_SSH_KEY_PRIV:
HOST_SSH_KEY_PUB:
PROVISIONING_SAT_WORKFLOW:
PROVISIONING_HOST_WORKFLOW:
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Global Configurations for py.test runner"""

import pytest

pytest_plugins = [
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
http://sphinx-doc.org/config.html
"""

import builtins
import os
import sys
Expand Down
Loading

0 comments on commit ee4d1be

Please sign in to comment.