Skip to content

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

Merged
merged 3 commits into from
Feb 21, 2019
Merged

Copilot workflow changes #254

merged 3 commits into from
Feb 21, 2019

Conversation

gondzo
Copy link
Collaborator

@gondzo gondzo commented Feb 19, 2019

Changes as part of appirio-tech/connect-app#2837

@@ -721,5 +731,27 @@ module.exports = (app, logger) => {
status,
initiatorUserId: req.authUser.userId,
}, logger);

if (role === PROJECT_MEMBER_ROLE.COPILOT && status === INVITE_STATUS.ACCEPTED) {
Copy link
Contributor

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) {
Copy link
Contributor

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 ?

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.

Copy link
Contributor

@RishiRajSahu RishiRajSahu left a 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',

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',

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) {

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.

Copy link
Collaborator Author

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

@gondzo gondzo merged commit b1737e5 into dev Feb 21, 2019
@vikasrohit vikasrohit deleted the feature/copilotWorkflow branch July 29, 2019 06:28
@vikasrohit vikasrohit restored the feature/copilotWorkflow branch July 29, 2019 06:29
@eisbilir eisbilir deleted the feature/copilotWorkflow branch November 9, 2023 20:02
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

Successfully merging this pull request may close these issues.

3 participants