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
add interactive repository edit functionality #4895
Conversation
|
@samcoe This is ready for review. Would like some feedback on how I achieved this :) |
This looks good so far! Note that our team is on holiday until January, so you will only get a thorough review then.
Two things stand out to me here:
- The defaults for prompts are hardcoded: the default for Visibility is "public" and the default for most booleans is
false. The defaults should be instead informed by the repository being edited. - There are simply too many serial prompts if I wanted to just edit a single field interactively. The interactive mode could thus be exhausting to use. Did you consider taking the approach of
gh issue editwhere the first prompt is selecting the fields you actually want to edit?
Thank you for the feedback @mislav, the |
|
@mislav I've made the required changes and modified tests as well. Please do let me know if we can make this better :) |
|
@mislav just wanted to know if there are any more changes needed in this :) |
pkg/cmd/repo/edit/edit.go
Outdated
| Name: "addTopics", | ||
| Prompt: &survey.Input{ | ||
| Message: "Add topics?(csv format)", | ||
| Default: defaultTopics, |
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.
Seems like this should be a blank string?
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.
Here we show the user his existing topics so that he needn't add them again, and thereby can delete what he doesn't need. Just like how the platform does on the UI.
|
@samcoe responded to some comments and worked on some comment feedback. |
|
@samcoe Thank you so much :) |
This looks good! Thanks for the hard work. Minor points remain
| "github.com/cli/cli/v2/pkg/set" | ||
| "github.com/spf13/cobra" | ||
| "golang.org/x/sync/errgroup" | ||
| ) | ||
|
|
||
| const ( |
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.
Love these consts
This PR adds functionality to interactively edit repository settings. This is a continuation of #3882 and follows the design and the feedback I've previously gotten in the same.
It is still a work in progress as I need to add test cases.
Ref: #3882 and #4318