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

feat: addpkg command respects gno.mod file #922

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

harry-hov
Copy link
Contributor

@harry-hov harry-hov commented Jun 21, 2023

BREAKING CHANGE: removed flag -pkgPath from addpkg command

Since PR #763 we are parsing pkg path from gno.mod file while auto loading pkgs from /examples dir.
Replicate the same behavior for gnokey maketx addpkg ...

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@harry-hov harry-hov requested review from jaekwon, moul and a team as code owners June 21, 2023 14:38
@github-actions github-actions bot added 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related labels Jun 21, 2023
@harry-hov harry-hov marked this pull request as draft June 21, 2023 19:34
@harry-hov harry-hov force-pushed the hariom/addpkg-respect-gnomod branch from 43104e0 to 1dd9130 Compare June 21, 2023 20:41
@harry-hov harry-hov marked this pull request as ready for review June 21, 2023 20:52
@tbruyelle
Copy link
Contributor

@harry-hov do you think the same behavior should be applied for gno test ? That could help for #896.

@harry-hov
Copy link
Contributor Author

harry-hov commented Jun 22, 2023

@harry-hov do you think the same behavior should be applied for gno test ? That could help for #896.

Yeah. I planned to do this in #682. But now I will open a separate PR for that. That will act as a preparatory PR for both #896 and #682. (maybe by tomorrow)

@tbruyelle
Copy link
Contributor

Yeah. I planned to do this in #682. But now I will open a separate PR for that. That will act as a preparatory PR for both #896 and #682. (maybe by tomorrow)

Awesome thank you

gnovm/pkg/gnomod/parse.go Outdated Show resolved Hide resolved
gnovm/pkg/gnomod/parse.go Outdated Show resolved Hide resolved
Comment on lines 69 to 71
if cfg.pkgPath == "" {
return errors.New("pkgpath not specified")
}
Copy link
Member

Choose a reason for hiding this comment

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

we can make the migration smoother by just adding a warning here with a comment to remove later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry. i didn't get it. what kind of warning?

I think we should also maintain a CHANGELOG and LongHelp?

tm2/pkg/crypto/keys/client/common.go Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Jun 23, 2023

gno "github.com/gnolang/gno/gnovm/pkg/gnolang"
"github.com/gnolang/gno/gnovm/pkg/gnomod"
Copy link
Member

Choose a reason for hiding this comment

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

This one is forbidden.

Maybe we should wait for TM2 split PR started by @piux2, then you'll have the AddPkg not in tm2 anymore, but in gno.land.

@harry-hov, what about trying to help @piux2 finishing his PR first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tm2 already imports gnovm[github.com/gnolang/gno/gnovm](see the line above).

maybe we can let this one slide and will be fixed with TM2 split?

Copy link
Member

Choose a reason for hiding this comment

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

the split is finalised so the problematic import can be fixed, please merge master :)

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 48.81%. Comparing base (155aba4) to head (e71b88f).
Report is 3 commits behind head on master.

Files Patch % Lines
gno.land/pkg/keyscli/addpkg.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #922   +/-   ##
=======================================
  Coverage   48.81%   48.81%           
=======================================
  Files         579      579           
  Lines       78045    78041    -4     
=======================================
- Hits        38099    38098    -1     
+ Misses      36860    36857    -3     
  Partials     3086     3086           
Flag Coverage Δ
gno.land 61.64% <50.00%> (-0.04%) ⬇️
gnovm 42.02% <ø> (ø)
misc/autocounterd 0.00% <ø> (ø)
misc/genproto 0.00% <ø> (ø)
misc/genstd 73.90% <ø> (ø)
misc/goscan 0.00% <ø> (ø)
misc/logos 17.68% <ø> (+0.30%) ⬆️
misc/loop 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Nov 27, 2023
@harry-hov harry-hov requested a review from a team November 27, 2023 13:37
@harry-hov harry-hov requested a review from piux2 as a code owner February 8, 2024 16:03
@github-actions github-actions bot removed the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Feb 8, 2024
@harry-hov harry-hov marked this pull request as draft February 8, 2024 16:27
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Feb 8, 2024
@harry-hov harry-hov marked this pull request as ready for review February 8, 2024 17:36
@harry-hov harry-hov requested review from gfanton and a team as code owners February 8, 2024 17:36
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

Catching up on old items in the queue. Sorry for the delay.

The changes LGTM though I personally think it would be better to have pkgpath still be a flag, which defaults to the value in gno.mod if not set.

My rationale: gnokey is primarily a tool to interact with the gno.land blockchain, and while gno.mod is a very important tool in local development, it is not essential to publish a package. So, in the way I see it, gnokey should essentially be the bare tool to create a transaction, with sane defaults like this one, but without asserting that gno.mod is a requirement.

What do you think?

@harry-hov
Copy link
Contributor Author

Catching up on old items in the queue. Sorry for the delay.

Sorry for the delay in reply as well.

The changes LGTM though I personally think it would be better to have pkgpath still be a flag, which defaults to the value in gno.mod if not set.

I agree 💯 (but...)

My rationale: gnokey is primarily a tool to interact with the gno.land blockchain, and while gno.mod is a very important tool in local development, it is not essential to publish a package. So, in the way I see it, gnokey should essentially be the bare tool to create a transaction, with sane defaults like this one, but without asserting that gno.mod is a requirement.

My vision is to make gno.mod more inclusive. Let's take an example of the versioning PR #1631, which will also make gno.mod mandatory. If we all agree on having gno.mod on-chain at some point, then I think this is the right direction to make gno.mod a habit. Otherwise, we can proceed with what you suggested. Thoughts?

@zivkovicmilos
Copy link
Member

@harry-hov
What is the status of this PR?

@harry-hov
Copy link
Contributor Author

@zivkovicmilos last I remember, it was ready for review.

Seems like now i need to fix merge conflicts. Will do this soon!

@harry-hov harry-hov force-pushed the hariom/addpkg-respect-gnomod branch from a4260fc to d14ea00 Compare May 15, 2024 08:54
@harry-hov harry-hov requested review from deelawn, mvertes and a team as code owners May 15, 2024 08:54
@harry-hov harry-hov force-pushed the hariom/addpkg-respect-gnomod branch from d14ea00 to e71b88f Compare May 15, 2024 09:27
@Kouteki Kouteki assigned Kouteki and unassigned harry-hov Jun 14, 2024
@Kouteki Kouteki marked this pull request as draft June 14, 2024 09:21
@ajnavarro ajnavarro self-assigned this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: To triage
Status: No status
Status: 🌟 Wanted for Launch
Status: No status
Status: Backlog
Development

Successfully merging this pull request may close these issues.

7 participants