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: Set neuron visibility. #239

Conversation

daniel-wong-dfinity-org
Copy link
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org commented Aug 16, 2024

Description

Added --set-visibility flag to quill neuron-manage. Takes one of two possible values: public or private.

In a separate commit, updated this repo to point to a more recent commit in the ic repo.

Added a script to make the aforementioned chore easier.

Closes NNS1-3275.

How Has This Been Tested?

Added set_visibility test.

Checklist

  • I have made corresponding changes to the documentation in docs/cli-reference.
  • I have added corresponding integration tests.

…s is not the latest, but is more recent. Trying to use the latest one gave me problems.

Anyway, a couple areas in our code then needed to be updated in response:

1. The way we explain proposals. This is implemented in src/lib/format/nns_governance.rs. (Having to hand craft humanization code does not seem very scalable. I think a better approach would be to instead just do format!("(:?}", proposal). This is maybe not as human-friendly, but it would never require us to hand craft humanization code.)

2. This resulted in some minor changes to the way the tool previews what the user is about to do (due to new optional fields), which then caused some tests to fail. Reworking those tests was fairly straight forward, compared to the hand-crafted code needed to support proposal humanization. This is (probably) a well-known weakness in our testing strategy here.

Also, I added a script that updates Cargo.toml (and Cargo.lock), and the candid directory. I then used this to update the candid directory. (I had already updated Cargo.toml by hand, but this could have been used to update Cargo.toml as well.)
…lags section. Seems like someone may have mistakenly started a separate section (either Flags already existed, and Options was later added, or the other way around). The two should really just be one, because when you do `quill neuron-manage --help, it lists the flags described in the erstewhile two sections.
@daniel-wong-dfinity-org daniel-wong-dfinity-org marked this pull request as ready for review August 16, 2024 15:17
@daniel-wong-dfinity-org daniel-wong-dfinity-org requested a review from a team as a code owner August 16, 2024 15:17
Copy link
Contributor Author

@daniel-wong-dfinity-org daniel-wong-dfinity-org left a comment

Choose a reason for hiding this comment

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

Some remarks that mighthopefully be helpful to reviewers.

src/commands/neuron_manage.rs Show resolved Hide resolved
src/commands/neuron_manage.rs Show resolved Hide resolved
src/commands/neuron_manage.rs Show resolved Hide resolved
src/lib/format/nns_governance.rs Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
/// arbitrary principal can view all fields of the neuron (Public), or just
/// a limited subset (Private).
#[arg(long)]
set_visibility: Option<NativeVisibility>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is not supported in the Ledger app, it should be added to the incompatibility list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do I do that?

Copy link
Contributor

Choose a reason for hiding this comment

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

See the top line of the function. Add it to the && list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

I guess you mean in the exec function, since this line is not in a function.

src/lib/format/nns_governance.rs Outdated Show resolved Hide resolved
src/lib/format/nns_governance.rs Outdated Show resolved Hide resolved
docs/cli-reference/quill-neuron-manage.mdx Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
docs/cli-reference/quill-neuron-manage.mdx Show resolved Hide resolved
src/lib/format/nns_governance.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@daniel-wong-dfinity-org daniel-wong-dfinity-org 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 the review. PTAL.

This reply might contain some duplicates. Hard to tell. GitHub seems to be handling my replies buggily. Please, bear with me.

docs/cli-reference/quill-neuron-manage.mdx Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
/// arbitrary principal can view all fields of the neuron (Public), or just
/// a limited subset (Private).
#[arg(long)]
set_visibility: Option<NativeVisibility>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do I do that?

src/lib/format/nns_governance.rs Outdated Show resolved Hide resolved
src/lib/format/nns_governance.rs Outdated Show resolved Hide resolved
docs/cli-reference/quill-neuron-manage.mdx Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
src/lib/format/nns_governance.rs Outdated Show resolved Hide resolved
scripts/point-to-ic-repo-commit-id.sh Outdated Show resolved Hide resolved
@adamspofford-dfinity adamspofford-dfinity merged commit 9013ce1 into dfinity:master Aug 21, 2024
33 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.

2 participants