Skip to content

Commit

Permalink
Fixing telescope push timestamp check (#1523)
Browse files Browse the repository at this point in the history
* Fixing telescope push timestamp check
* Updated tests for future us
  • Loading branch information
alexcottner authored Dec 20, 2024
1 parent 205cd9e commit 55f2558
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions checks/remotesettings/push_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ async def get_push_timestamp(uri) -> str:
async def get_remotesettings_timestamp(uri) -> str:
client = KintoClient(server_url=uri)
entries = await client.get_monitor_changes(bust_cache=True)

# sort by timestamp desc as the records are returned by bucket/collection
entries.sort(key=lambda e: e["last_modified"], reverse=True)

# Some collections are excluded (eg. preview)
# https://github.com/mozilla-services/cloudops-deployment/blob/master/projects/kinto/puppet/modules/kinto/templates/kinto.ini.erb
matched = [e for e in entries if "preview" not in e["bucket"]]
Expand Down
3 changes: 2 additions & 1 deletion tests/checks/remotesettings/test_push_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ async def test_positive(mock_responses):
payload={
"changes": [
{"id": "a", "bucket": "main-preview", "last_modified": 2000000000000},
{"id": "b", "bucket": "main", "last_modified": 1573086234731},
{"id": "b", "bucket": "main", "last_modified": 1273086234731},
{"id": "c", "bucket": "main", "last_modified": 1573086234731},
]
},
)
Expand Down

0 comments on commit 55f2558

Please sign in to comment.