Skip to content

cmd/wtclient: Enhance help text for session and terminate subcommands #9765

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

Closed
wants to merge 3 commits into from

Conversation

gap-editor
Copy link

@gap-editor gap-editor commented Apr 25, 2025

resolves #9583

Change Description

This PR enhances the wtclient subcommands by adding user-friendly help text and improving argument naming:

  • sessionCommands:

    • Added Usage: "Manage watchtower client sessions."
    • Added Description: "Manage sessions with the watchtower client, including terminating sessions."
  • terminateSessionCommand:

    • Added Usage: "Terminate a watchtower client session."
    • Added Description: "Terminate an active session with the watchtower client by ID."

No functional behavior was changed. This is purely documentation/CLI-UX improvement.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering both positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

  • The change is not insubstantial (no single-character or typo-only commits).
  • All new comments and help text wrap at 80 columns.
  • Commits follow the Ideal Git Commit Structure.
  • Any new lncli commands have appropriate comments/tags in the proto file.
  • Release notes are updated, or [skip ci] is included for small changes.

Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Important

Review skipped

Auto reviews are limited to specific labels.

🏷️ Labels to auto review (1)
  • llm-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gap-editor
Copy link
Author

Hi!, guys! I saw in the contribution guidelines that commits should be squashed before merging.

If the PR is good to go, would you mind squashing the commits on your end during the merge? I’d really appreciate it.

@ellemouton
Copy link
Collaborator

ellemouton commented Apr 26, 2025

@gap-editor - is this perhaps a duplicate of #9588?

If the PR is good to go, would you mind squashing the commits on your end during the merge? I’d really appreciate it.

The PR author is expected to get the commits in the correct structure before merge.

Commented the same on the duplicate pr: commit naming conventions must please be followed as per our guidelines

@gap-editor gap-editor force-pushed the master branch 2 times, most recently from 98f2791 to 3404f6a Compare April 27, 2025 09:59
@gap-editor
Copy link
Author

@ellemouton do i need to squash commits?

@guggero
Copy link
Collaborator

guggero commented Apr 28, 2025

@ellemouton do i need to squash commits?

Fixup commits or commits that don't make logical sense on their own should be squashed. But generally changes should be committed in small logical units (commits). What @ellemouton was hinting at was the commit messages themselves.

@gap-editor
Copy link
Author

@ellemouton do i need to squash commits?

Fixup commits or commits that don't make logical sense on their own should be squashed. But generally changes should be committed in small logical units (commits). What @ellemouton was hinting at was the commit messages themselves.

I have changed commit messages already so based on what you wrote, I don't see the point in doing squash commits because, de facto, one commit is for code changes and the other is for changes in the release note. If you think differently, let me know, and I will listen and do it the right way.

@mohamedawnallah
Copy link
Contributor

mohamedawnallah commented May 1, 2025

I have changed commit messages already so based on what you wrote,

Hey @gap-editor, Thanks for your contribution! It looks like there something missed regards the git commit message. What @ellemouton was hinting specifically in the commit message is package prefixes and may be other nuances here in the contribution guidelines:

https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md#development-guidelines

Your commits could be structured like:
1️⃣ cmd: add usage and desc to wtclient session
2️⃣ docs: update release-notes-0.19.0.md

You could observe the merged git commits here and gaining some insights about structure of git commits:
https://github.com/lightningnetwork/lnd/commits/master/

Also, it appears PR #9588 addresses the same issue and submitted prior to yours. Consider collaborating with that author for example using the Co-authored-by feature in your commit messages but letting them know before.

ArgsUsage: "id",
Usage: "Terminate a watchtower client session.",
Description: "Terminate an active session with the watchtower client by ID.",
ArgsUsage: "session_id",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this change is necessary. Users already run lncli wtclient session terminate <id> and can tell it's a session-related ID from context

The `session` command now includes a comprehensive explanation of its role in managing watchtower client sessions.
The `terminate` command offers clear instructions for ending an active session using its unique session ID.

Want it more technical or more casual?
Copy link
Contributor

@mohamedawnallah mohamedawnallah May 1, 2025

Choose a reason for hiding this comment

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

It looks like it would be better to be under Tooling and Documentation section instead. Please also maintain the 80-character line limit where possible as per contribution guidelines

The `session` command now includes a comprehensive explanation of its role in managing watchtower client sessions.
The `terminate` command offers clear instructions for ending an active session using its unique session ID.

Want it more technical or more casual?
Copy link
Contributor

@mohamedawnallah mohamedawnallah May 1, 2025

Choose a reason for hiding this comment

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

It looks like this comment doesn't belong here?

@gap-editor gap-editor force-pushed the master branch 3 times, most recently from 238a2ff to d4f3ad0 Compare May 1, 2025 18:26
@gap-editor
Copy link
Author

@mohamedawnallah , done!

@mohamedawnallah
Copy link
Contributor

I noticed that the current git commit order appears to be in reverse. Typically, release notes are added after the corresponding coding changes. In current case, It seems the release notes were added before the changes they describe.

On a related note, I observed that you used the master branch on your fork. While it’s generally good practice to use a feature-specific branch for contributions, I think it’s okay for this PR since you have to open another PR otherwise.

@mohamedawnallah
Copy link
Contributor

Apart from the proposed changes above, the PR LGTM!

@gap-editor
Copy link
Author

@mohamedawnallah thank you ! And just wanted to ask — would you prefer if I squash the commits, or is it important to keep your name visible as a co-author in the commit history?

@mohamedawnallah
Copy link
Contributor

mohamedawnallah commented May 2, 2025

would you prefer if I squash the commits, or is it important to keep your name visible as a co-author in the commit history?

@gap-editor feel free to squash git commits and as I mentioned before make sure the git commit for release note is the last one

@gap-editor gap-editor force-pushed the master branch 2 times, most recently from 90d46b3 to f743e49 Compare May 2, 2025 14:55
@gap-editor
Copy link
Author

would you prefer if I squash the commits, or is it important to keep your name visible as a co-author in the commit history?

@gap-editor feel free to squash git commits and as I mentioned before make sure the git commit for release note is the last one

@mohamedawnallah done! please check

@@ -377,13 +377,17 @@ func policy(ctx *cli.Context) error {

var sessionCommands = cli.Command{
Name: "session",
Usage: "Manage watchtower client sessions.",
Description: "Manage sessions with the watchtower client, including terminating sessions.",
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like theDescription line is over 80 characters limit. Look for policy command legacy usage in the same file and see how the lines are splitted using + before 80 characters limit

Subcommands: []cli.Command{
terminateSessionCommand,
},
}

var terminateSessionCommand = cli.Command{
Name: "terminate",
Usage: "Terminate a watchtower client session.",
Description: "Terminate an active session with the watchtower client by ID.",
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Comment on lines 533 to 534
explanation of its role in managing watchtower client sessions. The `terminate`
command offers clear instructions for ending an active session using its unique
Copy link
Contributor

@mohamedawnallah mohamedawnallah May 2, 2025

Choose a reason for hiding this comment

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

It looks like unique and terminate based on my proposed change before is over 80 characters as well they could be moved on the next line

@mohamedawnallah
Copy link
Contributor

mohamedawnallah commented May 2, 2025

@gap-editor – The code commits structure looks good to me. Please look for my additional proposed changes and I think it would be good to go

@gap-editor
Copy link
Author

@gap-editor – The code commits structure looks good to me. Please look for my additional proposed changes and I think it would be good to go

@mohamedawnallah done! check is everything good, please!

@twofaktor twofaktor mentioned this pull request May 12, 2025
@ellemouton
Copy link
Collaborator

@mohamedawnallah - those itest fails you linked are not related to this PR. This PR only changes description strings.

Comment on lines 380 to 392
Usage: "Manage watchtower client sessions.",
Description: "Manage sessions with the watchtower client, including " +
"terminating sessions.",
Subcommands: []cli.Command{
terminateSessionCommand,
},
}

var terminateSessionCommand = cli.Command{
Name: "terminate",
Usage: "Terminate a watchtower client session.",
Description: "Terminate an active session with the watchtower " +
"client by ID.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think just the Usage string is enough? doesnt seem like the descriptions add much more

Copy link
Author

Choose a reason for hiding this comment

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

updated

@@ -526,6 +526,14 @@ selected use postgres for the neutrino.db store](https://github.com/lightningnet
- [Fixed a few misspellings](https://github.com/lightningnetwork/lnd/pull/9290)
of "broadcast" in the code base, specifically the `lncli peers updatenodeannouncement`
command documentation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

you'll please need to move this to v0.20's notes

Copy link
Author

Choose a reason for hiding this comment

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

updated

@gap-editor gap-editor force-pushed the master branch 3 times, most recently from 3d4c823 to 8aa3cb2 Compare May 27, 2025 14:15
@gap-editor
Copy link
Author

Hi @ellemouton @mohamedawnallah , I’m unable to run make fmt due to a bug I haven’t been able to fix. Sorry for the inconvenience.

Copy link
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

I’m unable to run make fmt due to a bug I haven’t been able to fix. Sorry for the inconvenience.

you'll need to figure it out the bug if it means getting the PR in a mergeable state please 🙏

@@ -377,13 +377,19 @@ func policy(ctx *cli.Context) error {

Copy link
Collaborator

Choose a reason for hiding this comment

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

the commit title just mentions doc update but this is where the main change is happening in cmd/commands?

@@ -70,5 +70,5 @@
## Code Health

## Tooling and Documentation

[Add usage and desc to wtclient session cmd](https://github.com/lightningnetwork/lnd/pull/9765): Enhanced documentation for the `session` and `terminate` commands in `lncli wtclient`. The `session` command now includes a comprehensive explanation of its role in managing watchtower client sessions. The `terminate` command offers clear instructions for ending an active session using its unique session ID.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can just shorted this to "Enhance documentation for various watchtower commands"

@@ -378,8 +378,6 @@ func policy(ctx *cli.Context) error {
var sessionCommands = cli.Command{
Name: "session",
Usage: "Manage watchtower client sessions.",
Description: "Manage sessions with the watchtower client, including " +
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be squashed into the previous commit

@lightninglabs-deploy
Copy link

@mohamedawnallah: review reminder
@gap-editor, remember to re-request review from reviewers when ready

@saubyk
Copy link
Collaborator

saubyk commented Jun 4, 2025

!lightninglabs-deploy mute

@gap-editor gap-editor requested a review from ellemouton June 4, 2025 16:51
Copy link
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

@gap-editor - please dont re-request review until my previous comments have been addressed.

cmd: add usage and desc to `wtclient session`

Update wtclient.go

Update release-notes-0.20.0.md

Update release-notes-0.20.0.md

Update release-notes-0.20.0.md
@gap-editor gap-editor requested a review from ellemouton June 5, 2025 12:24
@ellemouton ellemouton removed the request for review from mohamedawnallah June 5, 2025 12:28
@ellemouton
Copy link
Collaborator

removed review requests as comments have still not been addressed

@gap-editor
Copy link
Author

gap-editor commented Jun 5, 2025 via email

@ellemouton
Copy link
Collaborator

ellemouton commented Jun 5, 2025

@gap-editor - see my previous review where I left comments: None of those comments have been addressed #9765 (review)

@guggero
Copy link
Collaborator

guggero commented Jun 5, 2025

If you can't be bothered to actually open GitHub and read through the review comments, then I guess there's no use in us providing review in the first place.

@guggero guggero closed this Jun 5, 2025
@gap-editor
Copy link
Author

u are crazy guys

@gap-editor
Copy link
Author

show me what i didn't do

@twofaktor
Copy link
Contributor

Another frustrated PR... @lightninglabs team is woefully insufficient to fix a bug in its software...sad...

If no one is going to take care of this, could you please confirm whether I should close this issue? -> #9583

@saubyk
Copy link
Collaborator

saubyk commented Jun 20, 2025

@twofaktor did you notice how much effort was spent and feedback was provided on this pr, before we made the decision to close it? Or are you just happy to take sarcastic pot shots?

We will not merge any pr, if code is not up to quality or according to the guideline. In this case the contributor (actually a commit farmer) was not interested in solving the issue, but only interested in getting a pr merged.

You can try submitting a pr yourselves, this issue is not that difficult to work on.

@twofaktor
Copy link
Contributor

@twofaktor did you notice how much effort was spent and feedback was provided on this pr, before we made the decision to close it? Or are you just happy to take sarcastic pot shots?

We will not merge any pr, if code is not up to quality or according to the guideline. In this case the contributor (actually a commit farmer) was not interested in solving the issue, but only interested in getting a pr merged.

You can try submitting a pr yourselves, this issue is not that difficult to work on.

Ok, I'm not a developer. I only opened the issue in case a freelance developer could take charge of fixing it, or if not, someone from the Lightning Labs team could, since they're supposedly the owners of the software in question. Issue #9583 closed as not planned. Thank you for your attention 🫶

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]: missing description to wtclient command "session" and "terminate" command option
7 participants