roadiehq / backstage-plugin-jira Goto Github PK
View Code? Open in Web Editor NEWA JIRA plugin for Backstage
A JIRA plugin for Backstage
When I first clicked on the status filter button, it delayed a good 4-5 seconds before painting. Looking into it, it seems it's the REST API endpoint for all statuses on a given Jira instance:
backstage-plugin-jira/src/api/index.ts
Line 133 in c1314df
My instance has hundreds of customized statuses, where some teams do agile, some issue tracking, some basic Kanban, etc, and each project uses a set of customized statues based on predefined patterns. So my given project does not uses most of the returned list of statuses.
Since this widget displays data specific for a project, I think the status collection should be only those valid for the project. The project status call on large instances is also faster.
I tried a PR to fix this, but I'll admit to getting a bit lost into the mechanics of React's useState calls firing the hooks.
But the simple API change is as so:
const request = await axios.get(`${apiUrl}project/${projectKey}/statuses`);
It returns in the same format as the root instance /status
API call. Essentially, need to call the statuses call per project like so:
https://docs.atlassian.com/software/jira/docs/api/REST/8.14.0/#api/2/project-getAllStatuses
And this necessitates passing the projectKey into the status hook.
The activity stream displays.
For one of my projects, I discovered the Jira Card was broken. I tried to troubleshoot it, and best I can tell, it breaks anytime someone adds a comment to a Jira story where the CONTENT of their comment contains the <
or >
character.
In particular, I have a few people who have pasted in e-mail forwards and the output of a single entry.content
looks roughly like so:
<blockquote> <p><b>From:</b> Last, First <[email protected]> <br> <b>Sent:</b> Wednesday, February 17, 2021 11:09 PM<br> <b>To:</b> Last, First <[email protected]>; Last, First <[email protected]><br> <b>Subject:</b> RE: Title of E-mail - <a class="issue-link" href="https://jiraurl.com/browse/PROJECTKEY-123" title="Jira Story Title">PROJECTKEY-123</a> - more of a sentence</p>
</blockquote>
This seems to break the entire card.
Parse function may need to handle the output in a different way? I don't know if it's coming that way from an HTMl scrape or what, but it seems to be getting confused thinking <[email protected]>
is an HTML field and bombing out.
Specifically seems to break on this line, which if I comment it out, the rest of the card displays:
backstage-plugin-jira/src/components/JiraCard/components/ActivityStream.tsx
Lines 142 to 144 in 5f6fd52
Sub-tasks are a fine-grained measure of work in JIRA and don't really make sense in the context of an overview widget where you are trying to get an at-a-glance view of the project.
A user in Discord reported that the plugin isn't working for him with Jira Server.
we are not using Jira cloud, we use Jira Server which i think the api url may be different (similar to the differences between Bitbucket Server and Bitbucket Cloud) we use an id to login, not email but i tried base 64 encoding both (user name and email) and my API token isnt even being hit, it does allow me to register the API with the jira project key annotation but i dont see anything in the about card...
i got it hitting jira now using my username vs email but getting an error 'Request failed with status code 403' here are the logs, any ideas?
'/jira/api':
target: https://jiraserver.com
headers:
Authorization: Basic MYTOKENUSINGUSERNAME
Accept: application/json
Content-Type: application/json
X-Atlassian-Token: no-check
[12:53 AM]
"GET /api/proxy/jira/api/rest/api/latest/project/PIL1 HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" type=incomingRequest
"POST /api/proxy/jira/api/rest/api/latest/search HTTP/1.1" 403 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" type=incomingRequest
"POST /api/proxy/jira/api/rest/api/latest/search HTTP/1.1" 403 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" type=incomingRequest
"POST /api/proxy/jira/api/rest/api/latest/search HTTP/1.1" 403 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61
when I use jira plugin to get the jira data. I set my authorization in app-config.yaml like this:
'/jira/api':
target: https://jira.huami.com
allowedHeaders: ['Authorization']
headers:
Authorization: 'Basic {api_token}'
Accept: 'application/json'
Content-Type: 'application/json'
X-Atlassian-Token: 'nocheck'
User-Agent: "MY-UA-STRING"
But when I check the api,there is no authorization .
curl 'http://localhost:7000/api/proxy/jira/api/rest/api/latest/search'
-H 'Connection: keep-alive'
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"'
-H 'sec-ch-ua-mobile: ?0'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
-H 'content-type: application/json'
-H 'Accept: /'
-H 'Origin: http://localhost:3000'
-H 'Sec-Fetch-Site: same-site'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Dest: empty'
-H 'Referer: http://localhost:3000/'
-H 'Accept-Language: en,zh-CN;q=0.9,zh;q=0.8'
--data-raw '{"jql":"project = "CLOUD"\n AND issuetype = "新功能"\n \n \n AND statuscategory not in ("Done")\n ","maxResults":0}'
--compressed
Hi, i think it would be nice to include Basic and Bearer authentication for jira. This way people with api token could use this plugin too :)
When the Jira card uses both a project and a defined component, it would be great to SHOW the component in some way.
For example, I setup a new component entity in Backstage and gave it my same Jira project key and defined a Jira component for only it. (actually our work for standing up a Backstage PoC 😃 which is represented by only one epic ) But I actually can't tell that that is all that is being shown.
So maybe something along the subtitle, next to the "Project Description | software type", maybe right aligned saying like "Component: Foo" ? Open to other ideas.
The activity stream currently displayed seems to be from the entire Jira instance. My instance has over 1.4 million issues and over 6000 projects, and I personally have read access to hundreds of projects with my user I used a token for. Thus when displaying the card, the activity stream I see is not really relevant to the component I'm viewing.
Suggest replacing it with the activity stream of the given project as defined in the annotation (e.g., jira/project-key
).
I get this error when I add this plugin to the plugins
directory of a Backstage app and run yarn install && yarn tsc && yarn build
.
plugins/backstage-plugin-jira/src/components/JiraCard/JiraCard.test.tsx:104:7 - error TS2322: Type 'Promise<void>' is not assignable to type 'never'.
104 expect(
~~~~~~~
105 await rendered.findByText(/status 403: Forbidden/)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106 ).toBeInTheDocument()
~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@testing-library/dom/types/wait-for.d.ts:10:13
10 callback: () => T extends Promise<any> ? never : T,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
Found 1 error.
error Command failed with exit code 2.
Hi, i was setting up the plugin in my test environment and sadly it does not work.
I see the request being sent to jira but i get the following error:
Log's referral number: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Cause
Referer URL: Unknown
java.lang.ArrayIndexOutOfBoundsException: 1
java.lang.ArrayIndexOutOfBoundsException: 1 ...
Following on from @adamdmharvey 's suggestion on discord.
https://discord.com/channels/760879902391009330/760879902391009333/812215403572494377
Currently we render a summary of all issues in a jira project but allow filtering by status. We should allow a default filter option and we should set this to open by default.
Trying out the new plugin, but not able to get it to work yet. Various permutations, I keep getting this:
Also the resulting link for "Project ->" ends up just being the URL for my component with a suffix of my annotation project-ley (so it's reading that), i.e. http://localhost:3000/catalog/default/component/adams-component/undefined/browse/PROJKEY
.
I've tried a few different permutations of settings, restarting Backstage each time to confirm I'm picking up my app-config.local.yaml
changes, including:
target
being https://mycustomJiraUrl.company.com
target
being https://mycustomJiraUrl.company.com/api/2
(the REST API end point)Would be valuable maybe to...
LOG_LEVEL=debug
to the env vars, could this plugin pick them up?)Any help appreciated, and/or happy to try bug fixes/tweaks?
Thanks!
Activity stream filters by the specified component
Activity stream has all activity for the project
README reflects current setup instructions.
The current README uses isPluginApplicableToEntity
which in alignment with the new composability work is now deprecated via #47.
Minor README updates.
Be able to see “My Stories” in backstage, maybe in the org plugin view where you can see all stories an engineer and there team are working on vs going to Jira. I got the idea from this project - https://github.com/johannesjo/super-productivity
Demo: https://app.super-productivity.com/#/tag/TODAY/tasks
Is the User-Agent string required for Jira Server? If so, is there any documentation on how to obtain the string?
Component should support new composability API by consuming the entity via context rather than props, i.e. via useEntity
Use useEntity
instead of props
When upgrade to latest Backstage release no issues should occur.
yarn backstage-cli versions:bump
@roadiehq/backstage-plugin-jira": "^1.0.6
<EntitySwitch.Case if={isJiraAvailable}>
results in following error:
Type '(entity: import("/node_modules/@roadiehq/backstage-plugin-jira/node_modules/@backstage/catalog-model/dist/index").Entity) => boolean' is not assignable to type '(entity: import("/node_modules/@backstage/catalog-model/dist/index").Entity) => boolean'.
Types of parameters 'entity' and 'entity' are incompatible.
Type 'import("/node_modules/@backstage/catalog-model/dist/index").Entity' is not assignable to type 'import("/node_modules/@roadiehq/backstage-plugin-jira/node_modules/@backstage/catalog-model/dist/index").Entity'.
This snippet
<Grid item md={6}>
<EntityJiraOverviewCard/>
</Grid>
results in following runtime error:
Uncaught TypeError: Cannot read property 'metadata' of undefined
at useProjectEntity (index.esm.js?b6ad:285)
at JiraCard (index.esm.js?b6ad:530)
The above error occurred in the <JiraCard> component:
in JiraCard (created by Extension(Component))
I assume it can be fixed by update dependencies in package.json
$ yarn backstage-cli versions:check --fix
The following packages must be deduplicated by updating dependencies in package.json
@backstage/plugin-catalog-react @ ^0.1.6 should be changed to ^0.2.0
The following packages can be deduplicated by updating dependencies in package.json
@backstage/catalog-model @ ^0.7.10 should be changed to ^0.8.0
@backstage/catalog-model @ ^0.7.9 should be changed to ^0.8.0
see above
upgrade Backstage
Pop!_OS 20.10
Based on #15 we could validate the JIRA_TOKEN and give a (better) hint when it's in an incorrect format.
Reported on discord: https://discord.com/channels/760879902391009330/760879902391009333/816864094731894806
The "New Feature" text is overlapping.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.