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

Enhance elapsed time display in UI Hook with minutes and seconds #36618

Merged
merged 6 commits into from
Mar 5, 2025

Conversation

GuiiifSouza
Copy link
Contributor

This PR improves the elapsed time display in the UI Hook by changing it from seconds-only to a more readable mm:ss format.

Previously, elapsed time was displayed in seconds only, making it hard to interpret for longer durations. Now, it follows the 00m00s format, making it more user-friendly.

This improvement directly addresses Issue #36368, which requests better readability for elapsed time display.

Main Changes:
Added separate calculations for minutes and seconds.
Updated the display string format to include mm:ss.
Kept the existing rounding logic for time calculations.

now:
Screenshot 2025-03-03 152509

before:
Screenshot 2025-03-03 152441

Fixes #36368

Target Release

1.12.x

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@GuiiifSouza GuiiifSouza requested a review from a team as a code owner March 3, 2025 18:31
Copy link

hashicorp-cla-app bot commented Mar 3, 2025

CLA assistant check
All committers have signed the CLA.

@crw crw added the enhancement label Mar 3, 2025
@crw
Copy link
Contributor

crw commented Mar 4, 2025

Thanks for this submission!

@GuiiifSouza
Copy link
Contributor Author

Obrigado por este envio!

Thank you!

I'm excited to start contributing to Terraform, as I use it frequently at work and truly enjoy the technology.

Since this is my first time contributing to open-source projects, I’d like to understand the best ways to help. Would resolving open issues be a good approach, or are there other recommended ways to contribute?

Additionally, I’d like to better understand how I can assist with this specific issue. It seems that only someone from HashiCorp can authorize my testing on Vercel. I attempted the procedure, but it requires authorization from someone at Vercel.

@crw
Copy link
Contributor

crw commented Mar 4, 2025

The first thing is to read https://github.com/hashicorp/terraform/blob/main/.github/CONTRIBUTING.md. It can be difficult to contribute directly to Terraform as even small changes can have a big impact on other users of the software. Even this change has us asking, "what if someone is relying on the previous output format?" This is the nature of a widely-used, mature codebase - it becomes more risky to make even small changes. It is much easier, and very appreciated, to contribute to the providers (like AWS, Azure, etc).

Per the Contributing.md, if you want to contribute we prefer to discuss the proposed implementation on the issue in question before a PR is opened. You are welcome to open PRs, but be aware they will likely mostly not be reviewed if you haven't received previous maintainer consensus on your approach.

Thanks!

@GuiiifSouza
Copy link
Contributor Author

The first thing is to read https://github.com/hashicorp/terraform/blob/main/.github/CONTRIBUTING.md. It can be difficult to contribute directly to Terraform as even small changes can have a big impact on other users of the software. Even this change has us asking, "what if someone is relying on the previous output format?" This is the nature of a widely-used, mature codebase - it becomes more risky to make even small changes. It is much easier, and very appreciated, to contribute to the providers (like AWS, Azure, etc).

Per the Contributing.md, if you want to contribute we prefer to discuss the proposed implementation on the issue in question before a PR is opened. You are welcome to open PRs, but be aware they will likely mostly not be reviewed if you haven't received previous maintainer consensus on your approach.

Thanks!

Got it, thanks for the clarification. Since the issue was already open, I went ahead and worked on a solution, thinking it would be a good contribution. Now I understand that discussing the approach first is preferred in this project.

For future contributions, I'll make sure to align with the maintainers before opening a PR. Appreciate the guidance!

Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @GuiiifSouza! 🚀

After we discussed this internally we're happy to accept this PR. Like Craig mentioned, there is a possibility that the old elapsed time format could be something people use when parsing Terraform's terminal output. That possibility feels slim though, and if any issues did arise this change would be easy to revert in future.

@SarahFrench SarahFrench merged commit d845df9 into hashicorp:main Mar 5, 2025
8 checks passed
@GuiiifSouza
Copy link
Contributor Author

Thanks for the opportunity to contribute, @SarahFrench and @crw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Format 0 seconds as two digits
3 participants