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

Extend mail characteristics2 #82

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

8sd
Copy link
Contributor

@8sd 8sd commented Aug 3, 2021

This PR adds Jailhouse-support for the ignored patch analysis

return False

def _integrated_correct(self, repo, maintainers_version):
if self.first_upstream in repo:
upstream = repo[self.first_upstream]
self.committer = upstream.committer.name.lower()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wollen wir hier vielleicht die Mailadresse ausleiten? Die ist aussagekräftiger, oder?

Copy link
Member

Choose a reason for hiding this comment

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

Okay, I remember that - for some reason - we talked about this change, but I don't understand at the moment why we did this. Could you please factor this change out to an own commit with an explanation why we do this? This change is preparatory work for supporting other projects, and not related to the introduction of Jailhouse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need this to get the committer of patches in projects without a maintainer.
Without this change, we would return from this function before we get this information.
The information about the committer however is relevant and valid for all projects.



class JailhouseMailCharacteristics(MailCharacteristics):
ROOT_DIRS = ['ci',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hier müsstest du mir noch das Skript zukommen lassen, mit dem du alle Versionen überprüft hast.
Andernfalls scripte ich das selbst.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, just sent it to you. The directories seem complete!

Copy link
Member

@rralf rralf left a comment

Choose a reason for hiding this comment

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

see inline comments

"""
PaStA - Patch Stack Analysis

Copyright (c) OTH Regensburg, 2021
Copy link
Member

Choose a reason for hiding this comment

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

OTH is not the copyright holder in this case. So this is either your university, or you.



class JailhouseMailCharacteristics(MailCharacteristics):
ROOT_DIRS = ['ci',
Copy link
Member

Choose a reason for hiding this comment

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

Yep, just sent it to you. The directories seem complete!

'setup.py',
'TODO.md',
'.travis.yml',
'VERSION',
Copy link
Member

Choose a reason for hiding this comment

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

We miss:

driver.c
jailhouse.h
README (there was an ancient version without .md)
TODO (same here)

Rest looks good!

return False

def _integrated_correct(self, repo, maintainers_version):
if self.first_upstream in repo:
upstream = repo[self.first_upstream]
self.committer = upstream.committer.name.lower()
Copy link
Member

Choose a reason for hiding this comment

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

Okay, I remember that - for some reason - we talked about this change, but I don't understand at the moment why we did this. Could you please factor this change out to an own commit with an explanation why we do this? This change is preparatory work for supporting other projects, and not related to the introduction of Jailhouse.

@@ -197,8 +204,6 @@ def check_maintainer(section, committer):
# integrated by a maintainer that is responsible for a section that is
# affected by the patch. IOW: The field indicates if the patch was
# picked by the "correct" maintainer
upstream = repo[self.first_upstream]
self.committer = upstream.committer.name.lower()
Copy link
Member

Choose a reason for hiding this comment

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

And what about the above comments? They now point into the void?

# maintainers analysis.
patches = ids - repo.mbox.invalid
tags = {repo.patch_get_version(repo[x]) for x in patches}
maintainers_version = load_maintainers(config, tags)
Copy link
Member

Choose a reason for hiding this comment

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

What about all other projects that do not have HAS_MAINTAINERS yet? They are now broken with this change. Please factor this change out to a preparatory patch, then we get a better overview how we can handle this.

from .LinuxMailCharacteristics import LinuxMailCharacteristics
from .QemuMailCharacteristics import QemuMailCharacteristics
from .UBootMailCharacteristics import UBootMailCharacteristics
from .XenMailCharacteristics import XenMailCharacteristics
_load_characteristics = {
'jailhouse': (load_maintainers_characteristics, JailhouseMailCharacteristics),
Copy link
Member

Choose a reason for hiding this comment

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

And if we once have factored out those things, we might even see a better way to handle this dictionary here.

@@ -31,6 +31,7 @@
_tmp_repo = None

mainline_regex = {
'jailhouse': re.compile(r'^v.*$'),
Copy link
Member

Choose a reason for hiding this comment

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

Looks good.

@@ -76,7 +76,7 @@ class MailCharacteristics:
BOTS = {'[email protected]', '[email protected]',
'[email protected]', '[email protected]'}
POTENTIAL_BOTS = {'[email protected]', '[email protected]'}
PROCESSES = ['linux-next', 'git pull', 'rfc']
PROCESSES = ['linux-next', 'git pull', 'rfc', '[PULL]']
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, sounds valid. But what about having everything here in lower case, and comparing it against lower case? With this, we would also catch [pull].

return True

# Buildroot's daily results bot
if '[autobuild.buildroot.net] Daily results' in subject:
Copy link
Member

Choose a reason for hiding this comment

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

Please compare against subject.lower()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is not necessary since subject = email_get_header_normalised(self.message, 'subject') already lowers the subject.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, you're right - but then 'Daily results' will never match.

return True

# Buildroot's daily results bot
if 'oe-core cve metrics' in subject.lower():
Copy link
Member

Choose a reason for hiding this comment

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

And then you can combine those two cases.

Copy link
Member

Choose a reason for hiding this comment

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

Besides that, looks good!

Copy link
Member

Choose a reason for hiding this comment

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

And the .lower() is redundant here.

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.

2 participants