Skip to content
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 20 commits into from
Aug 23, 2024

Conversation

fbm3307
Copy link
Contributor

@fbm3307 fbm3307 commented Jul 19, 2024

This second part of dependency check

There is a makefile target that validates compatibility of the local version in other repositories that rely on them

Similar-Related PR in API - codeready-toolchain/api#437

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.54%. Comparing base (6a52cb3) to head (c990dbc).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #417   +/-   ##
=======================================
  Coverage   78.54%   78.54%           
=======================================
  Files          49       49           
  Lines        2023     2023           
=======================================
  Hits         1589     1589           
  Misses        376      376           
  Partials       58       58           

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Looks good! I've tried it and it seems to be working now 👍

I was wondering if we should place this script in toolchain-cicd and download it here and in api at runtime, since the api pr contains similar/same code if I'm not wrong.

verify-replace.sh Outdated Show resolved Hide resolved
verify-replace.sh Outdated Show resolved Hide resolved
verify-replace.sh Outdated Show resolved Hide resolved
verify-replace.sh Outdated Show resolved Hide resolved
verify-replace.sh Outdated Show resolved Hide resolved
verify-replace.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@ranakan19 ranakan19 left a comment

Choose a reason for hiding this comment

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

Looks good overall, left a few comments.
Does it delete the tmp folder after running the command? if not, can we consider adding it?

Signed-off-by: Feny Mehta <[email protected]>
@fbm3307
Copy link
Contributor Author

fbm3307 commented Aug 13, 2024

Looks good overall, left a few comments. Does it delete the tmp folder after running the command? if not, can we consider adding it?

it is automatically removed/deleted once the system restarts.. i did consider adding a delete command.. but that becomes a bit risky, incase that folder is not found .. and hence wanted to avoid it and use this..

@fbm3307
Copy link
Contributor Author

fbm3307 commented Aug 13, 2024

I was wondering if we should place this script in toolchain-cicd and download it here and in api at runtime, since the api pr contains similar/same code if I'm not wrong.

The code is almost same, the difference is in the replace command and api has one more repo toolchain common to run the verify on .. but thought about keeping them in their respective repos for now

@mfrancisc
Copy link
Contributor

The code is almost same, the difference is in the replace command and api has one more repo toolchain common to run the verify on .. but thought about keeping them in their respective repos for now

Ok makes sense for now to keep them both in their respective repos, and we can see how they evolve later on. Thanks 👍

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

The code looks good and works fine on my machine 👍

I have a couple of questions:

  • should we place the script inside some folder , maybe create a scripts folder or a subfolder in make/scripts/verify-replace.sh if it's simpler to execute from there.

  • what is the plan for adding this check to the GH CI, will that be done in follow up PRs ?

@fbm3307
Copy link
Contributor Author

fbm3307 commented Aug 13, 2024

  • should we place the script inside some folder , maybe create a scripts folder or a subfolder in make/scripts/verify-replace.sh if it's simpler to execute from there.*

That can be done.

  • what is the plan for adding this check to the GH CI, will that be done in follow up PRs ? *

this same script should work when called from github actions.. i intend to test this for CI and add this to the CI for each new PR

Signed-off-by: Feny Mehta <[email protected]>
@fbm3307 fbm3307 requested a review from mfrancisc August 14, 2024 13:25
Copy link
Contributor

@ranakan19 ranakan19 left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments, looks good to me

@mfrancisc
Copy link
Contributor

this same script should work when called from github actions.. i intend to test this for CI and add this to the CI for each new PR

thanks for the clarification. Thus you are planning to update the GH CI job in this PR.

@fbm3307
Copy link
Contributor Author

fbm3307 commented Aug 19, 2024

thanks for the clarification. Thus you are planning to update the GH CI job in this PR.

I was thinking to take that as a separate PR.

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Looks good 👍

Thanks for addressing my comments and answering my questions 🙏

Copy link
Contributor

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

Looks good, a few comments

scripts/verify-replace.sh Outdated Show resolved Hide resolved
scripts/verify-replace.sh Outdated Show resolved Hide resolved
scripts/verify-replace.sh Outdated Show resolved Hide resolved
for e in ${ERRORLIST[*]}
do
echo "$e"
done
Copy link
Contributor

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?

Copy link
Contributor Author

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 🤔

Copy link
Contributor

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated it

Signed-off-by: Feny Mehta <[email protected]>
Signed-off-by: Feny Mehta <[email protected]>
Copy link

sonarcloud bot commented Aug 23, 2024

Copy link
Contributor

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

Nice 👍

@MatousJobanek MatousJobanek merged commit cd921d6 into codeready-toolchain:master Aug 23, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants