-
Notifications
You must be signed in to change notification settings - Fork 653
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(jira): Add Jira issue transition to JiraNotificationService #1080
Conversation
|
||
@Component | ||
@ConditionalOnProperty("jira.enabled") | ||
public class JiraNotificationService implements NotificationService { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(JiraNotificationService.class); | ||
private static final int MAX_RETRY = 3; | ||
private static final long RETRY_BACKOFF = 3; | ||
private static final long RETRY_BACKOFF = 100; |
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.
A retry backoff of 3ms seemed absurdly low, setting this to 100ms.
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.
Debatable.
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.
No strong opinions, just don't follow the point of sleeping for 3 milliseconds (my reasoning is it may as well be zero in that case). 🤷♂️
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.
My original comment was a joke, sorry ... I suspect the original was a big mistake.
Honestly, because it's a linear backoff and only 3 attempts, I'd probably do a couple seconds or something.
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.
Hah, I thought maybe you were joking but I totally couldn't tell 😂
15165e6
to
d873662
Compare
kv("transitionRequestBody", transitionContext), errors(e)), | ||
e); | ||
} | ||
} |
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.
Error on invalid transition name looks like:
Failed to transition Jira issue EXMPL-0000: {errors={issue=EXMPL-0000, transitionName=Done, validTransitionNames=[Reopen, Reopen and start progress]}}
4b9a622
to
8b2f283
Compare
`transitionContext` payload can be the full Jira transition REST API payload, however the transition ID will be looked up based on the transition name
8b2f283
to
6e13feb
Compare
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.
Minor nits, by and large I think it's good.
|
||
@Component | ||
@ConditionalOnProperty("jira.enabled") | ||
public class JiraNotificationService implements NotificationService { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(JiraNotificationService.class); | ||
private static final int MAX_RETRY = 3; | ||
private static final long RETRY_BACKOFF = 3; | ||
private static final long RETRY_BACKOFF = 100; |
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.
Debatable.
echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/jira/JiraNotificationService.java
Outdated
Show resolved
Hide resolved
Added option to comment on issue. |
New object looks good to me (not sure if there's lombok in here and @DaTa would have been sufficed over get/set ... either way I'm ok). |
transitionContext
payload can be the full Jira transition REST API payload, however the transition ID will be looked up based on the transition name