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

Change result note key from a string to a list of strings #3254

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

happz
Copy link
Collaborator

@happz happz commented Oct 1, 2024

This better represents its real nature: a collection of various notes, there may be more than one note or topic tmt needed to share with user depending on what happened while the test was running.

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • modify the json schema
  • mention the version
  • include a release note

@happz happz added breakage Change will change current behaviour area | results Related to how tmt stores and shares results labels Oct 1, 2024
@happz happz added this to the 1.38 milestone Oct 1, 2024
@happz
Copy link
Collaborator Author

happz commented Oct 1, 2024

@psss @thrix @lukaszachy This is definitely a breaking change for TF, and potentially for other users as well. TF ingests the field and treats it as a string, it will require at least two patches to accommodate the change - simple ones, but still.

Yet I believe this change should happen because it better reflects the nature of the note field: there can be multiple notes attached to a single test, and 1. code needs to take extra measures to stack notes correctly, and 2. this robs consumer from processing them, e.g. filtering or rendering accordingly to their meaning for the end user. For example, a test with a failed test check that failed to reboot its guest & enforces interpretation of its result by setting its result field may collect three notes - and such a scenario is not that unusual, reboots are common, outages too, and checks are getting more and more traction. By using a list, we would make the code simpler, it'd let consumers format and mangle them as they need, and it'd be easier to add new notes - which I think will be a considerable advantage WRT results of prepare and finish steps we don't generate yet, but I experimented a bit with those and some plugins may share extra details in their result notes, which was very tedious with note += ', foo...'.

So, how to proceed to make it as painless for the end user as possible? Do we know who out there consumes results.yaml?

@happz happz added the ci | full test Pull request is ready for the full test execution label Oct 7, 2024
@happz happz force-pushed the results-note-as-array branch 2 times, most recently from 713c0e6 to f15eee5 Compare October 7, 2024 13:05
@thrix
Copy link
Collaborator

thrix commented Oct 8, 2024

So, how to proceed to make it as painless for the end user as possible? Do we know who out there consumes results.yaml?

I am fine introducing the breaking change, makes sense to me. I am not aware of any other user of results.yaml besides Testing Farm. Our users do not consume this file, they consume XML if they need some machine-readable output afaik.

I would like to take this as an example how the upcoming integration test to Testing Farm will provide a value here. Use it as a guinea pig showing that our Testing Farm worker code it is ready for this change.

@thrix
Copy link
Collaborator

thrix commented Oct 10, 2024

So, how to proceed to make it as painless for the end user as possible? Do we know who out there consumes results.yaml?

I am fine introducing the breaking change, makes sense to me. I am not aware of any other user of results.yaml besides Testing Farm. Our users do not consume this file, they consume XML if they need some machine-readable output afaik.

I would like to take this as an example how the upcoming integration test to Testing Farm will provide a value here. Use it as a guinea pig showing that our Testing Farm worker code it is ready for this change.

Still working it out, got blocked a bit :(

@happz happz force-pushed the results-note-as-array branch 2 times, most recently from 0c8e436 to 084e24a Compare October 22, 2024 07:15
@thrix thrix modified the milestones: 1.38, 1.39 Oct 25, 2024
Copy link
Collaborator

@martinhoyer martinhoyer left a comment

Choose a reason for hiding this comment

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

@happz Thanks for this!
Would this be a breaking change for custom-results users?

tmt/steps/report/html/template.html.j2 Outdated Show resolved Hide resolved
@happz happz modified the milestones: 1.39, 1.40 Nov 14, 2024
@psss
Copy link
Collaborator

psss commented Dec 9, 2024

So, how to proceed to make it as painless for the end user as possible? Do we know who out there consumes results.yaml?

I am fine introducing the breaking change, makes sense to me. I am not aware of any other user of results.yaml besides Testing Farm. Our users do not consume this file, they consume XML if they need some machine-readable output afaik.
I would like to take this as an example how the upcoming integration test to Testing Farm will provide a value here. Use it as a guinea pig showing that our Testing Farm worker code it is ready for this change.

Still working it out, got blocked a bit :(

@thrix, is the Testing Farm part ready for this change? Or shall we still postpone merging?

@happz happz modified the milestones: 1.40, 1.41 Dec 10, 2024
@happz happz force-pushed the results-note-as-array branch from 084e24a to a40aef0 Compare January 9, 2025 13:44
@janhavlin
Copy link
Collaborator

I created a patch to account for this change on TF side: https://gitlab.com/testing-farm/gluetool-modules/-/merge_requests/856

TF will accept list[str] | str | None type in the note field.

@psss psss force-pushed the results-note-as-array branch from 35d827a to 2026f15 Compare January 10, 2025 08:47
@psss
Copy link
Collaborator

psss commented Jan 10, 2025

I created a patch to account for this change on TF side

Great, thanks! Then we are unblocked here, rebased.

Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

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

Looks good, I just find the list format in the html report not well aligned. Propose a slight css style adjustmetn in 20a55f1.

For comparison, this is before the change:
image

After the change:
image

And with the style adjustment:
image

@psss
Copy link
Collaborator

psss commented Jan 10, 2025

@happz, seems that unit tests will need some adjustments as well:

>       assert interpreted.note is None
E       AssertionError: assert [] is None

@happz happz force-pushed the results-note-as-array branch from 20a55f1 to f705e9e Compare January 10, 2025 10:29
@happz
Copy link
Collaborator Author

happz commented Jan 10, 2025

@happz, seems that unit tests will need some adjustments as well:

>       assert interpreted.note is None
E       AssertionError: assert [] is None

Hopefully addressed in f705e9e.

@psss
Copy link
Collaborator

psss commented Jan 13, 2025

Hopefully addressed in f705e9e.

Great, thanks! Tests are now green.

I see three checklist items missing and I'd say they all make sense. What about adding a short mention about the note field change from string to lint to the result specification and mention the tmt version there? Probably worth also to mention this in the release notes. @happz, what say you?

@happz happz force-pushed the results-note-as-array branch from f705e9e to 5467319 Compare January 13, 2025 11:21
@happz
Copy link
Collaborator Author

happz commented Jan 13, 2025

Hopefully addressed in f705e9e.

Great, thanks! Tests are now green.

I see three checklist items missing and I'd say they all make sense. What about adding a short mention about the note field change from string to lint to the result specification and mention the tmt version there? Probably worth also to mention this in the release notes. @happz, what say you?

Sure, how about cfa5e89?

@happz happz force-pushed the results-note-as-array branch from 5467319 to cfa5e89 Compare January 13, 2025 11:22
happz and others added 6 commits January 13, 2025 14:42
This better represents its real nature: a collection of various notes,
there may be more than one note or topic tmt needed to share with user
depending on what happened while the test was running.
Otherwise it expands the table cells a bit too much.
@psss psss force-pushed the results-note-as-array branch from cfa5e89 to 6acae09 Compare January 13, 2025 13:42
@psss
Copy link
Collaborator

psss commented Jan 13, 2025

Sure, how about cfa5e89?

Great! And we're done here, thanks!

@psss psss added the status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. label Jan 13, 2025
@psss psss merged commit ba6756b into main Jan 13, 2025
20 checks passed
@psss psss deleted the results-note-as-array branch January 13, 2025 15:12
@psss psss self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area | results Related to how tmt stores and shares results breakage Change will change current behaviour ci | full test Pull request is ready for the full test execution status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants