bitcrowd / tickety-tick

A browser extension that helps you name branches and write better commit messages
MIT License
57 stars 10 forks source link

No longer working with Jira Server #349

Closed tiagotex closed 1 year ago

tiagotex commented 1 year ago

The newly released version updated the Jira adapter to depend on API 3 instead of latest. https://github.com/bitcrowd/tickety-tick/pull/326/

This is a problem because API v3 is only available for Jira Cloud, Jira Server only has v2.

https://community.atlassian.com/t5/Jira-questions/When-will-Jira-Server-support-REST-API-v3/qaq-p/1303614 https://jira.atlassian.com/browse/JRASERVER-70688

Would you be open to reverting this functionality and reworking the feature to maintain compatibility with Jira Server?

Of course, I'm available to make the necessary changes mentioned above.

Thank you for the awesome plugin 💚

PS: this might be the same problem affecting @RKushnir https://github.com/bitcrowd/tickety-tick/issues/345

RKushnir commented 1 year ago

Hey Tiago 🤗 I no longer need to use that Jira instance, so it doesn't bother me anymore. But I hope you can figure it out.

tiagotex commented 1 year ago

Created some instructions to use previous version of the extension on Chrome while this is addressed:

1. Go to https://github.com/bitcrowd/tickety-tick/releases/tag/v4.2.3 and download the chrome version
2. Navigate to chrome://extensions in Chrome
3. Remove the current tickty-tick extension by clicking "Remove"
4. Expand the Developer dropdown menu and click “Load Unpacked Extension”
5. Navigate to the local folder containing the extension’s code and click Ok
klappradla commented 1 year ago

Hey @tiagotex,

thanks for reporting 💚

From what I remember, Atlassian only from API v3 on supports serving ticket descriptions in their proprietary ADF format (rich text document format). And our updated JIra adapter relies on that format. So simply switching it back to /latest probably won't be enough.

We need a moment to think about a good way to support both systems (unfortunately I don't have access to a Jira server instance...). If you have time and could do me a favor, it would be nice if you could post me an example response for a request like that:

https://my-subdomain.atlassian.net/jira/software/projects/TT/boards/8?selectedIssue=…}

I am particularly interested in how the description field looks like when you use links, tables, etc. in the ticket description.

klappradla commented 1 year ago

For people using TicketyTick in Firefox who want to go back to an earlier version which still uses Jira's v2 API: you can download a standalone release from v4.1.2. Simply delete the extension from your browser and install the downloaded one 🦊

klappradla commented 1 year ago

Note to self: see https://github.com/bitcrowd/tickety-tick/issues/345 for the actual error message (404).

pmeinhardt commented 1 year ago

What if Tickety Tick just attempts the current approach and – if that fails – makes another attempt, this time using the old v2 behavior?

Here is a quick sketch:

  1. Rename the current adapter from jira.ts to jira-v3.ts
  2. Create a jira-v2.ts from the old behavior
  3. Create a new jira.ts which wraps v3 in a try and invokes v2 in the catch block

…basically composing a new adapter by chaining the version-specific adapters.

pmeinhardt commented 1 year ago

One aspect to think about some more with regard to my suggestion above is error reporting. In particular, v2 should only be attempted if the v3 API request fails but not if an error occurs while processing an actual v3 API response. So maybe the high-level composition above is not ideal – or at least we should only catch any HTTPError instances thrown by the API client (https://github.com/sindresorhus/ky#httperror) and not other errors.

klappradla commented 1 year ago

Oh @pmeinhardt 💚

I wrote pretty much the same in Slack yesterday 😂

I'd have gone with JiraServer and JiraCloud as adapter names, since these two apparently drift apart a bit.

(Edit: I mean about splitting into two adapters and attempting both in v3 to v2 order)