Skip to content

Conversation

@kwk
Copy link
Collaborator

@kwk kwk commented Sep 15, 2025

This finds Jira issues and their worklogs.

This adds the -worklog option to the stats, next to -commented, -resolved, etc.

To make this feature available you need to set worklog_enable=on. Maybe this will become the default in the future but for now it is off by default.

You can set worklog_show_time_spent=on|off in your Jira config to adjust if you want to include the time that was spent on each work log (i.e. see (33m) in the first work log).

Fixes #428

Here is some example output:

* Issues with worklogs in jira: 2
    * LLVM-262 - Merge flang into llvm SRPM

      * Worklog: Tuesday, August 19, 2025 (33m)

        Created local branch "integrate-flang" in rpms/llvm an rpms/flang.
        Skimmed through the flang.spec file.
        Introduced "flang" build condition to rpms/llvm/llvm.spec.
        Added skeleton of flang package in llvm.spec using the new conditional.
        Will need to flesh out the packages and files section of flang in llvm.spec.
        I think we can live without this patch: 0001-Fix-fastmath-test.patch.
        The print_max_procs lua function in flang.spec is probably not needed. At least we had something similar in other formerly standalone packages and we didn't bring those optimizations...

      * Worklog: Wednesday, August 20, 2025 (2h 9m)

        Brought flang.spec over to llvm.spec.
        Flang doesn't build with LLVM_ENABLE_EH. For that reason I've set the issue to blocked.
        Turned off LLVM_ENABLE_EH just to get it building.
        TODO(kkleine): Need to adjust tests to use properly filter out tests instead of removing the file altogether.
        Started first mock build.

      * Worklog: Tuesday, August 26, 2025 (9m)

        * Checking build.log for failures.

Here's an example workflow of entering two worklogs (using jira-worklogger and then printing them using did today --jira-worklog. (Wait for the very end to see what this PR outputs.)

jira-worklogger-and-did

@kwk
Copy link
Collaborator Author

kwk commented Sep 15, 2025

I will add a config option to include or exclude the time spent for each worklog entry.

@kwk kwk force-pushed the fix-428-jira-worklog branch from 14be180 to b99fb55 Compare September 15, 2025 19:40
@kwk
Copy link
Collaborator Author

kwk commented Sep 15, 2025

I will add a config option to include or exclude the time spent for each worklog entry.

Done.

@kwk
Copy link
Collaborator Author

kwk commented Sep 23, 2025

If I understand correctly, the tests fail due to github exceeding its rate limit. "You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID ED52:2DD345:1C0CE9C:63D0423:68C93C1C."

@kwk
Copy link
Collaborator Author

kwk commented Sep 23, 2025

If I understand correctly, the tests fail due to github exceeding its rate limit. "You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID ED52:2DD345:1C0CE9C:63D0423:68C93C1C."

I reran the tests and they pass now, so I guess I was correct.

@kwk kwk requested review from optak and psss October 1, 2025 06:58
@kwk
Copy link
Collaborator Author

kwk commented Oct 14, 2025

@sandrobonazzola @lukaszachy @psss @optak: Do you think you can review this PR?

@sandrobonazzola
Copy link
Collaborator

Overall looks good to me, a few comments:

  • can you also add some unit testing for this change?
  • did you test this with large worklog datasets to ensure acceptable performance?

@kwk
Copy link
Collaborator Author

kwk commented Oct 22, 2025

@sandrobonazzola , thank you for the review.

Overall looks good to me, a few comments:

* can you also add some unit testing for this change?

I sure can. Would mocked tests be okay?

* did you test this with large worklog datasets to ensure acceptable performance?

No I have my own work that uses worklogs but I don't know of anybody else in my team that uses this so far. We're only downloading worklogs for issues that were found when a worklog entry matches the author and timing constraints. For the other Jira issues that we find, we don't download worklogs. The performance should only be impacted by the new query and I don't have a database to test that against. Should this niche and maybe less known worklog feature become a problem we can maybe think about having the --{option}-worklog option be opt-in? I'm not sure this concept exists in did yet.

@kwk
Copy link
Collaborator Author

kwk commented Oct 23, 2025

@sandrobonazzola I've introduced an option called worklog_enable that is off by default to allow this feature to be integrated and tested by those who wish to use it. On top I've added tests against the apache Jira instance with a rather prominent bot user (githubbot).

@kwk kwk force-pushed the fix-428-jira-worklog branch from 1ed0801 to 0a33d83 Compare October 23, 2025 10:59
@kwk
Copy link
Collaborator Author

kwk commented Nov 10, 2025

@sandrobonazzola can you please give this another review?

Copy link
Collaborator

@sandrobonazzola sandrobonazzola left a comment

Choose a reason for hiding this comment

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

See inline comments

@kwk
Copy link
Collaborator Author

kwk commented Nov 12, 2025

@sandrobonazzola I've addressed the changes that you requested. Thank you for working on this. I just wanted to say that I have pre-commit installed and running locally but I don't know why it fails in this PR.

@kwk
Copy link
Collaborator Author

kwk commented Nov 12, 2025

@sandrobonazzola I've addressed the changes that you requested. Thank you for working on this. I just wanted to say that I have pre-commit installed and running locally but I don't know why it fails in this PR.

@sandrobonazzola I've opened an issue (#439) for this problem because it seems unrelated to my PR here.

kwk added 4 commits November 13, 2025 10:29
This finds Jira issues and their worklogs.

This adds the `-worklog` option to the stats, next to `-commented`,
`-resolved`, etc.

You can set `worklog_show_time_spent=on|off` in your Jira config.

Fixes psss#428
@kwk kwk force-pushed the fix-428-jira-worklog branch from 4ce9770 to e442fb4 Compare November 13, 2025 09:29
@kwk
Copy link
Collaborator Author

kwk commented Nov 13, 2025

@sandrobonazzola I've rebased onto main with your #440 fix in it. That should make the pre-commit failures go away.

Copy link
Collaborator

@sandrobonazzola sandrobonazzola left a comment

Choose a reason for hiding this comment

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

LGTM

@sandrobonazzola sandrobonazzola merged commit ab28ee8 into psss:main Nov 18, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List Jira issues for which work was logged and add this to the output

2 participants