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

investigation: issue priority should be treated as string or integer consistently. #150

Open
mpsenn opened this issue Feb 2, 2023 · 1 comment
Labels
question Further information is requested

Comments

@mpsenn
Copy link
Contributor

mpsenn commented Feb 2, 2023

This could be a bug, or it could be a test needing update. Reading api/hooks/issues-hook/update-work-item-priority/index.js, issue priority is treated numerically, and can be compared with higher-priority issues are > than lower-priority.

const isNewPriorityGreat = issue && priority > issue.priority;

However, the test code for this passes in priority strings like "P1" and "P2". Strings like these compare the other way around, "P2" > "P1", even though P1 should be higher-priority.

From api/hooks/issues-hook/update-work-item-priority/__test__/updateWorkItemPriority.spec.js,

        Issues.getByRelatedUrl.mockReturnValue(
            Promise.resolve({
                id: '1234abcd',
                priority: 'P1'
            })
        );

Resolve this by looking at production logs or GUS api responses, and update either the test code or the implementation code. Consider adding type checking.

@mpsenn mpsenn added the question Further information is requested label Feb 2, 2023
@git2gus
Copy link

git2gus bot commented Feb 2, 2023

Git2Gus App is installed but the .git2gus/config.json doesn't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant