-
Notifications
You must be signed in to change notification settings - Fork 21
AXON-379: Atlassian Notifications - Bitbucket and Jira Comments #411
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
base: main
Are you sure you want to change the base?
Conversation
…ger to handle by Credential and by product removal of notifications
…ON-379-atlassian-notifications
…ON-379-atlassian-notifications
…ON-379-atlassian-notifications
…/atlassian/atlascode into AXON-379-atlassian-notifications
@@ -6,7 +6,7 @@ case `uname -s` in | |||
*) CODEPATH=~/.config/Code;; | |||
esac | |||
|
|||
OLDSTATE=`sqlite3 ${CODEPATH}/User/globalStorage/state.vscdb 'select value from ItemTable where key = "atlassian.atlascode";'` | |||
OLDSTATE=`sqlite3 "${CODEPATH}/User/globalStorage/state.vscdb" 'select value from ItemTable where key = "atlassian.atlascode";'` |
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.
This is just fixing up an old util script
const sites = Container.siteManager.getSitesAvailable(product); | ||
const uniquelyCredentialedSites = Array.from(new Map(sites.map((site) => [site.credentialId, site])).values()); | ||
|
||
const authInfos = await Promise.all(uniquelyCredentialedSites.map((site) => this.getAuthInfo(site, true))); |
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.
Interesting note here: the getAuthInfo function call doesn't refresh the token itself.
if (productAuths) { | ||
userId = productAuths.get(site.credentialId)?.user.id || ''; |
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.
Needed to clear out notification details
const repoUrl = url.slice(0, url.indexOf('/pull-requests')); | ||
const prUrlPath = Uri.parse(url).path; | ||
const prId = prUrlPath.slice(prUrlPath.lastIndexOf('/') + 1); | ||
const prId = prUrlPath.split('/pull-requests/')[1]?.split('/')[0]; |
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.
In some case the URL might come with extra stuff at the end.
What Is This Change?
https://www.loom.com/share/dc633545b1cc464c84d6af13df849da2?sid=11a5116c-5d26-484e-a482-21ffc24f8ad1
How Has This Been Tested?
Basic checks:
npm run lint
npm run test
Advanced checks:
Recommendations: