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

Fix for the duplicate work item creation #102

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

jag-j
Copy link
Collaborator

@jag-j jag-j commented Feb 18, 2021

This fixes this issue that multiple users have reported - #97

return await updateIssue(req, 'Error while creating work item. No valid build foundin GUS!');
// If issue is a bug we check if it already exists and already has lowest priority
// If issue type is investigation or story, we simply check it exists
if (isRecordTypeBug && alreadyLowestPriority && recordIdTypeIsSame) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main fix. We don't look for priority anymore for investigation and story.

}
} else {
const foundInBuild = await Builds.resolveBuild(config, milestone);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the old connectAPI code we don't use anymore. Removed them all.

@@ -197,219 +245,224 @@ const reqWithGusTitlePrefix = {
};

describe('createGusItem action', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all the tests to check for the GUS API interaction rather than the old Connect API push. Added couple of pin-down tests for the bug I fixed.

expect(sails.hooks['issues-hook'].queue.push).not.toHaveBeenCalled();
expect(Gus.createWorkItemInGus).not.toHaveBeenCalled();
});
it('should not call createWorkItemInGus if bug already exists in GUS', async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this and the test below for the fix.

Copy link
Contributor

@reiniergs reiniergs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@reiniergs reiniergs merged commit 0031ef2 into master Feb 22, 2021
@reiniergs reiniergs deleted the jj/duplicate_work_item_issue branch February 22, 2021 20:35
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