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

[presubmit] Enforce language attribute in project.yaml to be always set. #3477

Merged
merged 9 commits into from
Mar 10, 2020
8 changes: 8 additions & 0 deletions docs/getting-started/new_project_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Once the template configuration files are created, you can modify them to fit yo
This configuration file stores project metadata. The following attributes are supported:

- [homepage](#homepage)
- [language](#language)
- [primary_contact](#primary)
- [auto_ccs](#primary)
- [vendor_ccs](#vendor) (optional)
Expand All @@ -82,6 +83,13 @@ This configuration file stores project metadata. The following attributes are su
### homepage
You project's homepage.

### language

Programming language the project is written in. Most often this would be `c` or
`c++`. Other values for this attribute are documented in language specific
documentation pages (e.g.
[Integrating a Go project]({{ site.baseurl }}//getting-started/new-project-guide/go-lang/)).

### primary_contact, auto_ccs {#primary}
The primary contact and list of other contacts to be CCed. Each person listed gets access to ClusterFuzz, including crash reports and fuzzer statistics, and are auto-cced on new bugs filed in the OSS-Fuzz
tracker. If you're a primary or a CC, you'll need to use a [Google account](https://support.google.com/accounts/answer/176347?hl=en) to get full access. ([why?]({{ site.baseurl }}/faq/#why-do-you-require-a-google-account-for-authentication)).
Expand Down
21 changes: 14 additions & 7 deletions infra/presubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@ class ProjectYamlChecker:
'view_restrictions',
'language',
'help_url',
'labels', # For internal use only, hard to lint as it uses fuzzer names.
'selective_unpack',
]

LANGUAGES_SUPPORTED = ['c', 'cpp', 'go', 'rust', 'python']
LANGUAGES_SUPPORTED = [
'c',
'c++',
'go',
'rust',
]

# Note that some projects like boost only have auto-ccs. However, forgetting
# primary contact is probably a mistake.
Expand Down Expand Up @@ -188,14 +195,14 @@ def check_valid_emails(self):
self.error(email_address + ' is an invalid email address.')

def check_valid_language(self):
"""Check that the language specified is valid."""
"""Check that the language is specified and valid."""
language = self.data.get('language')
if not language:
return

if language not in self.LANGUAGES_SUPPORTED:
self.error('{language} is not supported ({supported}).'.format(
language=language, supported=self.LANGUAGES_SUPPORTED))
self.error('Missing "language" attribute in project.yaml.')
elif language not in self.LANGUAGES_SUPPORTED:
self.error(
'"language: {language}" is not supported ({supported}).'.format(
language=language, supported=self.LANGUAGES_SUPPORTED))


def _check_one_project_yaml(project_yaml_filename):
Expand Down
2 changes: 2 additions & 0 deletions infra/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
# limitations under the License.
#
################################################################################
"""Templates for OSS-Fuzz project files."""

PROJECT_YAML_TEMPLATE = """\
homepage: "<your_project_homepage>"
language: <programming_language> # Example values: c, c++, go, rust.
primary_contact: "<primary_contact_email>"
"""

Expand Down
1 change: 1 addition & 0 deletions projects/arduinojson/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/bblanchon/ArduinoJson"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/arrow/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://arrow.apache.org/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/aspell/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/GNUAspell/aspell"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/augeas/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: https://github.com/hercules-team/augeas
language: c++
primary_contact: [email protected]
auto_ccs:
- [email protected]
Expand Down
1 change: 1 addition & 0 deletions projects/avahi/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://avahi.org/"
language: c++
primary_contact: [email protected]
auto_ccs:
- [email protected]
Expand Down
3 changes: 2 additions & 1 deletion projects/bad_example/project.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
disabled: True
homepage: "http://www.zlib.net/"
language: c++
sanitizers:
- address
- memory
- undefined
disabled: True
1 change: 1 addition & 0 deletions projects/bignum-fuzzer/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/guidovranken/bignum-fuzzer"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/binutils/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.gnu.org/software/binutils/"
language: c++
primary_contact: "[email protected]"
auto_ccs :
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/bloaty/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/google/bloaty"
language: c++
primary_contact: "[email protected]"
architectures:
- x86_64
Expand Down
1 change: 1 addition & 0 deletions projects/boost/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "http://www.boost.org/"
language: c++

# TODO: add more boost maintainers here and possibly a mailing list.
# primary_contact: "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/boringssl/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://boringssl.googlesource.com/boringssl/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/botan/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://botan.randombit.net"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/brotli/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/google/brotli"
language: c++
primary_contact: "[email protected]"
vendor_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/bzip2/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://sourceware.org/bzip2/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/c-ares/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://c-ares.haxx.se/"
language: c++
primary_contact: "[email protected]"
fuzzing_engines:
- afl
Expand Down
1 change: 1 addition & 0 deletions projects/c-blosc/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/Blosc/c-blosc"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/capstone/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.capstone-engine.org"
language: c++
primary_contact: "[email protected]"
auto_ccs :
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/casync/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/casync/casync"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/chakra/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/Microsoft/ChakraCore"
language: c++
primary_contact: "[email protected]"
fuzzing_engines:
- none
Expand Down
1 change: 1 addition & 0 deletions projects/cjson/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/DaveGamble/cJSON"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/clamav/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.clamav.net/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- [email protected]
Expand Down
1 change: 1 addition & 0 deletions projects/cmark/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "http://commonmark.org"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/cppcheck/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://cppcheck.sourceforge.net"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/cpython3/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://python.org/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/cras/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.chromium.org"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/cryptofuzz/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/guidovranken/cryptofuzz"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/curl/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://curl.haxx.se/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/dav1d/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://code.videolan.org/videolan/dav1d"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/django/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.djangoproject.com/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/dlplibs/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.documentliberation.org"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/double-conversion/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/google/double-conversion"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/dropbear/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://matt.ucc.asn.au/dropbear/dropbear.html"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/easywsclient/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/dhbaird/easywsclient"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/ecc-diff-fuzzer/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/catenacyber/elliptic-curve-differential-fuzzer"
language: c++
primary_contact: "[email protected]"

architectures:
Expand Down
1 change: 1 addition & 0 deletions projects/eigen/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "http://eigen.tuxfamily.org/index.php?title=Main_Page"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/envoy/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.envoyproxy.io/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/esp-v2/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/GoogleCloudPlatform/esp-v2"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
3 changes: 3 additions & 0 deletions projects/example/project.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Provide the home page for *your* project:
homepage: "https://my-api.example.com"

# Language the project is written in:
language: c++

# Provide the e-mail for the primary contact and others:
# Un-comment the below lines to make auto-cc work.
# primary_contact: "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/expat/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://github.com/libexpat/libexpat"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/ffmpeg/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.ffmpeg.org/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/file/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "http://www.darwinsys.com/file/"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/firefox/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.mozilla.org/firefox/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- [email protected]
Expand Down
1 change: 1 addition & 0 deletions projects/firestore/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://firebase.google.com/docs/firestore/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/flac/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://xiph.org/flac/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/freeimage/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "http://freeimage.sourceforge.net/"
language: c++
primary_contact: "[email protected]"

sanitizers:
Expand Down
1 change: 1 addition & 0 deletions projects/freetype2/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://www.freetype.org/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/fuzzing-puzzles/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: https://github.com/google/fuzzer-test-suite
language: c++
primary_contact: [email protected]
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/gdal/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://gdal.org"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/gfwx/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "http://www.gfwx.org/"
language: c++
primary_contact: "[email protected]"
sanitizers:
- address
Expand Down
1 change: 1 addition & 0 deletions projects/ghostscript/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://ghostscript.com"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/giflib/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "http://giflib.sourceforge.net/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions projects/git/project.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
homepage: "https://git-scm.com"
language: c++
primary_contact: "[email protected]"
1 change: 1 addition & 0 deletions projects/glib/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage: "https://gitlab.gnome.org/GNOME/glib/"
language: c++
primary_contact: "[email protected]"
auto_ccs:
- [email protected]
Expand Down
1 change: 1 addition & 0 deletions projects/gnupg/project.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
homepage: "https://www.gnupg.org"
language: c++
primary_contact: "[email protected]"
Loading