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

feat: do not react with emoji if "EmojiReaction" flag is empty #4378

Merged
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ac7dca3
chore: add disable emoji reaction flag to tests flags
CaioAugustoo Mar 18, 2024
2c93212
Merge branch 'feat/disable-emoji-reaction-flag' of https://github.com…
Mar 18, 2024
94acbe0
fix(typo): from 'DisableEmojiReactioFlag' to 'DisableEmojiReactionFlag'
Mar 18, 2024
9f255f3
chore: add DisableEmojiReactionFlag constant
Mar 18, 2024
ac370e9
chore: pass disableEmojiReaction to events controller
Mar 18, 2024
143fda2
feat: add disable emoji reaction flag
Mar 18, 2024
5d72deb
chore(docs): add disable-emoji-reaction flag usage example
Mar 18, 2024
73845f9
refactor: remove useless printf call
Mar 18, 2024
774d8fc
refactor: update code note
Mar 18, 2024
0840e10
refactor: update flag name from "--disable-emoji-reaction" to "--enab…
Mar 21, 2024
3a7b7cf
refactor: update comment and logic to react to comment
Mar 21, 2024
bb3613e
fix: make test react to comment when emojis are enabled
Mar 21, 2024
17ffb82
chore(config): add "EnableEmojiReaction" value
Mar 21, 2024
2904580
refactor: remove "EnableEmojiReaction" flag
Mar 24, 2024
d5f9257
chore(docs): update --emoji-reaction docs
Mar 24, 2024
f335584
refactor: remove useless file
Mar 24, 2024
8405c71
Merge branch 'main' into feat/disable-emoji-reaction-flag
CaioAugustoo Mar 24, 2024
59d58d1
fix: remove go from toolsversion
Mar 24, 2024
0b88e68
Merge branch 'feat/disable-emoji-reaction-flag' of https://github.com…
Mar 24, 2024
7363d3c
Merge branch 'main' into feat/disable-emoji-reaction-flag
jamengual Apr 2, 2024
916beae
Merge branch 'main' of github.com:runatlantis/atlantis into feat/disa…
chenrui333 May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ const (
DisableUnlockLabelFlag = "disable-unlock-label"
DiscardApprovalOnPlanFlag = "discard-approval-on-plan"
EmojiReaction = "emoji-reaction"
EnableDiffMarkdownFormat = "enable-diff-markdown-format"
EnablePolicyChecksFlag = "enable-policy-checks"
EnableRegExpCmdFlag = "enable-regexp-cmd"
EnableDiffMarkdownFormat = "enable-diff-markdown-format"
ExecutableName = "executable-name"
FailOnPreWorkflowHookError = "fail-on-pre-workflow-hook-error"
HideUnchangedPlanComments = "hide-unchanged-plan-comments"
Expand Down Expand Up @@ -157,7 +157,7 @@ const (
DefaultCheckoutDepth = 0
DefaultBitbucketBaseURL = bitbucketcloud.BaseURL
DefaultDataDir = "~/.atlantis"
DefaultEmojiReaction = "eyes"
DefaultEmojiReaction = ""
DefaultExecutableName = "atlantis"
DefaultMarkdownTemplateOverridesDir = "~/.markdown_templates"
DefaultGHHostname = "github.com"
Expand Down Expand Up @@ -275,7 +275,7 @@ var stringFlags = map[string]stringFlag{
defaultValue: "",
},
EmojiReaction: {
description: "Emoji Reaction to use to react to comments",
description: "Emoji Reaction to use to react to comments.",
defaultValue: DefaultEmojiReaction,
},
ExecutableName: {
Expand Down Expand Up @@ -459,6 +459,7 @@ var boolFlags = map[string]boolFlag{
description: "Disable atlantis auto planning feature",
defaultValue: false,
},

DisableRepoLockingFlag: {
description: "Disable atlantis locking repos",
},
Expand Down
4 changes: 2 additions & 2 deletions runatlantis.io/docs/server-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ and set `--autoplan-modules` to `false`.
# or
ATLANTIS_EMOJI_REACTION=thumbsup
```
The emoji reaction to use for marking processed comments. Currently supported on Azure DevOps, GitHub and GitLab.
Defaults to `eyes`.
The emoji reaction to use for marking processed comments. Currently supported on Azure DevOps, GitHub and GitLab. If not specified, Atlantis will not use an emoji reaction.
Defaults to "" (empty string).

### `--enable-diff-markdown-format`
```bash
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/events/events_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func (e *VCSEventsController) handleCommentEvent(logger logging.SimpleLogging, b
}
}

// It's a comment we're gonna react to, so add a reaction.
// It's a comment we're going to react to so add a reaction.
if e.EmojiReaction != "" {
err := e.VCSClient.ReactToComment(logger, baseRepo, pullNum, commentID, e.EmojiReaction)
if err != nil {
Expand Down