Skip to content
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

Bugzilla refresher depends on offset, want it to depend on datetime instead #300

Open
anthonyjlau opened this issue Apr 27, 2024 · 2 comments

Comments

@anthonyjlau
Copy link
Collaborator

anthonyjlau commented Apr 27, 2024

Currently, the Bugzilla downloader uses the offset parameter to change which bugs to download on a page.

Example API parameters:

/rest/bug?created_date=2024-01-01T00:00:00Z&limit=20&offset=0
/rest/bug?created_date=2024-01-01T00:00:00Z&limit=20&offset=20
/rest/bug?created_date=2024-01-01T00:00:00Z&limit=20&offset=40
...

Each time the offset is changed, it downloads a different section of the total results. For example, if there are 70 total bugs that were created after 2024-01-01 00:00:00, the first page would contain bug 0 up to the limit, which would be bug 19. Then, the second API call would change to offset 20, which means that the first bug of the second page will be bug 20 and it would go to bug 40.

Using offset is a bit confusing so instead, it is recommended to remove offset entirely from the parameters and change the created_date parameter instead. Not only will this make it have more intuitive sense but it will also match how other downloaders (GitHub for example) downloads its data.

@carlosparadis
Copy link
Member

@anthonyjlau Did you manually test the created date to see if it would work?

@anthonyjlau
Copy link
Collaborator Author

Yes, when I tested changing the created date manually, it works.

For example, in this API call (https://bugzilla.redhat.com/rest/bug?creation_time=2024-04-26T12:00:00Z&include_fields=_default,comments&limit=20), the creation_time starts at 2024-04-26T12:00:00Z. The last issue on the page has a creation_time of 2024-04-26T13:29:18.

So, I change the creation_time field to be 2024-04-26T13:29:19 (one more second than the last creation time) and the API call looks like this (https://bugzilla.redhat.com/rest/bug?creation_time=2024-04-26T13:29:19Z&include_fields=_default,comments&limit=20).

This will return the same thing as this API call (https://bugzilla.redhat.com/rest/bug?creation_time=2024-04-26T12:00:00Z&include_fields=_default,comments&limit=20&offset=20), which is what is being used currently.

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

No branches or pull requests

2 participants