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

[RHELC-1761] Format messages for consistency #1438

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bocekm
Copy link
Member

@bocekm bocekm commented Nov 25, 2024

  • no full stop at the end of a report message title
  • no word please (technical writers' rule)
  • unique report message ids
    • breaking change => to be done under a separate PR targeted for 3.0.0
  • fix typos
  • add more details where messages are too short and vague
  • make TASK tense consistent (making => make)
  • ensure each Action has a task-level log message to not have only a stream of info-level messages without proper context
  • ensure every Action prints what it's done (not just print " has succeeded")
  • boot loader => bootloader (we had a mix of these two possible variants)
  • add unit tests to lines reported by caplog as uncovered (e.g. simply adding a full stop to a string triggers a codecov patch failure when the line was not previously covered)
  • etc.

Jira Issues:

Checklist

  • PR has been tested manually in a VM (either author or reviewer)
  • Jira issue has been made public if possible
  • [RHELC-] or [HMS-] is part of the PR title
  • Label depicting the kind of PR it is
  • PR title explains the change from the user's point of view
  • Code and tests are documented properly
  • The commits are squashed to as few commits as possible (without losing data)
  • When merged: Jira issue has been updated to Release Pending if relevant

@bocekm bocekm added skip/changelog If it should be excluded from changelog or Release notes. Such as infra, reverted PRs, etc. tests/tier0 PR ready to run the essential test suit. Equivalent to `/packit test --labels tier0`. kind/refactor labels Nov 25, 2024
@bocekm bocekm requested review from Venefilyn and danmyway November 25, 2024 22:36
@bocekm bocekm requested a review from a team as a code owner November 25, 2024 22:36
@has-bot
Copy link
Member

has-bot commented Nov 25, 2024

/packit test --labels tier0


Comment generated by an automation.

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 98.91304% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.29%. Comparing base (9826704) to head (97b635d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
convert2rhel/utils/__init__.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1438      +/-   ##
==========================================
+ Coverage   96.11%   96.29%   +0.17%     
==========================================
  Files          72       72              
  Lines        5178     5186       +8     
  Branches      895      896       +1     
==========================================
+ Hits         4977     4994      +17     
+ Misses        119      115       -4     
+ Partials       82       77       -5     
Flag Coverage Δ
centos-linux-7 92.00% <96.73%> (+0.36%) ⬆️
centos-linux-8 92.67% <95.65%> (+0.18%) ⬆️
centos-linux-9 92.80% <95.65%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bocekm bocekm changed the title Format messages for consistency [RHELC-1761] Format messages for consistency Nov 25, 2024
@bocekm bocekm added tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. and removed tests/tier0 PR ready to run the essential test suit. Equivalent to `/packit test --labels tier0`. labels Nov 25, 2024
@has-bot
Copy link
Member

has-bot commented Nov 25, 2024

/packit test --labels sanity


Comment generated by an automation.

@bocekm bocekm force-pushed the message-formatting-for-consistency branch 2 times, most recently from 5457d34 to 1fd0e5b Compare November 27, 2024 17:21
@Venefilyn
Copy link
Member

Lots of merge conflicts now 😬

Copy link
Member

@hosekadam hosekadam left a comment

Choose a reason for hiding this comment

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

Some minor comments, but overall looks good

@bocekm bocekm force-pushed the message-formatting-for-consistency branch 2 times, most recently from e5b5f5c to c2c5673 Compare December 3, 2024 15:21
@bocekm
Copy link
Member Author

bocekm commented Dec 3, 2024

Conflicts resolved.
Codecov says I have not covered with tests a couple of new lines I added. But I didn't add those lines, just edited them ¯_(ツ)_/¯
EDIT: I've now added a few. I'll cover them.

@bocekm bocekm force-pushed the message-formatting-for-consistency branch 4 times, most recently from adc6f72 to 6bd4220 Compare December 3, 2024 20:12
@bocekm bocekm requested a review from a team as a code owner December 3, 2024 20:12
@bocekm bocekm force-pushed the message-formatting-for-consistency branch from 6bd4220 to dbce386 Compare December 4, 2024 22:32
@bocekm
Copy link
Member Author

bocekm commented Dec 4, 2024

@hosekadam, @Venefilyn, @danmyway, ready for review.

@bocekm bocekm force-pushed the message-formatting-for-consistency branch from dbce386 to d0fd418 Compare December 4, 2024 23:24
@bocekm bocekm force-pushed the message-formatting-for-consistency branch 3 times, most recently from 60e471d to 4846937 Compare December 6, 2024 16:34
@bocekm bocekm added tests/all Run the full test suite. Equivalent to `/packit test`. and removed tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. labels Dec 6, 2024
@bocekm
Copy link
Member Author

bocekm commented Dec 6, 2024

/packit test

@oamg oamg deleted a comment from has-bot Dec 6, 2024
Copy link
Member

@Venefilyn Venefilyn left a comment

Choose a reason for hiding this comment

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

Didn't get through most of the code yet but see some things to change about wording, dots inconsistencies.

Most importantly though, lets not change the IDs unless we plan on a major version bump.

@@ -34,7 +34,7 @@ def run(self):
super(ListNonRedHatPkgsLeft, self).run()
loggerinst.task("List remaining non-Red Hat packages")

loggerinst.info("Listing packages not signed by Red Hat")
loggerinst.info("Listing packages not signed by Red Hat.")
Copy link
Member

Choose a reason for hiding this comment

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

This will be unique as most don't have a dot in them, but definitely more valid with a dot than without. Just an FYI

Copy link
Member Author

Choose a reason for hiding this comment

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

Most info messages had a full stop. For consistency I've added the full stop to all of them (and to other levels such as debug or critical as well).

@@ -126,7 +126,7 @@ def _check_host_metering_configuration(self):
:rtype: bool
"""
if tool_opts.configure_host_metering is None:
logger.debug("You have not enabled configuration of host metering. Skipping it.")
logger.info("You have not enabled configuration of host metering. Skipping it.")
return False
Copy link
Member

Choose a reason for hiding this comment

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

Dots seems to be removed by accident?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what you're referring to exactly here. In the line above I changed the debug log level to info because without the --debug option users wouldn't see this message that is more than just of debugging nature. No dots removed.

@@ -46,7 +46,7 @@ def run(self):
self.add_message(
level="INFO",
id="SKIPPED_MODIFIED_RPM_FILES_DIFF",
title="Skipped comparison of 'rpm -Va' output from before and after the conversion.",
title="Skipped comparison of 'rpm -Va' output from before and after the conversion",
Copy link
Member

Choose a reason for hiding this comment

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

Dot removed here as well

Copy link
Member Author

Choose a reason for hiding this comment

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

This is intentional. It's one of the goals of the PR - to remove full stops from message titles for consistency. Most titles didn't have it, so I opted for removing them from all.

The message titles are printed this way:

(INFO) MODIFIED_RPM_FILES_DIFF::FOUND_MODIFIED_RPM_FILES - Modified rpm files from before and after the conversion were found
     Description: ...

In Insights they are displayed in this fashion:
Screenshot from 2024-09-03 17-20-22

In both cases (CLI, Insights) it's more suitable to have the titles without full stops.

Comment on lines +54 to 56
"""Back up redhat release file before starting conversion process"""
logger.task("Back up redhat-release files")

Copy link
Member

Choose a reason for hiding this comment

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

I would say Backup instead of back up. What is the Red Hat preferred word?

Copy link
Member Author

Choose a reason for hiding this comment

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

Backup is a noun, back up is a verb.
"You are backing up a file and then you have a file backup."

convert2rhel/actions/pre_ponr_changes/handle_packages.py Outdated Show resolved Hide resolved
convert2rhel/actions/system_checks/convert2rhel_latest.py Outdated Show resolved Hide resolved
- no full stop at the end of a report message title
- no word please (technical writers' rule)
- boot loader => bootloader
- fix typos
- add missing context where messages are too short and vague
- make TASK tense consistent
- ensure each Action has a TASK level log message
- ensure every Action prints what it's done
- add unit tests to lines reported by caplog as uncovered
@bocekm bocekm force-pushed the message-formatting-for-consistency branch from 4846937 to 97b635d Compare December 6, 2024 19:42
@bocekm
Copy link
Member Author

bocekm commented Dec 6, 2024

/packit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor skip/changelog If it should be excluded from changelog or Release notes. Such as infra, reverted PRs, etc. tests/all Run the full test suite. Equivalent to `/packit test`.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants