-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Forward port Lint Version script fixes #1008
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
Merged
feast-ci-bot
merged 1 commit into
feast-dev:master
from
mrzzy:forward-port-lint-version
Sep 21, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ | |
| # versions against the given merge branch. | ||
| set -e | ||
|
|
||
| source infra/scripts/setup-common-functions.sh | ||
|
|
||
| # Fetch tags and current branch | ||
| git fetch --prune --unshallow --tags || true | ||
| BRANCH_NAME=${TARGET_MERGE_BRANCH-$(git rev-parse --abbrev-ref HEAD)} | ||
|
|
@@ -32,8 +34,8 @@ then | |
| elif echo "$BRANCH_NAME" | grep -P $RELEASE_BRANCH_REGEX &>/dev/null | ||
| then | ||
| # Use last release tag tagged on the release branch | ||
| LAST_MERGED_TAG=$(git tag -l --sort -version:refname --merged | head -n 1) | ||
| FEAST_MASTER_VERSION=${LAST_MERGED_TAG#"v"} | ||
| LAST_MERGED_TAG=$(get_tag_release -m) | ||
| FEAST_RELEASE_VERSION=${LAST_MERGED_TAG#"v"} | ||
| else | ||
| # Do not enforce version linting as we don't know if the target merge branch FEAST_RELEASE_VERSION="_ANY" | ||
| FEAST_RELEASE_VERSION="_ANY" | ||
|
|
@@ -52,12 +54,12 @@ STABLE_TAG_REGEX="^v[0-9]+\.[0-9]+\.[0-9]+$" | |
| if [ $BRANCH_NAME = "master" ] | ||
| then | ||
| # Use last stable tag repo wide | ||
| LAST_STABLE_TAG=$(git tag --sort -version:refname | grep -P "$STABLE_TAG_REGEX" | head -n 1) | ||
| LAST_STABLE_TAG=$(get_tag_release -s) | ||
| FEAST_STABLE_VERSION=${LAST_STABLE_TAG#"v"} | ||
| elif echo "$BRANCH_NAME" | grep -P $RELEASE_BRANCH_REGEX &>/dev/null | ||
| then | ||
| # Use last stable tag tagged on the release branch | ||
| LAST_STABLE_MERGE_TAG=$(git tag --sort -version:refname --merged | grep -P "$STABLE_TAG_REGEX" | head -n 1) | ||
| LAST_STABLE_MERGE_TAG=$(get_tag_release -sm) | ||
| FEAST_STABLE_VERSION=${LAST_STABLE_MERGE_TAG#"v"} | ||
| else | ||
| # Do not enforce version linting as we don't know if the target merge branch | ||
|
|
@@ -100,7 +102,6 @@ declare -a files_to_validate_version=( | |
| "docs/contributing/development-guide.md,4,${FEAST_MASTER_VERSION}" | ||
| "docs/administration/audit-logging.md,1,${FEAST_STABLE_VERSION}" | ||
| "docs/getting-started/deploying-feast/docker-compose.md,1,${FEAST_STABLE_VERSION}" | ||
| "docs/getting-started/deploying-feast/kubernetes.md,1,${FEAST_STABLE_VERSION}" | ||
| "README.md,1,${FEAST_STABLE_VERSION}" | ||
| "CHANGELOG.md,2,${FEAST_STABLE_VERSION}" | ||
| ) | ||
|
|
@@ -123,7 +124,7 @@ for i in "${files_to_validate_version[@]}"; do | |
| echo "Testing whether versions are correctly set within file: $FILE_PATH" | ||
| ACTUAL_OCCURRENCES=$(grep -c -P "\bv?$VERSION\b" "$FILE_PATH" || true) | ||
|
|
||
| if [ "${ACTUAL_OCCURRENCES}" -eq "${EXPECTED_OCCURRENCES}" ]; then | ||
| if [ "${ACTUAL_OCCURRENCES}" -ge "${EXPECTED_OCCURRENCES}" ]; then | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actual occurrences is greater than that expected occurrences when both pom.xml and tag versions the same. This is not a issue when pom.xml version is SNAPSHOT, but when its not in SNAPSHOT form, lint version scripts will flag extra occurrences and fail. |
||
| echo "OK: Expecting $EXPECTED_OCCURRENCES occurrences of '$VERSION' in $FILE_PATH, and found $ACTUAL_OCCURRENCES" | ||
| else | ||
| echo "FAIL: Expecting $EXPECTED_OCCURRENCES occurrences of '$VERSION' in $FILE_PATH, but found $ACTUAL_OCCURRENCES" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
[[ "${VERSION_WITHOUT_PREFIX}" == "${HIGHEST_SEMVER_TAG:1}" ]]?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[]implies thetestcommand. According to its manpage, it uses single=for string comparison.