Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import json
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone

from benchmark_runner.main.environment_variables import environment_variables
from benchmark_runner.common.elasticsearch.elasticsearch_operations import ElasticSearchOperations
Expand Down Expand Up @@ -57,7 +57,7 @@ def get_last_elasticsearch_versions(self, last_es_fetch_days=LAST_ES_FETCH_DAYS)
:return:
"""
new_versions = {}
current_datetime = datetime.now()
current_datetime = datetime.now(timezone.utc).replace(tzinfo=None)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you strip the timezone from the result?

Copy link
Collaborator Author

@ebattat ebattat Nov 3, 2025

Choose a reason for hiding this comment

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

It is to convert a timezone-aware datetime into a naive datetime (i.e., a datetime without any timezone for elasticsearch.
e.g.
2025-11-03 08:30:00+00:00
to
2025-11-03 08:30:00

start_datetime = current_datetime - timedelta(days=last_es_fetch_days)

ids = self.elasticsearch.get_index_ids_between_dates(index='ci-status', start_datetime=start_datetime,
Expand Down