Skip to content

Move key add, list, remove and passwd as separate sub-commands and improve key sub-command documentation#4685

Merged
MichaelEischer merged 2 commits intorestic:masterfrom
konidev20:fix-gh-4676-sub-commands-for-key-management
Feb 8, 2024
Merged

Move key add, list, remove and passwd as separate sub-commands and improve key sub-command documentation#4685
MichaelEischer merged 2 commits intorestic:masterfrom
konidev20:fix-gh-4676-sub-commands-for-key-management

Conversation

@konidev20
Copy link
Copy Markdown
Contributor

@konidev20 konidev20 commented Feb 4, 2024

What does this PR change? What problem does it solve?

Restic previously used command line args to figure out the command to be executed for the key command. The documentation of the key command was limited.

@MichaelEischer requested the key command to be split into their own sub-commands like how the repair command is structured.

This PR has split the key command into their respective sub-commands using spf13/cobra's sub-command feature.

Was the change previously discussed in an issue or on the forum?

Closes #4676

We should split the key command into multiple subcommands, similiar to the repair command.

"add" create a new key. "passwd" replaces the current key with a new one using the new password.

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
    • reused existing integration tests, fixed the test and checked if everything is working
  • I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

@konidev20 konidev20 marked this pull request as draft February 4, 2024 14:50
@konidev20 konidev20 marked this pull request as ready for review February 4, 2024 17:50
@konidev20 konidev20 changed the title Move key add, list, remove and passwd as separate sub-commands Move key add, list, remove and passwd as separate sub-commands and improve key sub-command documentation Feb 4, 2024
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I like the change in general, but I found a few problems that were introduced while refactoring the code.

docs: improve the sub-command docs

changelog: add the unreleased changelog for the key command updates

key: update integration tests
@konidev20 konidev20 force-pushed the fix-gh-4676-sub-commands-for-key-management branch from 7cdf988 to 795d33b Compare February 5, 2024 20:18
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

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

LGTM.

I've fixed the integration test. key list returned an error for the wrong reason.

@MichaelEischer MichaelEischer added this pull request to the merge queue Feb 8, 2024
Merged via the queue into restic:master with commit 6a2b10e Feb 8, 2024
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.

key help does not document subcommands

2 participants