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

New issue commands #82

Closed
4 of 5 tasks
4Kaylum opened this issue Feb 23, 2021 · 30 comments
Closed
4 of 5 tasks

New issue commands #82

4Kaylum opened this issue Feb 23, 2021 · 30 comments
Assignees

Comments

@4Kaylum
Copy link
Member

4Kaylum commented Feb 23, 2021

Opening this so I can group #73 and #74.

  • issue comment command to add comments to an issue
  • issue edit command to edit an issue (low priority)
  • issue close command to close an issue - this could merge with edit as it's the same endpoint
  • issue list command to list issues on a repo
  • Change createissue command to issue create (possibly keeping ci as an alias)

These commands could use the same git repo templates as already exist (gh/user/repo or the inbuilt aliases), though this would make more sense to add as a converter for the future.

Issues should be given as an int which we don't need to validate, since we can just give a generic "I couldn't comment/edit that issue" etc.

Here's the relevant API docs:

Pinging the original issue openers: @GlitchMasta47 @SpicyTakis

@sn8to
Copy link
Contributor

sn8to commented Feb 23, 2021

issue open should also be included, either separate or combined into issue edit.

@4Kaylum
Copy link
Member Author

4Kaylum commented Feb 23, 2021

My guy
image

4Kaylum added a commit that referenced this issue Feb 27, 2021
@4Kaylum
Copy link
Member Author

4Kaylum commented Feb 27, 2021

Issue list command is now added, though it needs pagination.

@4Kaylum 4Kaylum self-assigned this Feb 28, 2021
@4Kaylum
Copy link
Member Author

4Kaylum commented Feb 28, 2021

Thinking about it, I could probably include issue assign [repo] [issueid] @user for users who have linked accounts. Is that something of interest?

@sn8to
Copy link
Contributor

sn8to commented Feb 28, 2021

My guy
image

oops I meant to say issue open

@4Kaylum
Copy link
Member Author

4Kaylum commented Feb 28, 2021

My guy
image

oops I meant to say issue open

Is this the same as issue create (added as an alias), or do you want a command to re-open a closed issue?

@sn8to
Copy link
Contributor

sn8to commented Feb 28, 2021

It could be either but I was thinking about reopening closed issues.

@4Kaylum
Copy link
Member Author

4Kaylum commented Feb 28, 2021

I'm not sure there's much need for reopening issues from Discord. I already filter out closed issues from the issue list command; do you think it's something you'd use a lot of?

@sn8to
Copy link
Contributor

sn8to commented Feb 28, 2021

It could be an alias and issue close can stay to toggle between open/closed states.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

Issue #92 is related to this stuff - mentioning it here because I can.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

Test comment from the Apy integration.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

Test comment from the Apy integration number 2.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

That completes the issue comment command.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

issue close completed with #94.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

With the issue edit command: how should we approach this? Issues are composed of comments, and editing an individual comment would be a pain. What should we do? @GlitchMasta47 @JMcB17 @SpicyTakis

@SpicyTakis
Copy link

Maybe edit the users last comment?

@sn8to
Copy link
Contributor

sn8to commented Mar 1, 2021

I was originally thinking about issue edit editing the original issue. I could only think of comment editing working by either showing users a list of comments available and letting them choose one, or letting them pass the comment url (which is dumb because to get it they'd have to be on the page anyways and they might as well click the edit button instead of the copy link button).

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

I was originally thinking about issue edit editing the original issue. I could only think of comment editing working by either showing users a list of comments available and letting them choose one, or letting them pass the comment url (which is dumb because to get it they'd have to be on the page anyways and they might as well click the edit button instead of the copy link button).

I was originally thinking about editing the original issue as well but I'm not sure that really matters after at least one comment has been left.

@sn8to
Copy link
Contributor

sn8to commented Mar 1, 2021

Maybe edit the users last comment?

Editing the most recent comment made by the user sounds good since I can't think of any other reasons to edit comments that aren't the most recent.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

I think that based on it not being immediately obvious what it does: I shouldn't add it as a command. Opinions?

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

After some thinking I'm genuinely not sure that issue edit is worth developing. Please someone change my mind if you feel strongly about this.

@joelsgp
Copy link
Contributor

joelsgp commented Mar 1, 2021

We could model some functionality off the GitHub cli tool: https://cli.github.com/manual
For issue edit my opinion would be that it should edit the original body.

@joelsgp
Copy link
Contributor

joelsgp commented Mar 1, 2021

The cli tool doesn't have this though:

C:\Users\joelm>gh issue -h
Work with GitHub issues

USAGE
  gh issue <command> [flags]

CORE COMMANDS
  close:      Close issue
  comment:    Create a new issue comment
  create:     Create a new issue
  list:       List and filter issues in this repository
  reopen:     Reopen issue
  status:     Show status of relevant issues
  view:       View an issue

I might tend to agree about dropping the edit command.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

I've already added close, comment, create, and list (although list isn't paginated). I'm not sure anything else is really WANTED as a Discord integration.

Our last discussion was on assign, but that still needs thought.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 1, 2021

Concept: I use the Github activity API endpoints to send you a DM when you get a new notification on git.
https://docs.github.com/en/rest/reference/activity#notifications

It doesn't look like I can get the same system on Gitlab; the closest I can find is the todo list API.
https://docs.gitlab.com/ee/api/todos.html
Feel free to point me in the right direction if you find something more viable.

Thoughts?

@sn8to
Copy link
Contributor

sn8to commented Mar 1, 2021

I like the idea, it sounds pretty interesting, however I use email notifications since they're default and I don't have to do any setup.

@aikocc
Copy link
Contributor

aikocc commented Mar 2, 2021

Concept: I use the Github activity API endpoints to send you a DM when you get a new notification on git.
https://docs.github.com/en/rest/reference/activity#notifications

It doesn't look like I can get the same system on Gitlab; the closest I can find is the todo list API.
https://docs.gitlab.com/ee/api/todos.html
Feel free to point me in the right direction if you find something more viable.

Thoughts?

I quite like that!

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 2, 2021

Thoughts for that workflow:

  • Get user notifications (since last poll)
  • For each notification
    • Check reason
    • See if the reason is different from the last polled reason (this will either need to be cached or databased, and if it's our first poll what should we do here?)
    • If so, send special notification (issue closed, assigned, etc)
    • Otherwise the notification is a new comment - grab its content and author and send that back

I think I'll need to test this to see how it works. The reason field is slightly confusing to me, honestly.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 3, 2021

I've decided against that flow for the time being. I'll add issue assign and then close this. I'm happy with how these commands have been added.

@4Kaylum
Copy link
Member Author

4Kaylum commented Mar 8, 2021

After Max saying to many times I have now abandoned issue assign. That concludes this issue.

@4Kaylum 4Kaylum closed this as completed Mar 8, 2021
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

No branches or pull requests

5 participants