sstojak1 opened a new issue, #7020:
URL: https://github.com/apache/incubator-devlake/issues/7020
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
## What and why to refactor
Hi team,
I have a question about the Jira plugin, specifically regarding the Jira
account collection task.
If I understand correctly, every time the Jira boards accounts
[task](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/jira/impl/impl.go#L128)
runs, it
[fetches](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/jira/tasks/account_collector.go#L48-L51)
all accounts from the _tool_jira_accounts and then calls the *api/2/user* Jira
API for each account to retrieve information, and eventually saving it to the
raw table. This process could significantly slow down jobs for small Jira
boards that initially don’t have many accounts discovered on their boards but
still need to call the API for all of them because some other big board has
pushed many accounts into _tool_jira_accounts.
## Describe the solution you'd like
Maybe calling API for accounts only connected with that board for which the
job is running (issues/epics tasks that run before are also pushing stuff to
_tool_jira_accounts , so maybe rely on that?
## Related issues
Please link any other
## Additional context
How to reproduce:
1. Deployed Devlake locally.
2. Created a Devlake project connected to a large Jira board.
3. Ran the import process.
4. For me this project discovered over 350 accounts and saved them in the
_tool_jira_accounts table.
5. Created another Devlake project linked to a smaller Jira board, with a
time range set to the last week.
6. Ran the import process.
6. Found that the account collection job for the second project processed
the same number of accounts as the first project - check the `all_acc.log`.
7. Cleared entries from the _tool_jira_accounts and _raw_jira_api_users
tables.
8. Re-executed the collection job for the second project.
9. Noted that the account collection job completed much faster this time -
check the `identified_acc.log`.
[all_acc.log](https://github.com/apache/incubator-devlake/files/14402714/all_acc.log)
[identified_acc.log](https://github.com/apache/incubator-devlake/files/14402715/identified_acc.log)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]