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

feat(issues): add support for jira cloud [WIP] #20559

Closed
wants to merge 42 commits into from

Conversation

setchy
Copy link
Collaborator

@setchy setchy commented Feb 21, 2023

Changes

Note: This is a Draft PR. I am raising it early so that I can begin to get broader feedback and input.

Introduces issues module and adds support for Jira Cloud Issues.

Work still pending:

  • Unit testing
  • Update document on how to use, limitations (as mentioned above) and make clear this feature is experimental (until it's had time to be hardened etc)
  • Create and maintain sub-task(s) linked to the Dependency Dashboard for any open PRs so they can be assigned and planned into team sprint commitments. This may be best as a separate follow-up PR as it adds net-new functionality.
  • Other things I'm forgetting 😅

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@setchy setchy marked this pull request as draft February 21, 2023 22:51
@setchy setchy changed the title DRAFT - feat(bitbucket): add support for jira issues feat(bitbucket): add support for jira issues [WIP] Feb 22, 2023
@setchy
Copy link
Collaborator Author

setchy commented Feb 22, 2023

so the yarn type-check step is not happy...

adding skipLibCheck: true to tsconfig.json makes it pass, but I'm not sure if that's an "acceptable" approach

@viceice
Copy link
Member

viceice commented Feb 22, 2023

it doesn't resolve the mentioned issue. the issue is about using Jira for bitbucket server, not bitbucket Cloud

@setchy
Copy link
Collaborator Author

setchy commented Feb 22, 2023

it doesn't resolve the mentioned issue. the issue is about using Jira for bitbucket server, not bitbucket Cloud

created a new issue #20568 after clarifying that the previous issue was for bitbucket server + jira server only

@viceice
Copy link
Member

viceice commented Feb 22, 2023

let's discuss things inside the issue

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

please create a refactor PR first to add modules/issues/index, which provides the issue API. all calls can be forwarded to platform for first step.

the change all related code to call the issue API instead of platform directly.

// const markdown = remark().use(github).process(description);

/**
* TODO: This is a naive implementation where we don't try to convert ADF back to markdown,
Copy link
Member

Choose a reason for hiding this comment

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

idea, allow configure a custom multiline text field to store raw markdown on issue, so we only need to convert to ADF and not back?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That could certainly work - but that custom multiline text field would need to be setup per project which would be complicated at scale.

I've been experimenting with this branch and the naive implementation seems to be ok. the dashboard jira issue is updated on each run, which isn't such a bad thing imho. the last updated timestamp is a good reflection of how "current" the dashboard contents are :)

@@ -648,6 +649,13 @@ const options: RenovateOptions[] = [
default: true,
supportedManagers: ['npm', 'composer'],
},
{
name: 'issueCollector',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any recommendations on the new global configuration name to specify the issue collector? Also thought about issuePlatform

@setchy setchy changed the title feat(bitbucket): add support for jira issues [WIP] feat(issues): add support for jira cloud [WIP] Mar 21, 2023
@setchy setchy mentioned this pull request Mar 21, 2023
6 tasks
* TODO - What is the best way to retrieve these per repository to use in the Jira Issue Collector?
* Retrieving this may vary between platforms(ie: Bitbucket repositories can be natively linked)
*/
function getProjectKey(): string {
Copy link
Collaborator Author

@setchy setchy Mar 21, 2023

Choose a reason for hiding this comment

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

I'm needing some advice on how best to configure the following for the Jira Issue Collector

  • jira project key for the repository.

    • for bitbucket cloud, this can be fetched via a call to the /repositories/{repo}/jira/projects endpoint. how would this value be passed down to the issue collector logic?
    • for other platform types, how would this work?
  • jira cloud url.

    • similarly, this can be fetched from the bitbucket /jira/projects endpoint.
    • for other platform types, how would this work?

setIssueCollectorApi(config);
}

function setIssueCollectorApi(config: AllConfig): void {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will use the configured issueCollector, or, fallback to the platform-type issues


export type IssueCollectorId = 'jira';

export abstract class IssueCollector implements IssueCollectorAPI {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are issues only used for dependency dashboards? If so, what if this interface was more dashboard exporter driven?

I ask because I built a patch onto our instance at Atlassian to export the dashboard to Confluence. I could port that logic to an exporter, but Issue Collector would clearly not fit that use case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A believe there are a handful of situations, but mainly Dependency dashboards, config errors etc at the moment...

I raised #20574 recently to capture the enhancement idea of supporting Confluence spaces - this seems to be similar to what you've done with your local patch @kwelch.

Very much open to better naming suggestions than issue collector.

Furthermore, for Jira Cloud, I'm interest to go beyond just a single dependency dashboard ticket and generate linked sub-tasks for each of the open PRs,

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the context. I will see if I can spend some time on this during our upcoming tech debt week.

Copy link
Member

@viceice viceice Mar 22, 2023

Choose a reason for hiding this comment

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

this is also used for the config error issue .

and maybe more in future

@rarkins
Copy link
Collaborator

rarkins commented Sep 28, 2023

Closing due to inactivity - trying to keep stale open PRs to a minimum as it's a negative sign to those browsing repos. This topic is welcome to be resumed at any time

@rarkins rarkins closed this Sep 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform:bitbucket Bitbucket Cloud platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants