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

be consistent in the way we round seconds #16070

Merged
merged 2 commits into from Apr 29, 2024
Merged

Conversation

tgummerer
Copy link
Collaborator

@tgummerer tgummerer commented Apr 26, 2024

In some cases we only display full seconds, particularly when rendering the summary event, and when converting the engine event for use in the API. However we are currently not consistent with that, rounding up in the display code and rounding down when converting the engine event.

It probably doesn't matter what exactly we are doing here, but for writing display snapshot tests it does. Let's split the difference here, and always round up, so we never give the impression that the operation took no time.

It doesn't look like Pulumi Cloud shows this at all, so it probably doesn't matter for users, and we could just round up for everyone as well. I don't have strong opinions about that.

In some cases we only display full seconds, particularly when
rendering the summary event, and when converting the engine event for
use in the API.  However we are currently not consistent with that,
rounding up in the display code and rounding down when converting the
engine event.

It probably doesn't matter what exactly we are doing here, but for
writing display snapshot tests it does.  Let's split the difference
here, and always round to the nearest second.
@tgummerer tgummerer added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Apr 26, 2024
@tgummerer tgummerer requested a review from a team as a code owner April 26, 2024 14:53
@pulumi-bot
Copy link
Contributor

pulumi-bot commented Apr 26, 2024

Changelog

[uncommitted] (2024-04-29)

@tgummerer tgummerer added this pull request to the merge queue Apr 26, 2024
@Frassle Frassle removed this pull request from the merge queue due to a manual request Apr 26, 2024
@Frassle
Copy link
Member

Frassle commented Apr 26, 2024

Removing from queue. Just hit me why we round up in display, it's stop things saying the took "0s". We probably want to keep that behaviour, so roundup in engine events instead?

@tgummerer
Copy link
Collaborator Author

Removing from queue. Just hit me why we round up in display, it's stop things saying the took "0s". We probably want to keep that behaviour, so roundup in engine events instead?

Ah that makes sense. I've adjusted it to always round up now.

@tgummerer tgummerer added this pull request to the merge queue Apr 29, 2024
Merged via the queue into master with commit f3f0b19 Apr 29, 2024
49 checks passed
@tgummerer tgummerer deleted the tg/duration-consistency branch April 29, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants