-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[presubmit] Enforce language attribute in project.yaml to be always set. #3477
Conversation
Hey @Dor1s, TravisBuddy Request Identifier: 6d85baf0-5fed-11ea-bf9c-5be26ced5bf7 |
infra/presubmit.py
Outdated
@@ -190,12 +190,10 @@ def check_valid_emails(self): | |||
def check_valid_language(self): | |||
"""Check that the language specified is valid.""" | |||
language = self.data.get('language') | |||
if not language: | |||
return | |||
|
|||
if language not in self.LANGUAGES_SUPPORTED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a better message when language is None
like "Missing language attribute" ?
Also, does our documentation for C/C++ mention the language attribute in template ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, does our documentation for C/C++ mention the language attribute in template ?
Nope, and I also need to test this before landing, if we agree that's an acceptable solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When i tested, it appears that language: c++
is interpreted by pyyaml to be {'language': 'c++'}, so we don't need cpp.
I wouldn't say im opposed to this, but it seems like a blunt solution for the issue of coverage builds happening for non-C++ projects (I don't know enough about the coverage infra to think of an alternative).
I wonder if people in ambiguous language cases (e.g. Python libraries written in C) would get confused.
|
Yeah, there are more use cases mentioned in #3297:
|
I'll change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the documentation, presubmit check, and the new project template used by helper.py.
Please take a look. If this looks good, I'll update all the projects with missing attribute and land the change.
infra/presubmit.py
Outdated
@@ -190,12 +190,10 @@ def check_valid_emails(self): | |||
def check_valid_language(self): | |||
"""Check that the language specified is valid.""" | |||
language = self.data.get('language') | |||
if not language: | |||
return | |||
|
|||
if language not in self.LANGUAGES_SUPPORTED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
Travis tests have failedHey @Dor1s, TravisBuddy Request Identifier: 11123ad0-6229-11ea-ba95-012c7b325999 |
Hey @Dor1s, TravisBuddy Request Identifier: ce24e630-624d-11ea-ba95-012c7b325999 |
@oliverchang PTAL too, maybe you have another idea or any concerns regarding this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
infra/templates.py
Outdated
|
||
PROJECT_YAML_TEMPLATE = """\ | ||
homepage: "<your_project_homepage>" | ||
language: <programming_language> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: give valid values as examples, as otherwise it's not clear what's expected (e.g. cpp or c++) ?
Travis tests have failedHey @Dor1s, TravisBuddy Request Identifier: aa2f4450-62f7-11ea-b4e6-7500f47047b3 |
I've added |
Hey @Dor1s, TravisCI finished with status TravisBuddy Request Identifier: 6c4f1900-6309-11ea-8dd1-c14dbc1d5bef |
… runner. Should've done this in #3477. Good news is that nothing failed, the coverage job was just skipped for pretty much all projects.
My original intent was to enforce this for non C/C++ projects, but I couldn't come up with a good way to do it only in such cases. Landing this change might somewhat annoy people who contribute more changes to OSS-Fuzz for already integrated C/C++ projects, but that's fine with me -- yet another reason to remind people of the ideal integration.
UPD: when landing this change, I'll update all existing project.yaml files and we'll enforce the attribute from now on.