Skip to content

fix(bitbucket): handle microsecond precision timestamps in PR extractor#8828

Merged
klesh merged 1 commit into
apache:mainfrom
vincio71:fix/bitbucket-microsecond-timestamp
Apr 18, 2026
Merged

fix(bitbucket): handle microsecond precision timestamps in PR extractor#8828
klesh merged 1 commit into
apache:mainfrom
vincio71:fix/bitbucket-microsecond-timestamp

Conversation

@vincio71
Copy link
Copy Markdown
Contributor

@vincio71 vincio71 commented Apr 9, 2026

Summary

Bitbucket Cloud returns timestamps with 6-digit microsecond precision (e.g. 2025-09-15T08:53:36.337932+00:00). The PR extractor stored created_on and updated_on directly as time.Time, which caused a time.ParseError during extraction because Go's json.Unmarshal uses RFC3339 — a format that does not accept microseconds.

Fix

  • Add microsecond format (6-digit fractional seconds) to DateTimeFormats in Iso8601Time
  • Change BitbucketCreatedAt/BitbucketUpdatedAt in BitbucketApiPullRequest struct from time.Time to *common.Iso8601Time
  • All files formatted with gofmt -s

Does this close any open issues?

Closes #8708

Note: This is the same fix as #8765 by @JakubHelis, with gofmt -s formatting applied to pass the golangci-lint CI check.

Pre Checklist

  • I have read through the Contributing Documentation
  • I have added relevant tests
  • I have added relevant documentation

Bitbucket Cloud returns timestamps with 6-digit fractional seconds
(e.g. 2025-09-15T08:53:36.337932+00:00). Changed BitbucketCreatedAt/
BitbucketUpdatedAt from time.Time to *common.Iso8601Time and added
microsecond format to DateTimeFormats.

Fixes apache#8708
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. pr-type/bug-fix This PR fixes a bug labels Apr 9, 2026
@asemarian
Copy link
Copy Markdown

Any chance we can get this merged soon? 👀
cc: @klesh

@acarmisc
Copy link
Copy Markdown

+1

Copy link
Copy Markdown
Contributor

@klesh klesh left a comment

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 d7d5fa6 into apache:main Apr 18, 2026
12 checks passed
zvika-finally pushed a commit to zvika-finally/incubator-devlake that referenced this pull request Apr 30, 2026
…or (apache#8828)

Bitbucket Cloud returns timestamps with 6-digit fractional seconds
(e.g. 2025-09-15T08:53:36.337932+00:00). Changed BitbucketCreatedAt/
BitbucketUpdatedAt from time.Time to *common.Iso8601Time and added
microsecond format to DateTimeFormats.

Fixes apache#8708

Co-authored-by: Vincenzo Baldi <vincenzobaldi@a-m-j-v-baldi.fritz.box>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-type/bug-fix This PR fixes a bug size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Bitbucket] Extract Pull Requests fails on microsecond timestamp parsing

4 participants