You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
workflow billing: Tempo query uses a 'project' parameter the v4 API rejects (400) #118
workflow billing fails for every profile, because it is the first caller of a Tempo query parameter that the Tempo v4 API does not have.
Symptom
$ budjira workflow billing --profile <profile> --month 2026-08
Error: Tempo API error: 400 Client Error: Bad Request for url:
https://api.tempo.io/4/worklogs?limit=1000&offset=0&from=2026-08-01&to=2026-08-31&project=<KEY>
Reproducible on 1.27.0 and 1.27.1 with any profile that has a [profiles.billing] block.
Cause
TempoClient.get_worklogs translates project_key into a project query parameter:
workflow billing is the first code path that passes project_key
(budjira/services/workflow.py, the paging loop over profile.project_mappings). budjira tempo worklogs never passes it, which is why the parameter has been
dormant and untested until the billing command shipped.
Measured against the Tempo v4 API
Same token, same date range, three request shapes:
Request
Result
GET /4/worklogs?from=…&to=…&limit=5&project=<KEY>
400 Bad Request
GET /4/worklogs/project/<KEY>?from=…&to=…&limit=5
404 Not Found
GET /4/worklogs?from=…&to=…&limit=5
200 OK, results returned
So the parameter is not merely misnamed — Tempo v4 has no project filter on
this endpoint under either spelling I could find.
Possible fixes
Drop the server-side filter and filter client-side. Fetch the period's
worklogs without a project parameter and keep only those whose issue belongs
to the profile's booking projects. The billing command already resolves issue
keys afterwards, so the mapping is available. Costs one unnecessary fetch of
other projects' worklogs on a shared Tempo instance.
Filter by issue id. Resolve the booking project's issues first and pass issueId, which the endpoint does support. More requests, exact result.
If Tempo does offer a project filter under a different name or endpoint,
that would be preferable to both — I could not find one, but I only probed
the two shapes above.
Whichever way: the project_key parameter of get_worklogs currently cannot
work and should either be corrected or removed, so the next caller does not
rediscover this.
Note
1.27.1 fixed something unrelated (register search as a top-level command), so
the report above applies to the current release.
Went with option 1 + removal, as suggested: TempoClient.get_worklogs no longer accepts project_key (the parameter could never work — removed so no next caller rediscovers it), and the billing report applies the booking project scope client-side: worklogs are filtered by issue key prefix against the profile's booking projects. The issue-key backfill for worklogs Tempo returns without a key is folded into a cached per-issue lookup.
Regression coverage: a client test asserts the project parameter is never sent, and a service test proves foreign-project worklogs from a shared Tempo instance never enter the report.
Activity
f3rdy commentedon Aug 29, 2026
Fixed in v1.27.2.
Went with option 1 + removal, as suggested:
TempoClient.get_worklogsno longer acceptsproject_key(the parameter could never work — removed so no next caller rediscovers it), and the billing report applies the booking project scope client-side: worklogs are filtered by issue key prefix against the profile's booking projects. The issue-key backfill for worklogs Tempo returns without a key is folded into a cached per-issue lookup.Regression coverage: a client test asserts the
projectparameter is never sent, and a service test proves foreign-project worklogs from a shared Tempo instance never enter the report.