You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "pballester (via GitHub)" <gi...@apache.org> on 2026/10/07 15:45:09 UTC

[PR] fix(tempo): send "to" with "from" when collecting worklogs [devlake]

pballester opened a new pull request, #9200:
URL: https://github.com/apache/devlake/pull/9200

   ### 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(tempo): send "to" with "from" when collecting worklogs [devlake]

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh merged PR #9200:
URL: https://github.com/apache/devlake/pull/9200


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org