-
Notifications
You must be signed in to change notification settings - Fork 56
Copilot workflow changes #254
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
Conversation
@@ -721,5 +731,27 @@ module.exports = (app, logger) => { | |||
status, | |||
initiatorUserId: req.authUser.userId, | |||
}, logger); | |||
|
|||
if (role === PROJECT_MEMBER_ROLE.COPILOT && status === INVITE_STATUS.ACCEPTED) { |
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.
@gondzo should we send only copilot events only in this case and bypass the event on line https://github.com/topcoder-platform/tc-project-service/pull/254/files#diff-42ae3999a1a28855656e72e3e1e1ea71R727 ? otherwise I think it would result in duplicate emails being sent from tc-notifications ?
@@ -707,9 +708,18 @@ module.exports = (app, logger) => { | |||
email, | |||
initiatorUserId: req.authUser.userId, | |||
}, logger); | |||
|
|||
if (role === PROJECT_MEMBER_ROLE.COPILOT) { |
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.
@gondzo same as the issue mentioned in case of updated event below, should we bypass create event in case of requested event event thrown ?
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.
Yes, we should skip raising the created event in this 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.
@gondzo added comments, please address.
src/constants.js
Outdated
PROJECT_MEMBER_INVITE_UPDATED: 'notifications.connect.project.member.invite.updated', | ||
PROJECT_MEMBER_COPILOT_ADDED: 'notifications.connect.project.member.copilot.added', |
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.
Renaming of events needed as suggested in other PR topcoder-platform/tc-notifications#89
src/constants.js
Outdated
PROJECT_MEMBER_INVITE_UPDATED: 'notifications.connect.project.member.invite.updated', | ||
PROJECT_MEMBER_COPILOT_ADDED: 'notifications.connect.project.member.copilot.added', | ||
PROJECT_MEMBER_COPILOT_REFUSED: 'notifications.connect.project.member.copilot.refused', |
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.
Renaming of events needed as suggested in other PR topcoder-platform/tc-notifications#89
@@ -250,7 +250,7 @@ module.exports = [ | |||
{ correlationId: req.id }, | |||
); | |||
// send email invite (async) | |||
if (v.email && !v.userId) { | |||
if (v.email && !v.userId && v.role !== PROJECT_MEMBER_ROLE.COPILOT) { |
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.
Can we better check the status (v.status === 'pending'
) of the invite itself rather than depending of the role? We might have some future requirements where we might need to add more roles where we need workflow like this.
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, we don't send the email for copilots only - invite status is still the same regardless of role
Changes as part of appirio-tech/connect-app#2837