-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(source-jira): use unix time as milliseconds when filtering the cursor field via jql #48395
Open
ryanahall
wants to merge
4
commits into
airbytehq:master
Choose a base branch
from
ryanahall:rh/source-jira-cursor-epoch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+19
−18
Conversation
This file contains 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
…ent timestamps due to timezone conversions
@ryanahall is attempting to deploy a commit to the Airbyte Growth Team on Vercel. A member of the Team first needs to authorize it. |
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 01:28
— with
GitHub Actions
Inactive
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 01:28
— with
GitHub Actions
Inactive
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 01:28
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 01:28
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 18:03
— with
GitHub Actions
Error
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 18:03
— with
GitHub Actions
Inactive
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 18:03
— with
GitHub Actions
Inactive
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 18:03
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci-auto
November 7, 2024 18:52
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci-auto
November 7, 2024 18:52
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 18:52
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 18:52
— with
GitHub Actions
Error
ryanahall
changed the title
Use unix epoch when querying with jql to avoid inconsistent timestamp…
fix(source-jira): use unix epoch when querying with jql to avoid inconsistent timestamp…
Nov 7, 2024
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 18:54
— with
GitHub Actions
Inactive
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 18:54
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 18:54
— with
GitHub Actions
Error
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 18:54
— with
GitHub Actions
Inactive
ryanahall
force-pushed
the
rh/source-jira-cursor-epoch
branch
from
November 7, 2024 19:04
ea54e43
to
af816ac
Compare
octavia-squidington-iii
added
the
area/documentation
Improvements or additions to documentation
label
Nov 7, 2024
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 19:04
— with
GitHub Actions
Inactive
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 19:04
— with
GitHub Actions
Error
ryanahall
had a problem deploying
to
community-ci
November 7, 2024 19:04
— with
GitHub Actions
Error
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 19:04
— with
GitHub Actions
Inactive
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 19:41
— with
GitHub Actions
Inactive
ryanahall
requested a deployment
to
community-ci
November 7, 2024 19:41
— with
GitHub Actions
Waiting
ryanahall
temporarily deployed
to
community-ci-auto
November 7, 2024 19:41
— with
GitHub Actions
Inactive
ryanahall
requested a deployment
to
community-ci
November 7, 2024 19:41
— with
GitHub Actions
Waiting
ryanahall
changed the title
fix(source-jira): use unix epoch when querying with jql to avoid inconsistent timestamp…
fix(source-jira): use unit time as milliseconds when filtering the cursor field via jql
Nov 7, 2024
ryanahall
changed the title
fix(source-jira): use unit time as milliseconds when filtering the cursor field via jql
fix(source-jira): use unix time as milliseconds when filtering the cursor field via jql
Nov 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/connectors
Connector related issues
area/documentation
Improvements or additions to documentation
community
connectors/source/jira
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.
…s due to timezone conversions
What
According to https://support.atlassian.com/jira-software-cloud/docs/jql-fields/#Updated, date times are relative to the current configured timezone. In some cases (i.e. using a personal access token), the currently configured timezone may not be UTC.
When streams use the jira advanced search api and request records using JQL (https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/), this cursor value is formatted without a timezone as seen below:
In our case, we've noticed that the
issues
stream for jira returns records with anupdated
field value (the cursor field) formatted as UTC. Subsequent syncs will use this value, truncate the timezone (which is UTC), and pass it along to jira. When the session has a timezone that has a negative UTC offset, this results in data being skipped. When the session has a timezone with a positive UTC offset, data is unnecessarily emitted.For example, an initial sync may return it's final
issue
record with a cursor of2024-11-06 12:00:00.000+0000
representing noon UTC time. The next sync will query using jql with the following filter:updated >= '2024-11-06 12:00:00'
. If the session's timezone isAmerica/Los_Angeles
, then this filters records with anupdated
time that is greater than or equal to2024-11-06 20:00:00.000+0000
due to the UTC offset. Any recordsupdated
between12
and20
UTC time are skipped.How
According to https://support.atlassian.com/jira-software-cloud/docs/jql-fields/#Updated, the jira jql api supports epoch values when filtering against the
updated
field amongst other timestamp fields. Notably, they mention thatif you omit the quote-marks, the number you supply will be interpreted as milliseconds after epoch (1970-1-1).
This change modifies
jql_compare_date
to append a filter of{self.cursor_field} >= {compare_date_epoch}
, wherecompare_date_epoch
represents the epoch value in milliseconds of the current datetime value.Review guide
User Impact
If the session is already configured with a UTC timezone, there's no change. For sessions with a timezone offset from UTC, they should see more consistent record updates for incremental streams.
Can this PR be safely reverted and rolled back?