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

ci(weaver): update network-setups fabric setupCC.sh #3680

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dnakashima
Copy link

Fixes #3679

Pull Request Requirements

  • Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.

@dnakashima dnakashima changed the title <bug>[waver]update network-setups fabric setupCC.sh bug[waver]update network-setups fabric setupCC.sh Dec 9, 2024
@dnakashima
Copy link
Author

dnakashima commented Dec 9, 2024

The reason why this error is that variable "CACTI_VERSION" is not correct. So this patch can get latest version of Cacti from VERSION file.

@dnakashima dnakashima changed the title bug[waver]update network-setups fabric setupCC.sh bug[weaver]update network-setups fabric setupCC.sh Dec 9, 2024
@dnakashima dnakashima changed the title bug[weaver]update network-setups fabric setupCC.sh fix[weaver]update network-setups fabric setupCC.sh Dec 9, 2024
@dnakashima dnakashima changed the title fix[weaver]update network-setups fabric setupCC.sh fix(weaver)update network-setups fabric setupCC.sh Dec 9, 2024
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@dnakashima LGTM with comments ^^

@@ -4,7 +4,7 @@

directory=$(dirname $0)

CACTI_VERSION=v2.0.0
CACTI_VERSION="v$(head -n 1 $PWD/../../../../core/network/fabric-interop-cc/contracts/interop/VERSION)"
Copy link
Contributor

@petermetz petermetz Dec 9, 2024

Choose a reason for hiding this comment

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

@dnakashima This seems to hardcode the behavior in way that forces people to run the script only from a specific given sub-directory.

What that means is that if I ran this script from the project root like

$ ./weaver/tests/network-setups/fabric/dev/scripts/setupCC.sh

Then it would crash with some error that it can't find the VERSION because the $PWD would evaluate to the project root and then your ../../../../ would just point to some random, non-existent directory path on my file-system outside of the cacti project sources.

What I recommend to fix this is to anchor the paths to the path of the script itself the way the ci.sh script does it:

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

After which you can reach the version file like "$SCRIPT_DIR/../../../../core/network/fabric-interop-cc/contracts/interop/VERSION' (or something similar) and with this way the script will function correctly regardless of which directory my shell was in at the time of the script invocation.

I wrote all this code just from memory so there might be issues with it, but please let me know what you think!

cc: @VRamakrishna @sandeepnRES

Copy link
Author

@dnakashima dnakashima Dec 10, 2024

Choose a reason for hiding this comment

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

@petermetz Thank you for your comment. I did not consider the directory where setupCC.sh is called. So I modify how to get the path of setupCC.sh.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dnakashima My pleasure! Thank you for the improvements!

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@dnakashima Please correct the commit subject to appease the linter. I also recommend using the commit type build or ci or test instead of fix because fix implies a fix in the production code.

@petermetz
Copy link
Contributor

@dnakashima Please also squash the commits together and make sure that the commit subject and the PR title are consistent. Right now there are multiple commits and they both have invalid commit subjects.

image

@dnakashima dnakashima changed the title fix(weaver)update network-setups fabric setupCC.sh ci(weaver)update network-setups fabric setupCC.sh Dec 17, 2024
Signed-off-by: Daiki.Nakashima <Nakashima.Daiki@df.MitsubishiElectric.co.jp>
@dnakashima
Copy link
Author

@petermetz Thank you for your comment again. I squashed 2 commits and modified the PR title and commit message. So please check it.

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@dnakashima Thank you for the updates. The commit linter is still failing, please fix that as well.

@dnakashima dnakashima changed the title ci(weaver)update network-setups fabric setupCC.sh ci(github)update network-setups fabric setupCC.sh Dec 18, 2024
@dnakashima dnakashima changed the title ci(github)update network-setups fabric setupCC.sh ci(weaver): update network-setups fabric setupCC.sh Dec 18, 2024
@dnakashima
Copy link
Author

@petermetz I have added "colon" and space to the title after prefix and then linter was OK. Please check it again.

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.

bug(weaver-networksetups-fabric): issues with fabric sample network
3 participants