kiwitcms / Kiwi

open source test management system with over 2 million downloads!
https://kiwitcms.org
GNU General Public License v2.0
972 stars 290 forks source link

It takes time for a personal API token to work. #3757

Open SowmiyaKaruna opened 3 weeks ago

SowmiyaKaruna commented 3 weeks ago

Description of problem

When a personal API token for an external issue tracking system, such as Jira, is added to Kiwi TCMS, it takes some time to work.

Version or commit hash (if applicable)

Version 13.5 Enterprise

Steps to Reproduce

  1. Configure JIRA bug tracker in the main tenant of KIWI TCMS using the user1 token.
  2. Login into Kiwi TCMS as user2 and navigate to TestRun.
  3. For any TestExecution, click on the menu in the corner and click Add Hyperlink.
  4. Enter the Jira defect URL, set "Is a defect" to Yes, and click Save.
  5. Logout of Kiwi TCMS.
  6. Login again and add Jira's personal API token to user2 KIWI TCMS account.
  7. Repeat steps 3 and 4.

Actual results

After step 4, a comment is added to the JIRA defect, with user1's name as the author, which is expected. However, even after adding a personal API token for user2, it continues to use the user1 API token configured in the Kiwi TCMS tenant. It takes time for the personal API token to start working.

Expected results

Personal API tokens should work immediately after being added to the KIWI TCMS account.

Additional info (Python traceback, logs, etc.)

atodorov commented 3 weeks ago

The most likely culprit here is the fact that RPC connections to external bug tracking systems are cached b/c this is usually a heavier operation, see: https://github.com/kiwitcms/Kiwi/blob/master/tcms/issuetracker/base.py#L246

This cache is inside the Kiwi TCMS process memory space, not as part of the existing caching layer utilized by other parts of the application.