Skip to content

fix(metrics): Add forward compatibility#41595

Merged
iambriccardo merged 1 commit into
masterfrom
riccardo/fix/backward-comp-latest
Nov 21, 2022
Merged

fix(metrics): Add forward compatibility#41595
iambriccardo merged 1 commit into
masterfrom
riccardo/fix/backward-comp-latest

Conversation

@iambriccardo

@iambriccardo iambriccardo commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

This PR aims at introducing forward compatibility for the new cache keys ds::r:1234:prod.

Comment on lines +70 to +75
try:
# Compatibility fix for new keys "ds::r:1234:e:prod".
release_id = int(release_id)
boosted_releases.append((release_id, float(timestamp)))
except ValueError:
continue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Only guard the section that we expect to fail:

Suggested change
try:
# Compatibility fix for new keys "ds::r:1234:e:prod".
release_id = int(release_id)
boosted_releases.append((release_id, float(timestamp)))
except ValueError:
continue
try:
# Compatibility fix for new keys "ds::r:1234:e:prod".
release_id = int(release_id)
except ValueError:
continue
else:
boosted_releases.append((release_id, float(timestamp)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unrelated nit: We convert timestamp to float 2x here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was the previous implementation, in the new one we will change that. Thanks for the suggestion!

@iambriccardo iambriccardo merged commit 2c8c265 into master Nov 21, 2022
@iambriccardo iambriccardo deleted the riccardo/fix/backward-comp-latest branch November 21, 2022 08:58
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants