diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index bfbc2bb..07cb206 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -55,7 +55,7 @@ on: If setting to a pull request, caller is responsible for verifying the user is a trusted user. secrets: - # NOTE(komish): Not technically secret, but must be listed as a secret + # bot-name is not technically secret, but must be listed as a secret # because you can't pass the ${{ secrets }} context as an input in the # calling workflow, and our repos have this configured as a secret. bot-name: @@ -80,14 +80,23 @@ jobs: repository: ${{ inputs.checkout-repository }} fetch-depth: ${{ inputs.checkout-fetch-depth }} - name: find features + # Find the feature files currently defined in repo. We expect to find at + # least 15 files, though that number is arbitrarily chosen at a figure + # below the actual count at the time of this writing (19). + # + # The expectation is that all behave tests are expected to exist at this + # path. id: find-features - # TODO(JOSE) Sanity check - make sure this is more than one feature in length. run: | + set -e cd tests/functional/behave_features - # echo features=$(find . -name '*.feature' | sed -e 's%\./%%g' | jq -R -s -c 'split("\n") | del(.[] | select(length == 0))') | tee -a $GITHUB_OUTPUT - # NOTE(JOSE): temporarily restrict this to a small number of tests for debugging other things. - # To Revert: remove the next line, and uncomment the line previous this comment. - echo features=$(find . -name '*.feature' | sed -e 's%\./%%g' | jq -R -s -c 'split("\n") | del(.[] | select(length == 0))[:2]') | tee -a $GITHUB_OUTPUT + features=$(find . -name '*.feature' | sed -e 's%\./%%g' | jq -R -s -c 'split("\n") | del(.[] | select(length == 0))') + echo "Found feature files: ${features}" + echo "Running sanity checks." + echo "${features}" | jq --exit-status 'type == "array"' + echo "${features}" | jq --exit-status 'length > 15' + echo "Sanity checks done." + echo "features=${features}" | tee -a $GITHUB_OUTPUT run-tests: runs-on: ubuntu-latest needs: [get-features] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26cf05c..f5f0ae8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: user: ${{ github.event.pull_request.user.login }} determine-workflow-conditions: - name: Workflow Test + name: Determine Workflow Conditions needs: [check-contributor] runs-on: ubuntu-22.04 if: | @@ -26,7 +26,7 @@ jobs: outputs: run-tests: ${{ steps.check_request.outputs.run-tests }} is-charts-release-branch: ${{ steps.check_if_release_pr.outputs.charts_release_branch }} - test-tags: ${{ needs.determine-workflow-conditions.outputs.test-tags }} + test-tags: ${{ steps.determine-test-tags.outputs.test-tags }} steps: - name: Checkout uses: actions/checkout@v4 @@ -117,7 +117,9 @@ jobs: needs.determine-workflow-conditions.outputs.run-tests == 'true' uses: ./.github/workflows/behave.yml with: - tags: ${{ needs.determine-workflow-conditions.outputs.test-tags }} + # Default tags to 'full' if test-tags is unset for any reason by the time + # we get here. + tags: ${{ needs.determine-workflow-conditions.outputs.test-tags || 'full' }} behave-logging-level: WARNING pr-body: "Test triggered by release PR ${{ github.event.pull_request.html_url }}." # checkout parameters passed to ensure we're testing the release content diff --git a/scripts/foo.sh b/scripts/foo.sh new file mode 100644 index 0000000..8beead7 --- /dev/null +++ b/scripts/foo.sh @@ -0,0 +1,3 @@ +#! /usr/bin/env bash + +echo "Fake change for dev testing 1.99.101" \ No newline at end of file diff --git a/scripts/src/release/releaser.py b/scripts/src/release/releaser.py index 24e1b1e..efcf82b 100644 --- a/scripts/src/release/releaser.py +++ b/scripts/src/release/releaser.py @@ -37,33 +37,6 @@ STAGE_PR_BRANCH_BODY_PREFIX = "Workflow and script updates from development repository" STAGE_PR_BRANCH_NAME_PREFIX = "Release-" -# SCHEDULE_INSERT = [ -# " # Daily trigger to check updates", -# " schedule:", -# ' - cron: "0 0 * * *"', -# ] - -# (JOSE) Marked for removal. This function (and call locations) modify -# version_check.yml which will be removed. -# def update_workflow(): -# lines = [] -# with open(VERSION_CHECK_YAML_FILE, "r") as schedule_file: -# lines = schedule_file.readlines() - -# for line in lines: -# if line.strip() == "on:": -# insert_location = lines.index(line) + 1 -# if SCHEDULE_INSERT[0] not in lines[insert_location].rstrip(): -# print("[INFO] add cron job to schedule.yaml") -# lines.insert(insert_location, f"{SCHEDULE_INSERT[0]}\n") -# lines.insert(insert_location + 1, f"{SCHEDULE_INSERT[1]}\n") -# lines.insert(insert_location + 2, f"{SCHEDULE_INSERT[2]}\n") -# break - -# with open(VERSION_CHECK_YAML_FILE, "w") as schedule_file: -# schedule_file.write("".join(lines)) - - def make_required_changes(release_info_dir, origin, destination): print(f"Make required changes from {origin} to {destination}") @@ -207,9 +180,6 @@ def main(): print("edit files in charts") os.chdir(args.charts_dir) - # (JOSE) Marked for removal. This function (and call locations) modify - # version_check.yml which will be removed. - # update_workflow() organization = args.target_repository.split("/")[0] charts_repository = f"{organization}{gitutils.CHARTS_REPO}"