Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions .github/workflows/enos-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: '0'
fetch-depth: '1'
fet-tags: true
Comment thread
dillanb-hashi marked this conversation as resolved.
Outdated
- name: Determine Go version
id: get-go-version
# We use .go-version as our source of truth for current Go
Expand Down Expand Up @@ -100,6 +101,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: '0'
Comment thread
dillanb-hashi marked this conversation as resolved.
Outdated
Comment thread
dillanb-hashi marked this conversation as resolved.
Outdated
- name: Determine Go version
id: get-go-version
# We use .go-version as our source of truth for current Go
Expand Down Expand Up @@ -265,12 +268,37 @@ jobs:
enos scenario check --chdir ./enos ${{ matrix.filter }} && \
enos scenario exec --chdir ./enos ${{ matrix.filter }} --cmd "version"
- name: Determine boundary version to test against previous worker version
# Get the Boundary version number and decrement the minor version by 1
# Resolve the worker version from the previous release line.
if: contains(matrix.filter, 'e2e_docker_base_with_worker_version')
run: |
version_num=$(./enos/support/boundary/boundary version | awk -F'[. ]' '/Version Number/ {print $(NF-1)}')
export ENOS_VAR_worker_version="$((version_num - 1))"
echo "ENOS_VAR_worker_version=0.$ENOS_VAR_worker_version" >> "$GITHUB_ENV"
current_version_raw=$(./enos/support/boundary/boundary version | awk '/Version Number/ {print $3}')
current_version="${current_version%%[-+]*}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this this handles boundary versions coming from boundary-enterprise (i.e. 0.21.2+ent), but I don't think we're handling this with tags?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current_version_raw outputs 0.21.0+ent line 275 takes out the +ent. Line 274 probably isn't needed though.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. That's the output of boundary version. But when you're looking up the tags later on, boundary-enterprise has tags with v#.#.#+ent

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes. I'll test this in the ent branch as well to make sure I can get the right version. We handle adding the +ent in the enos scenario I'm pretty sure so it should strip the +ent from the git tags when it's parsing through that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might be confusing myself.

  • For this workflow, this probably works ok.
  • We will need to update enos-run-ent.yml accordingly. We should specifically match against +ent tags there as there may be some versions only available in enterprise.

Comment thread
dillanb-hashi marked this conversation as resolved.
Outdated

if ! [[ "$current_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Unable to parse Boundary version: $current_version_raw" >&2
exit 1
fi

IFS='.' read -r current_major current_minor current_patch <<< "$current_version"

all_semver_tags=$(git tag -l | sed 's/^v//' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' || true)

previous_version=""
if [ "$current_minor" -gt 0 ]; then
target_minor=$((current_minor - 1))
previous_version=$(echo "$all_semver_tags" | grep -E "^${current_major}\.${target_minor}\.[0-9]+$" | sort -V | tail -n1 || true)
fi
if [ -z "$previous_version" ] && [ "$current_major" -gt 0 ]; then
target_major=$((current_major - 1))
previous_version=$(echo "$all_semver_tags" | grep -E "^${target_major}\.[0-9]+\.[0-9]+$" | sort -V | tail -n1 || true)
fi

if [ -z "$previous_version" ]; then
echo "No previous release line found for current version $current_version" >&2
exit 1
fi

echo "ENOS_VAR_worker_version=$previous_version" >> "$GITHUB_ENV"
- name: Run Enos scenario
id: run
# Continue once and retry
Expand Down
Loading