Repository navigation
feat(worklog): resolve real Tempo author, add JSON output and author/date filters (#92) - #102
Merged
Merged
Conversation
…date filters (#92) worklog list was unreliable for attribution: on Tempo-managed tickets the Jira worklog API reports only the Tempo sync account as author, --format json was ignored, and there were no author/date filters. - Route worklog list through the Tempo API on Tempo-enabled connections so the real author displayName is shown; keep the Jira worklog API for non-Tempo connections. - Honor the global --format json (emits id, author.accountId/displayName, timeSpentSeconds, startDate, startTime, description). - Add --mine (resolves the current user via myself()), --author <accountId>, and --from/--to date filters, backed by the existing Tempo client account_id and date parameters. These require a Tempo connection and error clearly on non-Tempo ones instead of being silently ignored. Closes #92
- reject invalid --from/--to dates with a usage error instead of a traceback - surface truncation at the 1000-entry Tempo fetch limit (table hint + JSON 'truncated' flag on both paths) - align Jira fallback JSON schema with the Tempo path (startDate/startTime split, handles +0000-style offsets on Python 3.10) - type connection params as Connection instead of Any - deduplicate worklog table construction
Contributor
Author
Self-review (session-assisted)Findings, all addressed in 033c116:
Full suite 904 passed / 3 skipped, ruff check + mypy clean. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #92.
Problem
worklog list <ISSUE>was unreliable for attribution on Tempo-managed tickets:--format jsonignored — the command always emitted a Rich table, so programmatic use was impossible.--mine/--author/--from/--to.Change
displayNameis shown; non-Tempo connections keep using the Jira worklog API.--format jsonon both paths (emitsid,author.accountId,author.displayName,timeSpentSeconds,startDate,startTime,description).--mine/--author <accountId>/--from/--to, backed by the Tempo client's existingaccount_idand date parameters.--mineresolves the current user viamyself(). These filters require a Tempo connection and error clearly on non-Tempo ones instead of being silently ignored;--mine+--authortogether is a usage error.Notes / scope
--authortakes a JiraaccountId(use--minefor yourself). Resolving a plain email to an accountId is left as a follow-up.jira_client.client.myself()["accountId"]pattern already used intempo.py,services/issues.pyandworkflow.py; no new helper added.Tests
tests/cli/test_worklog.py(Tempo real-author, JSON fields,--mine,--author,--from/--to, mutual exclusion, non-Tempo JSON, filter-on-non-Tempo error). Written test-first (red → green).ruff check/ruff format/mypyclean.