Skip to content

fix(tempo): send "to" with "from" when collecting worklogs - #9200

Merged
klesh merged 1 commit into
apache:mainfrom
pballester:fix/tempo-worklog-period
Oct 8, 2026
Merged

klesh merged 1 commit into
apache:mainfrom
pballester:fix/tempo-worklog-period

Conversation

@pballester

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #9164 (released in v1.0.3-beta18): full syncs of the Tempo plugin fail in collect_worklogs.

For a full sync, buildWorklogQuery sets from=<timeAfter> and no to. Tempo rejects that period on every page, starting at offset 0:

GET worklogs/team/13?from=2026-01-28&limit=1000&offset=0
{"errors":[{"message":"Non valid period, from '2026-01-28' to 'null'"}]} (400)

This hits every full sync, and also the first run of every team after upgrading to beta18, since #9164 scopes the collector state per team so each team starts fresh. Before #9164 the team endpoint always sent both from and to (to defaulting to today); the OpenAPI spec lists both as optional, but the API requires to when from is set.

Fix: whenever the query has from and no to, set to to the date the collection started, computed once so every page asks for the same period. This covers the full sync and a lone fromDate option. Incremental runs keep using updatedFrom on its own, which Tempo accepts on both endpoints.

Tests

  • TestBuildWorklogQuery: the full-sync and global-endpoint cases now expect to (the previous test asserted it was empty, which encoded the bug); new case for a fromDate option alone.
  • Tempo e2e suite passes on MySQL 8.0; gofmt/go vet clean; golangci-lint reports nothing new in the plugin.

Does this close any open issues?

Follow-up to #9164 / #9163.

Screenshots

N/A

Since apache#9164 a full sync asks Tempo for worklogs from timeAfter with no end
date. Tempo rejects that period on every page:
  {"errors":[{"message":"Non valid period, from '2026-01-28' to 'null'"}]} (400)
so full syncs (and the first run of each team after upgrading to beta18,
whose collector state starts fresh) fail in collect_worklogs.

Whenever the query has "from" and no "to", set "to" to the date the
collection started (one value for every page). Incremental runs keep using
updatedFrom, which Tempo accepts on its own.

@klesh klesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
Thanks for your contribution.

@klesh
klesh merged commit 7137326 into apache:main Oct 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants