Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump redis from 5.0.2 to 5.0.3 #222

Closed
wants to merge 16 commits into from
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ updates:
schedule:
interval: "daily"
labels:
- 'test_6.16.z'
- "CherryPick"
- "dependencies"
- "6.15.z"
Expand All @@ -23,6 +24,7 @@ updates:
schedule:
interval: "daily"
labels:
- 'test_6.16.z'
- "CherryPick"
- "dependencies"
- "6.15.z"
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/auto_branching.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
### The auto-branching workflow triggered through a dispatch request from the CI
name: auto-branching

# Run on workflow dispatch from CI
on:
workflow_dispatch:
inputs:
target_branch:
type: string
description: branch to be created from the master


jobs:
auto-branching:
name: run this auto-branching on the master branch
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Create the target branch
id: create-branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ github.event.inputs.target_branch }}

- name: Create label for the target branch
id: create-label
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/labels \
-d "{\"name\":\"${{ github.event.inputs.target_branch }}\",\"color\":\"fbca04\"}"

- name: Update target branch label in dependabot yml file
id: update-dependabot
run: |
# Read the dependabot.yml file
FILE_PATH="./.github/dependabot.yml"
TARGET_BRANCH="${{ github.event.inputs.target_branch }}"

# Append the target branch label to the labels node
awk -v target="'$TARGET_BRANCH'" '/^ *labels:/ {$0 = $0 "\n - " target} 1' "$FILE_PATH" > temp.yml && mv temp.yml "$FILE_PATH"

- name: Update repository URLs in requirements.txt
id: update-repo-urls
run: |
# Define the file path
FILE_PATH="./requirements.txt"

# Define the replacement strings
replacements=(
"git+https://github.com/SatelliteQE/airgun.git@master#egg=airgun git+https://github.com/SatelliteQE/airgun.git@${{ github.event.inputs.target_branch }}#egg=airgun"
"git+https://github.com/SatelliteQE/nailgun.git@master#egg=nailgun git+https://github.com/SatelliteQE/nailgun.git@${{ github.event.inputs.target_branch }}#egg=nailgun"
)

# Create a temporary file
TEMP_FILE=$(mktemp)

# Perform replacements using a for loop
for replacement in "${replacements[@]}"; do
old_url=$(echo "$replacement" | cut -d' ' -f1)
new_url=$(echo "$replacement" | cut -d' ' -f2)
sed "s|${old_url}|${new_url}|g" "$FILE_PATH" > "$TEMP_FILE" && mv "$TEMP_FILE" "$FILE_PATH"
done

- name: Remove the dispatch release GHA
id: remove-dispatch-release-gha
run: |
rm -rf ./.github/workflows/dispatch_release.yml

- name: Remove lines with @pytest.mark.stream
id: remove-mark-stream
run: |
# Define the folder path
FOLDER_PATH="./tests/foreman"

# Loop through files in the folder
for file in "$FOLDER_PATH"/*.py; do
# Remove lines containing @pytest.mark.stream and save the changes to a temporary file
grep -v '@pytest\.mark\.stream' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
done

- name: Update version in setup.py
run: sed -i "s/version=['\"][0-9.]*['\"]\+/version='${{ github.event.inputs.target_branch }}'/" setup.py

- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add setup.py ./tests/foreman ./.github/workflows/dispatch_release.yml ./requirements.txt ./.github/dependabot.yml
git commit -m "Testing the Auto-branching with ${{ github.event.inputs.target_branch }}"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

31 changes: 0 additions & 31 deletions .github/workflows/dispatch_release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion requirements-optional.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# For running tests and checking code quality using these modules.
flake8==7.0.0
pytest-cov==4.1.0
redis==5.0.2
redis==5.0.3
pre-commit==3.6.2

# For generating documentation.
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ wait-for==1.2.0
wrapanapi==3.6.0

# Get airgun, nailgun and upgrade from master
git+https://github.com/SatelliteQE/airgun.git@master#egg=airgun
git+https://github.com/SatelliteQE/nailgun.git@master#egg=nailgun
git+https://github.com/SatelliteQE/airgun.git@test_6.16.z#egg=airgun
git+https://github.com/SatelliteQE/nailgun.git@test_6.16.z#egg=nailgun
# Broker currently is unable to push to PyPi due to [1] and [2]
# In the meantime, we install directly from the repo
# [1] - https://github.com/ParallelSSH/ssh2-python/issues/193
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='robottelo',
version='0.1.0',
version='test_6.16.z',
description='Robottelo is a test suite which exercises The Foreman.',
long_description=README,
author='Satellite QE Team',
Expand Down
Empty file added tests/foreman/__init__.py.tmp
Empty file.
Loading