Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

remove 'component' from generated modules and tests #196

Merged
merged 1 commit into from
Jan 17, 2017

Conversation

bocekm
Copy link
Collaborator

@bocekm bocekm commented Dec 19, 2016

And also from UI and man page.

This PR continues upon the already merged PR #195.
Resolves: rhbz#1372871

@bocekm bocekm requested a review from pirat89 December 19, 2016 18:41
@bocekm
Copy link
Collaborator Author

bocekm commented Dec 19, 2016

@AloisMahdal Another issue emerged regarding this 'easy to fix' RFE. The UI is supposed to show a history of generated assessment reports. As @pirat89 found out, it seems that with this change the UI-related processing will not be able to parse the old reports correctly (old in terms of having 'component').

If you're able to test the UI whether it works correctly with both old and new reports this week, it would help. Otherwise, I'll drop this PR and revert the previously merged PR #195. Then it can sleep in a non-master branch waiting to be resurrected once we have more time to play with RFEs. Thanks.

@AloisMahdal
Copy link
Collaborator

Nice catch. I'll be happy to test UI as well.

Copy link
Contributor

@phracek phracek left a comment

Choose a reason for hiding this comment

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

Seems to be fine from my point of view. Please test the UI whether it works properly. Just installation the newest UI and sending report should be enough. Check also test suite.

@phracek
Copy link
Contributor

phracek commented Jan 10, 2017

By the way, What is the reason to remove 'component' from modules. Till now, each message is identified by component name and if it is wrong, like 'unknown' then module has to be fixed. The message should be somehow identified and we have to find out a way, how to identify it.

I would prefer to focus to important things like #193, #184, #165, #131, #146.

@bocekm @AloisMahdal

@pirat89
Copy link
Collaborator

pirat89 commented Jan 10, 2017

@phracek Just my mini input, because I don't remember it completely.
I guess it is really mainly because of unkown component. It's wrong identificator because many modules can't be assigned to any specific component. If there has to be identificator, it should be module ID itself or just print info message that a module is now processed before run of the module, so it will be clear which module prints these logs.

@bocekm
Copy link
Collaborator Author

bocekm commented Jan 10, 2017

@phracek This was supposed to be a quick and straightforward change, having little or no effect on the existing functionality. I agree we should focus on more important issues. The best would be to revert the previous pull request PR #195.

@bocekm
Copy link
Collaborator Author

bocekm commented Jan 10, 2017

This affects only INFO|ERROR|WARNING messages, not RISK messages. When I look into /var/log/preupgrade/preupg.log, the INFO|ERROR|WARNING messages are not there. They are just in the result.xml/html - and there the log messages are part of the module/rule context, so there's actually no need to add any component or module name info to the log message.

@phracek
Copy link
Contributor

phracek commented Jan 11, 2017

@pirat89 If there are some unknown component names, then modules should be update properly. This is only information you do not specify 'COMPONENT' in your module.

@AloisMahdal
Copy link
Collaborator

@phracek The reasoning behind this is in rhbz#1372871. In short, the component part is not necessary (it's implied by module and/or message text), makes log parsing harder and is never used by any module anyway.

Also, while functional impact is not so significant, one of reasons for this is also to aid the cleanup goal by getting rid of unnecessary code: the idea is that by every (smaller, more focused and testable) step like this, we can shave off a little bit of complexity that makes refactoring so risky and painful.

Regarding processing old vs. new reports in UI: We could support both formats. However I highly doubt that we have been keeping compatibility between reports, nobody ever tested this AFAIK. Also, given that the rule is to always use latest, freshest possible assessments (with official upgrade path this is even a hard requirement), the scenario where user needs to view an old report next to new one in UI does not seem very likely to me.


The function creates logs in the format:

<SEVERITIES> <component> <TIMESTAMP> <MESSAGE>
<SEVERITIES> <TIMESTAMP> <MESSAGE>
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 actually not true, there's no timestamp anymore. The result is that the log messages are not shown in UI in the current state and will not be after this update.

@pirat89
Copy link
Collaborator

pirat89 commented Jan 12, 2017

@phracek Which component should I set for module that serves 1000 rpms? Or set of all libraries? Or when module solves troubles for just two component... etc. There is not any specific component for such modules. And we have many modules like that. Should I set "distribution"? In that case the component doesn't have any usable information and "distribution" has same benefit as "unkown".

Agree with Lojza in this.

@bocekm
Copy link
Collaborator Author

bocekm commented Jan 17, 2017

We tested this change with @AloisMahdal and it has no impact on UI.

@bocekm bocekm merged commit 5afe41d into master Jan 17, 2017
@bocekm bocekm deleted the remove_component_from_log branch January 19, 2017 13:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants