Skip to content

Edit pull request command - #2940

Merged
samcoe merged 1 commit into
trunkfrom
pr-edit
Feb 12, 2021
Merged

samcoe merged 1 commit into
trunkfrom
pr-edit

Conversation

@samcoe

@samcoe samcoe commented Feb 9, 2021 •

Copy link
Copy Markdown
Contributor

This PR implements the pr edit command allowing the ability to edit a pull request after it has been created. There are some small changes to the issue edit command due to refactoring and renaming in the shared editable code.

Screen Shot 2021-02-10 at 10 13 22 AM

Screen Shot 2021-02-10 at 10 13 58 AM

closes #1349
follow ups #2949

@samcoe samcoe self-assigned this Feb 9, 2021
@samcoe
samcoe changed the base branch from trunk to issue-edit February 9, 2021 20:45
@samcoe samcoe changed the title Pr edit command Edit pull request command Feb 10, 2021
Comment thread pkg/cmd/pr/edit/edit.go Resolved
@samcoe
samcoe force-pushed the pr-edit branch 2 times, most recently from 396d382 to b7bbce5 Compare February 10, 2021 18:22
@samcoe
samcoe marked this pull request as ready for review February 10, 2021 18:22
@samcoe samcoe mentioned this pull request Feb 11, 2021
@samcoe
samcoe requested a review from a team February 11, 2021 19:16

@mislav mislav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great!

Comment thread api/queries_pr.go Resolved
Comment thread api/queries_pr.go Resolved
Comment thread pkg/cmd/pr/edit/edit.go Resolved
Comment thread pkg/cmd/pr/edit/edit.go Resolved
func EditableSurvey(editorCommand string, options *EditableOptions) error {
if options.TitleEdited {
title, err := titleSurvey(options.TitleDefault)
func (e Editable) TitleParam() *githubv4.String {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Slight code smell: the Editable type seems tightly coupled to the githubv4 library here. Ideally, it should be agnostic to the transport layer and only converted to appropriate types when the GraphQL query is constructed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I will look into ways to decouple them in #2949.

Comment thread pkg/cmd/pr/edit/edit.go Resolved
Base automatically changed from issue-edit to trunk February 12, 2021 17:50
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.

Ability to edit title/body/metadata of already open PR

2 participants