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

Get rid of fluttered build job output and color errors #374

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

ammernico
Copy link
Collaborator

No description provided.

@ammernico ammernico force-pushed the exit-status-colors branch 2 times, most recently from 063866d to 0161414 Compare April 30, 2024 14:49
@ammernico ammernico marked this pull request as draft April 30, 2024 15:13
@ammernico ammernico force-pushed the exit-status-colors branch 3 times, most recently from 2339aef to a337e8a Compare May 16, 2024 13:05
@ammernico ammernico changed the title Print exit messages in a colorful way Get rid of fluttered build job output and color errors May 16, 2024
@christophprokop
Copy link
Collaborator

tested updated version, looks much better now - thanks!

@ammernico ammernico force-pushed the exit-status-colors branch 3 times, most recently from 65bb663 to bdb7f3e Compare May 23, 2024 07:35
@ammernico ammernico marked this pull request as ready for review May 23, 2024 07:39
Copy link
Member

@primeos-work primeos-work left a comment

Choose a reason for hiding this comment

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

I didn't test it yet but based on the diff the new format looks acceptable. Some of the format/color changes make a lot of sense but there are also some that I'm not really sure about. The implementation and commit messages require a bit of work though.

config.toml Show resolved Hide resolved
src/endpoint/scheduler.rs Outdated Show resolved Hide resolved
src/endpoint/scheduler.rs Show resolved Hide resolved
src/endpoint/scheduler.rs Show resolved Hide resolved
src/endpoint/scheduler.rs Outdated Show resolved Hide resolved
src/orchestrator/orchestrator.rs Outdated Show resolved Hide resolved
src/orchestrator/orchestrator.rs Outdated Show resolved Hide resolved
src/orchestrator/orchestrator.rs Outdated Show resolved Hide resolved
src/orchestrator/orchestrator.rs Show resolved Hide resolved
src/orchestrator/orchestrator.rs Outdated Show resolved Hide resolved
@primeos-work
Copy link
Member

@christophprokop can you perhaps also provide motivation/background for or rather reasoning behind the output format changes?

The things that seem obvious:

  • Colorization to make the relevant parts (especially errors) easier recognizable
  • Shortening the progress bar to save space
  • Fixed length fields for a cleaner output structure (columnated, similar to a table)

What I'm not sure about:

@ammernico ammernico force-pushed the exit-status-colors branch 4 times, most recently from 63d5797 to f6d11a5 Compare June 5, 2024 12:33
Copy link
Member

@primeos-work primeos-work left a comment

Choose a reason for hiding this comment

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

0d1eb10 still lacks a brief commit message body.

d3d72e8: The "gets cut when longer than 6characters" should now be removed. A brief motivation would be nice (keep the output structured, constant length, table like structure, easy overview, etc. - something along those lines).

src/config/util.rs Outdated Show resolved Hide resolved
src/orchestrator/orchestrator.rs Show resolved Hide resolved
src/orchestrator/orchestrator.rs Show resolved Hide resolved
Comment on lines +596 to +597
"",
"",
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Is that information (endpoint name + container ID) not available here? In that case we should perhaps use a placeholder like dashes (that also helps with keeping the output structured/parseable).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the placeholder with dashes. The given string here "" gets filled up with dashes.
Looks a bit odd, but works

This commit enhances the finish message formatting by incorporating
color-coded status messages for improved readability and clarity.
Changes include:

- Replaced redundant format strings with simple colorized messages.
- Consolidated the final message formatting to a single step with
  colored status indicators.

Key modifications:
- Used `colored::Colorize` for colorizing the success and error
  messages.
- Simplified message construction by combining dynamic and static parts
  after determining the status.

Signed-off-by: Nico Steinle <nico.steinle@eviden.com>
This update enhances the readability of the build output by
standardizing the format and reducing text flutter when building
multiple packages. Key changes include:

- Implemented dynamic length calculation for endpoint names to ensure
  proper alignment and prevent text cutoff.
- Introduced color-coded build status blocks for better visual
  distinction.
- Updated progress bar messages to use a consistent format,
  accommodating longer endpoint names and maintaining a clean display.

Example output before and after the changes:
```
- before:
[00:00:06] (100%): █████ | [endpoint-name/XXXXXXX XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX package-name package_version]: msg
- after:
[00:00:06] (100%): █████ | endpoint-name XXXXXXX XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX ██ package_name  package_version msg
                                                                                      ^^--- colored build status block
```

Signed-off-by: Nico Steinle <nico.steinle@eviden.com>
This commit refines the progress bar format in both the `config.toml`
file and the `default_progress_format` function to improve readability
and adapt to narrower terminal widths. The changes include:

- Simplified the progress format by removing unnecessary brackets and
  adjusting the bar length.
- Reduced the progress bar length from 40 characters to 5 characters to
  fit within more compact terminal displays.

Signed-off-by: Nico Steinle <nico.steinle@eviden.com>
Copy link
Member

@primeos-work primeos-work left a comment

Choose a reason for hiding this comment

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

LGTM now, thanks for writing proper commit messages :)

Having to pass through max_endpoint_name_length isn't pretty but I guess it's the best solution/hack for the meantime.

I tested it and the output seems fine. (I would've preferred to keep some additional information in some places (like Phases:) but that's down to personal preference, I guess.)

src/orchestrator/orchestrator.rs Show resolved Hide resolved
@primeos-work primeos-work added this pull request to the merge queue Jun 6, 2024
Merged via the queue into science-computing:master with commit 2f085fb Jun 6, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants