From 65ac1760fd942338764763d4cff0422966b6f889 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 12 Mar 2024 14:29:46 +0000 Subject: [PATCH] Changes for 6.16.z new branch --- .github/dependabot.yml | 2 + .github/workflows/auto_branching.yml | 139 ----------------------- .github/workflows/dispatch_release.yml | 31 ----- requirements.txt | 4 +- setup.py | 2 +- tests/foreman/cli/test_capsulecontent.py | 2 - 6 files changed, 5 insertions(+), 175 deletions(-) delete mode 100644 .github/workflows/auto_branching.yml delete mode 100644 .github/workflows/dispatch_release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a40fa25f8fe..7c591380687 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,6 +10,7 @@ updates: schedule: interval: "daily" labels: + - '6.16.z' - "CherryPick" - "dependencies" - "6.15.z" @@ -23,6 +24,7 @@ updates: schedule: interval: "daily" labels: + - '6.16.z' - "CherryPick" - "dependencies" - "6.15.z" diff --git a/.github/workflows/auto_branching.yml b/.github/workflows/auto_branching.yml deleted file mode 100644 index c1065d2339b..00000000000 --- a/.github/workflows/auto_branching.yml +++ /dev/null @@ -1,139 +0,0 @@ -### 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-non-master: - name: ${{ github.event.inputs.target_branch }} - raise PR with changes - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Create the ${{ github.event.inputs.target_branch }} branch - id: create-branch - uses: peterjgrainger/action-create-branch@v2.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - branch: ${{ github.event.inputs.target_branch }} - - - name: Create label for the ${{ github.event.inputs.target_branch }} 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: Switch to ${{ github.event.inputs.target_branch }} branch - run: git checkout -b "${{ github.event.inputs.target_branch }}" - - - name: Checkout from ${{ github.event.inputs.target_branch }} branch for auto-branching changes - id: checkout-to-auto-branch - run: | - branch_name="auto-branching-${{ github.event.inputs.target_branch }}-$(date '+%s')" - git checkout -b "$branch_name" - echo "branch_name=$branch_name" >> $GITHUB_OUTPUT - - - 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 - rm -rf ./.github/workflows/auto_branching.yml - - - name: Remove lines with @pytest.mark.stream - id: remove-mark-stream - run: | - # Loop through files in the folder - grep -rl "tests/foreman" -e '@pytest\.mark\.stream' | while IFS= read -r file; do - awk '!/@pytest\.mark\.stream/' "$file" > temp && mv temp "$file" - done - - - name: Update version in setup.py - run: sed -i "s/version=['\"][0-9.]*['\"]\+/version='${{ github.event.inputs.target_branch }}'/" setup.py - - - name: Update the Constants in __init__.py file - run: | - old_url="https://raw.githubusercontent.com/SatelliteQE/robottelo/master/tests/foreman/data/uri.sh" - new_url="https://raw.githubusercontent.com/SatelliteQE/robottelo/6.15.z/tests/foreman/data/uri.sh" - FILE_PATH="./robottelo/constants/__init__.py" - - awk '/SAT_NON_GA_VERSIONS =/ { sub(/\[[^,]*, /, "[", $0) } 1' "$FILE_PATH" > temp && mv temp "$FILE_PATH" - sed -i.bak "s|${old_url}|${new_url}|" "$FILE_PATH" - - - name: git status - run: git status - - - name: git diff - run: git diff - - - name: Commit changes - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add setup.py ./tests/foreman ./.github/workflows/dispatch_release.yml ./requirements.txt ./.github/* - git commit -m "Changes for ${{ github.event.inputs.target_branch }} new branch" - git remote -vvv - git push origin ${{steps.checkout-to-auto-branch.outputs.branch_name}} - - - name: Create pull request - run: | - title="Changes for ${{ github.event.inputs.target_branch }} new branch" - body=" - ### Problem Statement - New ${{ github.event.inputs.target_branch }} branch - - ### Solution - - Dependabot labels are updated for new branch - - Removed dispatch release GHA from ${{ github.event.inputs.target_branch }} as we are releasing only master changes - - Airgun and Nailgun Requirements uses ${{ github.event.inputs.target_branch }} branch - - Constants are using new version now - - Stream tests removed - - Setup.py uses new version - " - gh pr create --title "$title" --body "$body" --base "${{ github.event.inputs.target_branch }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/dispatch_release.yml b/.github/workflows/dispatch_release.yml deleted file mode 100644 index 51b6b90919a..00000000000 --- a/.github/workflows/dispatch_release.yml +++ /dev/null @@ -1,31 +0,0 @@ -### The auto release workflow triggered through dispatch request from CI -name: auto-release - -# Run on workflow dispatch from CI -on: - workflow_dispatch: - inputs: - tag_name: - type: string - description: Name of the tag - -jobs: - auto-tag-and-release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Git User setup - run: "git config --local user.email Satellite-QE.satqe.com && git config --local user.name Satellite-QE" - - - name: Tag latest commit - run: "git tag -a ${{ github.event.inputs.tag_name }} -m 'Tagged By SatelliteQE Automation User'" - - - name: Push the tag to the upstream - run: "git push ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git --tags" - - - name: create a new release from the tag - env: - credentials: ${{ secrets.GH_TOKEN }} - run: "curl -L -X POST -H \"Authorization: Bearer ${{ secrets.SATQE_GH_TOKEN }}\" ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases -d '{\"tag_name\": \"${{ github.event.inputs.tag_name }}\", \"target_commitish\":\"master\", \"name\":\"${{ github.event.inputs.tag_name }}\", \"draft\":false, \"prerelease\":true, \"generate_release_notes\": true}'" diff --git a/requirements.txt b/requirements.txt index a2c982fc720..46cb57f58ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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@6.16.z#egg=airgun +git+https://github.com/SatelliteQE/nailgun.git@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 diff --git a/setup.py b/setup.py index 7e0feb9f2b3..ef7d3b7d236 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='robottelo', - version='0.1.0', + version='6.16.z', description='Robottelo is a test suite which exercises The Foreman.', long_description=README, author='Satellite QE Team', diff --git a/tests/foreman/cli/test_capsulecontent.py b/tests/foreman/cli/test_capsulecontent.py index 73e42659fa2..f49edac3cf0 100644 --- a/tests/foreman/cli/test_capsulecontent.py +++ b/tests/foreman/cli/test_capsulecontent.py @@ -43,7 +43,6 @@ ], indirect=True, ) -@pytest.mark.stream def test_positive_content_counts_for_mixed_cv( target_sat, module_capsule_configured, @@ -179,7 +178,6 @@ def test_positive_content_counts_for_mixed_cv( assert len(info['lifecycle-environments']) == 0, 'The LCE is still listed' -@pytest.mark.stream def test_positive_update_counts(target_sat, module_capsule_configured): """Verify the update counts functionality