-
Notifications
You must be signed in to change notification settings - Fork 22
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
KUBESAW-129: Makefile target to check compatibility of local version with other repos #417
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
855c3e9
KUBESAW-129: Makefile target to checck compatibility of local version…
fbm3307 7c8bea5
Merge branch 'master' into ks129mktc
fbm3307 b974659
add verify
fbm3307 12b3cb4
Merge branch 'master' into ks129mktc
fbm3307 1304ff5
some better way to run it
fbm3307 0e6437d
Merge branch 'master' into ks129mktc
fbm3307 4ec5a8d
review
fbm3307 57743a3
changes
fbm3307 47b75ac
Merge branch 'master' into ks129mktc
MatousJobanek 62434ae
changing it to shell script
fbm3307 aa86845
converting to shell script,adding error repo names
fbm3307 60aee1f
adding few comments
fbm3307 6f451ef
cosmetic changes
fbm3307 0c427bc
review comments
fbm3307 d761329
adding the scripts folder
fbm3307 be5e206
Merge branch 'master' into ks129mktc
ranakan19 8e66d53
Merge branch 'master' into ks129mktc
mfrancisc f6048a0
review comments-3
fbm3307 5730b0e
exit status
fbm3307 c990dbc
Merge branch 'master' into ks129mktc
MatousJobanek 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 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 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
TMP_DIR=/tmp/ | ||
BASE_REPO_PATH=$(mktemp -d ${TMP_DIR}replace-verify.XXX) | ||
GH_BASE_URL_KS=https://github.com/kubesaw/ | ||
GH_BASE_URL_CRT=https://github.com/codeready-toolchain/ | ||
declare -a REPOS=("${GH_BASE_URL_KS}ksctl" "${GH_BASE_URL_CRT}host-operator" "${GH_BASE_URL_CRT}member-operator" "${GH_BASE_URL_CRT}registration-service" "${GH_BASE_URL_CRT}toolchain-e2e") | ||
C_PATH=${PWD} | ||
ERRORLIST=() | ||
|
||
echo Initiating verify-replace on dependent repos | ||
for repo in "${REPOS[@]}" | ||
do | ||
echo ========================================================================================= | ||
echo | ||
echo "$(basename ${repo})" | ||
echo | ||
echo ========================================================================================= | ||
repo_path=${BASE_REPO_PATH}/$(basename ${repo}) | ||
echo "Cloning repo in /tmp" | ||
git clone --depth=1 ${repo} ${repo_path} | ||
echo "Repo cloned successfully" | ||
cd ${repo_path} | ||
echo "Initiating 'go mod replace' of current toolchain common version in dependent repos" | ||
go mod edit -replace github.com/codeready-toolchain/toolchain-common=${C_PATH} | ||
make verify-dependencies || ERRORLIST+="($(basename ${repo}))" | ||
echo | ||
echo ========================================================================================= | ||
echo | ||
done | ||
if [ ${#ERRORLIST[@]} -ne 0 ]; then | ||
echo "Below are the repos with error: " | ||
for e in ${ERRORLIST[*]} | ||
do | ||
echo "${e}" | ||
done | ||
exit 1 | ||
else | ||
echo "No errors detected" | ||
fi |
Oops, something went wrong.
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.
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.
we should exit with a non-zero value if something failed, right?
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.
not sure if we require the non zero exit here ?,
here we are just displaying the error repo names, and error list is already being checked if its empty or not , so my understanding was we dont require exit here.?
Probably i am missing something here 🤔
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.
if one of the verification failed, then we want the whole makefile target to return non-zero value (in other words let it fail as well)
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.
updated it