-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Github reaction emojis on PR comments #2706
Conversation
fa81e5a
to
ea39183
Compare
body := event.GetComment().GetBody() | ||
|
||
if strings.HasPrefix(body, "atlantis ") { | ||
err = e.VCSClient.ReactToComment(baseRepo, *event.Comment.ID, "eyes") |
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.
Thank you for the pr.
Please make the emojis configurable from the server config and overwritable in the repo config
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.
Nice feature. The rapid feedback improves the developer experience. I also want to add 🚀 .
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.
It might be better to move react logic in here.
logger.Debug("executing command") |
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.
@krrrr38 I would have preferred that as well, but there you don't have access to the event object anymore so I don't see a way to get to the comment id.
@@ -181,6 +181,13 @@ func (g *GithubClient) CreateComment(repo models.Repo, pullNum int, comment stri | |||
return nil | |||
} | |||
|
|||
// ReactToComment adds a reaction to a comment. | |||
func (g *GithubClient) ReactToComment(repo models.Repo, commentID int64, reaction string) error { |
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.
Please add tests
@marcusramberg friendly ping. I'd love to see this in the next release if you have the time 😄 🙏 |
Got a bit stuck on rewriting the mocks but will try to refocus on completing this PR this week. |
You mean regenerating the mocks using pegomock? |
No, I meant I started a branch to rewrite the mocks using |
I think the gomock rewrite is noble but can be done in a separate PR. The pegomock should be good enough for this PR, no? |
71ca654
to
244e654
Compare
58a0a25
to
5268f5e
Compare
This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month. |
682d86c
to
25675c3
Compare
Finally got around to write a test for this, sorry for the delay. |
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.
LGTM, thank you for your contribution
Adds eyes whenever it detects an `atlantis` command.
25675c3
to
a22a959
Compare
Rebased to pull in workflow fixes from #3342 |
@marcusramberg The linter failures might not be all of your changes, but for the sake can you take a pass and see if any apply? Thanks |
Tbh I'm not sure if I agree with this error since this is a stub function that hopefully should be implemented later for gitlab, but if you feel it should be adressed I can change it to _ |
Head branch was pushed to by a user without write access
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.
Thank you for this.
* feat: Basic implementation of github reactions on PRs Adds eyes whenever it detects an `atlantis` command. * feat: Make the emoji reaction configurable * tests: Add a mocked test for EmojiReaction being called in github * ci: Disable revive linter for stubs
* feat: Basic implementation of github reactions on PRs Adds eyes whenever it detects an `atlantis` command. * feat: Make the emoji reaction configurable * tests: Add a mocked test for EmojiReaction being called in github * ci: Disable revive linter for stubs
* feat: Basic implementation of github reactions on PRs Adds eyes whenever it detects an `atlantis` command. * feat: Make the emoji reaction configurable * tests: Add a mocked test for EmojiReaction being called in github * ci: Disable revive linter for stubs
* feat: Basic implementation of github reactions on PRs Adds eyes whenever it detects an `atlantis` command. * feat: Make the emoji reaction configurable * tests: Add a mocked test for EmojiReaction being called in github * ci: Disable revive linter for stubs
what
Adds 👀 reaction to the comment whenever it detects an
atlantis
command.I've tested this on a dev instance of Atlantis and it works as expected for my trivial test cases,
but not sure what kind of unit tests you'd like to see for this, so opening it for discussion.
I guess this could also be behind a command line flag, but I'm not sure if that's necessary?
Note that I've stubbed the other VCS providers, as I don't have access to any of them for testing,
I suppose at least bitbucket could support this feature as well tho.
why
atlantis apply
can give us assurance that Atlantis has picked up the jobreferences