Skip to content

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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

bwieger-atlassian-com
Copy link
Collaborator

@bwieger-atlassian-com bwieger-atlassian-com commented May 16, 2025

What Is This Change?

  • Show notification for jira Cloud users for new comments on PRs and Jira's that the user is directly involved in
  • Directly involved = was mentioned, or is the author of the pr, or is the Jira Assignee

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:

  • If Atlassian employee & Bitbucket changes: did you test with DC in mind? See Instructions

Recommendations:

  • Update the CHANGELOG if making a user facing change

@@ -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";'`
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 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)));
Copy link
Collaborator Author

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 || '';
Copy link
Collaborator Author

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];
Copy link
Collaborator Author

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.

@bwieger-atlassian-com bwieger-atlassian-com changed the title [WIP] making a pr to see changes easily AXON-379: Atlassian Notifications - Bitbucket and Jira Comments May 31, 2025
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.

2 participants