-
Notifications
You must be signed in to change notification settings - Fork 548
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
fix(starport/services/chain): change tag and commit info when starport build #1560
Conversation
Thanks for the PR, @fly33499! We'll review it shortly 👍 |
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.
@fly33499 thanks for the contribution
I made some tests here, and it's not working. I created a simple example to understand whats happened, and it seems not working too. Can you check your implementation, please?
Here is my example based on yours:
https://gist.github.com/Pantani/8118918fc76782a3d3d19f37f0b51765
thanks for this contribution @fly33499 |
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.
Hey @fly33499 thank you for taking a lead on this!
For an overkill solution, I think we should implement the equivalent of the following, programmatically, without depending on the git binary.
- HASH:
git rev-parse HEAD
Hash is the hash of the latest commit in the currently checked out branch. (not the hash number of tag)
- TAG:
git describe --tags
Always returns a semantic version. Similar to hash, it's relative to the currently checked out branch. It can output in two different formats:
v0.17.3: if there are no new commits added after tag is created.
v0.17.3-92-g48a13cc2: if there are new commits added after the tag is created. for this case, 92
is the number of commits created after v0.17.3 tag. And 48a13cc2
is the short version of the latest commit's hash.
I think this is the most precise way of determining both HASH and TAG. Specially for TAG, in case user may forget creating a new tag before running starport build
, TAG output will show the exact semantic version by including the commit count and latest commit hash. Otherwise, it would always be showing the latest tag in the repo.
@fly33499 please let me know what do you think on this.
Commit suggestion Co-authored-by: Danilo Pantani <[email protected]>
Sort tag between annotated and lightweight tag
chore(services/chain): add unit test for determining app version
Co-authored-by: İlker G. Öztürk <[email protected]>
Co-authored-by: İlker G. Öztürk <[email protected]>
Co-authored-by: İlker G. Öztürk <[email protected]>
I think it's nice to keep the tests tho, but we need to figure out what's that funny error msg is about. |
@fly33499 maybe we can create a new pkg as starport/pkg/repoversion and create a func called then so we can keep the chain.go simple. |
Got it. I've just added and commit again. Could you check again? I've learned a lot of things from this project. Thanks a lot!! |
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.
LGTM! 🍻
Co-authored-by: İlker G. Öztürk <[email protected]>
Co-authored-by: İlker G. Öztürk <[email protected]>
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.
Thank you for review
Merged ~ thank you @fly33499! |
…t build (ignite#1560) * change tag and commit info when starport build * Fix tag sort issue by tagger info * Update starport/services/chain/chain.go Commit suggestion Co-authored-by: Danilo Pantani <[email protected]> * chore(services/chain): add unit test for determining app version * Improve tag versioning and commit info Sort tag between annotated and lightweight tag * remove v character on tag * Update starport/services/chain/chain_test.go Co-authored-by: İlker G. Öztürk <[email protected]> * Update starport/services/chain/chain_test.go Co-authored-by: İlker G. Öztürk <[email protected]> * Update starport/services/chain/chain_test.go Co-authored-by: İlker G. Öztürk <[email protected]> * change tag output without commit count * remove test code * update testcase and untar option * add repoversion pkg to determine version * Update starport/pkg/repoversion/repoversion.go Co-authored-by: İlker G. Öztürk <[email protected]> * Update starport/services/chain/chain_test.go Co-authored-by: İlker G. Öztürk <[email protected]> Co-authored-by: Danilo Pantani <[email protected]> Co-authored-by: İlker G. Öztürk <[email protected]>
I request to change tag and commit info when run starport chain build.
My testing scenario is here.
If I wanted to make tag v0.2.3, I used "git tag-d" command to erase the rest of the tag T.T.
And I was confused because the tag hash was different from the information on github.
So, from my point of view, I have modified the code like this and I am going to make a full request for this part. (added comment )
The code was modified to conduct a build test, and the desired result was obtained.
Please consider and check my opinion.