diff --git a/.github/workflows/create-release-pr.yaml b/.github/workflows/create-release-pr.yaml index c48531ec3..d6be0d07c 100644 --- a/.github/workflows/create-release-pr.yaml +++ b/.github/workflows/create-release-pr.yaml @@ -145,82 +145,82 @@ jobs: #---------------------------------------------- # Collect plugins that fail linting #---------------------------------------------- - - name: Lint plugins - id: lint_plugins - continue-on-error: true - run: | - declare -a failed_plugins=() - for dir in ./*/; do - current_folder=$(basename "$dir") - if [[ $current_folder == "plugin_globals" ]]; then - continue - fi - cd $current_folder - poetry install --no-interaction --no-root --extras "aca-py" - if poetry run ruff check .; then - echo "plugin $current_folder passed lint check" - else - echo "plugin $current_folder failed lint check" - failed_plugins+=("$current_folder") - fi - cd .. - done - echo lint_plugins=${failed_plugins[*]} >> $GITHUB_OUTPUT - #---------------------------------------------- - # Collect plugins that fail unit tests - #---------------------------------------------- - - name: Unit Test Plugins - id: unit_test_plugins - continue-on-error: true - run: | - declare -a failed_plugins=() - for dir in ./*/; do - current_folder=$(basename "$dir") - if [[ $current_folder == "plugin_globals" ]]; then - continue - fi - cd $current_folder - poetry install --no-interaction --no-root --extras "aca-py" - if poetry run pytest; then - echo "plugin $current_folder passed unit test check" - else - echo "plugin $current_folder failed unit test check" - failed_plugins+=("$current_folder") - fi - cd .. - done - echo unit_test_plugins=${failed_plugins[*]} >> $GITHUB_OUTPUT - # ---------------------------------------------- - # Install docker compose - # ---------------------------------------------- - - name: Initialize Docker Compose - uses: isbang/compose-action@v1.5.1 - # ---------------------------------------------- - # Collect plugins that fail integration tests - # ---------------------------------------------- - - name: Integration Test Plugins - id: integration_test_plugins - continue-on-error: true - run: | - trap 'echo "integration_test_exit_code=$?" >> "$GITHUB_OUTPUT"' EXIT - declare -a failed_plugins=() - for dir in ./*/; do - current_folder=$(basename "$dir") - if [[ $current_folder == "plugin_globals" ]]; then - continue - fi - cd $current_folder/integration - docker compose down --remove-orphans - docker compose build - if docker compose run tests; then - echo "plugin $current_folder passed integration test check" - else - echo "plugin $current_folder failed integration test check" - failed_plugins+=("$current_folder") - fi - cd ../.. - done - echo integration_test_plugins=${failed_plugins[*]} >> $GITHUB_OUTPUT + # - name: Lint plugins + # id: lint_plugins + # continue-on-error: true + # run: | + # declare -a failed_plugins=() + # for dir in ./*/; do + # current_folder=$(basename "$dir") + # if [[ $current_folder == "plugin_globals" ]]; then + # continue + # fi + # cd $current_folder + # poetry install --no-interaction --no-root --extras "aca-py" + # if poetry run ruff check .; then + # echo "plugin $current_folder passed lint check" + # else + # echo "plugin $current_folder failed lint check" + # failed_plugins+=("$current_folder") + # fi + # cd .. + # done + # echo lint_plugins=${failed_plugins[*]} >> $GITHUB_OUTPUT + # #---------------------------------------------- + # # Collect plugins that fail unit tests + # #---------------------------------------------- + # - name: Unit Test Plugins + # id: unit_test_plugins + # continue-on-error: true + # run: | + # declare -a failed_plugins=() + # for dir in ./*/; do + # current_folder=$(basename "$dir") + # if [[ $current_folder == "plugin_globals" ]]; then + # continue + # fi + # cd $current_folder + # poetry install --no-interaction --no-root --extras "aca-py" + # if poetry run pytest; then + # echo "plugin $current_folder passed unit test check" + # else + # echo "plugin $current_folder failed unit test check" + # failed_plugins+=("$current_folder") + # fi + # cd .. + # done + # echo unit_test_plugins=${failed_plugins[*]} >> $GITHUB_OUTPUT + # # ---------------------------------------------- + # # Install docker compose + # # ---------------------------------------------- + # - name: Initialize Docker Compose + # uses: isbang/compose-action@v1.5.1 + # # ---------------------------------------------- + # # Collect plugins that fail integration tests + # # ---------------------------------------------- + # - name: Integration Test Plugins + # id: integration_test_plugins + # continue-on-error: true + # run: | + # trap 'echo "integration_test_exit_code=$?" >> "$GITHUB_OUTPUT"' EXIT + # declare -a failed_plugins=() + # for dir in ./*/; do + # current_folder=$(basename "$dir") + # if [[ $current_folder == "plugin_globals" ]]; then + # continue + # fi + # cd $current_folder/integration + # docker compose down --remove-orphans + # docker compose build + # if docker compose run tests; then + # echo "plugin $current_folder passed integration test check" + # else + # echo "plugin $current_folder failed integration test check" + # failed_plugins+=("$current_folder") + # fi + # cd ../.. + # done + # echo integration_test_plugins=${failed_plugins[*]} >> $GITHUB_OUTPUT #---------------------------------------------- # Integration Test Failure Check #---------------------------------------------- @@ -295,9 +295,9 @@ jobs: echo "$body" | cat - RELEASES.md > temp && mv temp RELEASES.md # Check if there are any upgrades - upgraded_plugins=$(python repo_manager.py 5) - has_upgrades=false + upgraded_plugins=($(python repo_manager.py 5)) + has_upgrades=false for plugin in ${potential_upgrades[@]}; do for upgrade in ${upgraded_plugins[@]}; do if [[ $plugin == *"$upgrade"* ]]; then @@ -317,10 +317,14 @@ jobs: # Update the release notes with the upgraded plugins - details="Plugins upgraded this release: " - for plugin in ${upgraded_plugins}; do - details="$details $plugin" + details=$(printf 'Plugins upgraded this release: \n\t - ') + + count=${#upgraded_plugins[*]} + for i in $(seq 0 "$(("$count" - 2))" ); + do + details=$(printf '%s %s \n\t - ' "$details" "${upgraded_plugins[$i]}") done + details=$(printf '%s %s \n' "$details" "${upgraded_plugins[$count - 1]}") # Replace the first occurence of ' - ' with the details diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index adfbba73a..870e38496 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -106,12 +106,15 @@ jobs: # Get the release notes body=$(python repo_manager.py 4) + upgraded_plugins=($(python repo_manager.py 5)) + details=$(printf 'Plugins upgraded this release: \n\t - ') - details="Plugins upgraded this release: " - upgraded_plugins=$(python repo_manager.py 5) - for plugin in ${upgraded_plugins}; do - details="$details $plugin" + count=${#upgraded_plugins[*]} + for i in $(seq 0 "$(("$count" - 2))" ); + do + details=$(printf '%s %s \n\t - ' "$details" "${upgraded_plugins[$i]}") done + details=$(printf '%s %s \n' "$details" "${upgraded_plugins[$count - 1]}") # Set the outputs @@ -131,7 +134,7 @@ jobs: with: token: ${{ secrets.BOT_PR_PAT }} name: ${{ steps.prepare_release.outputs.tag }} - body: ${{ steps.prepare_release.outputs.body }} + body: ${{ steps.prepare_release.outputs.release_body }} tag_name: ${{ steps.prepare_release.outputs.tag }} prerelease: false diff --git a/repo_manager.py b/repo_manager.py index 7e96866b0..23ed88c0d 100644 --- a/repo_manager.py +++ b/repo_manager.py @@ -434,8 +434,11 @@ def main(arg_1 = None): new_plugins = [plugin for plugin in all_plugins if plugin not in released_plugins] for plugin in new_plugins: plugins_on_old_release.append(plugin) - [print(plugin) for plugin in plugins_on_old_release] + output = "" + for plugin in plugins_on_old_release: + output += f'{plugin} ' + print(output) elif selection == "6": print("Exiting...") exit(0)