Commit Graph

27 Commits

Author SHA1 Message Date
jonathanmetzman 01544e9538
WIP: allow running ClusterFuzzLite locally (#9087) 2022-12-14 11:23:15 -05:00
jonathanmetzman 82bc258fde
[ClusterFuzzLite] Support local runs (#6987) 2022-01-19 17:24:47 -05:00
jonathanmetzman 4ce563f882
Fix diffing on non-GitHub and improve config (#6707)
Fix diffing on non-GitHub and improve config

1. Remove obsolete comments.
2. Remove unused function get_pr_ref
3. Correct comment on git_sha
4. Rename commit_sha to git_sha
5. Make base_commit, pr_ref, and base_ref non-github specific and move to
CiEnvironment.
6. Hoist get_diff_base to base class to allow diffing
7. Fix downloading coverage on non-Github.
8. Add TODO so that we don't assume github actions is run on github.com
(enterprise users)
9. Rename repo_url to git_url.
10. Add missing git_url method base class.
11. Clarify what git_url, git_sha and pr_ref are for and leave TODOs about how
we can eliminate them.
12. Fix typos.
2021-10-31 20:36:07 -04:00
Oliver Chang 3c564bca6c
Fix download_latest_build for pull requests. (#6688)
Getting the LATEST_BUILD_WINDOW latest commits from HEAD^ is wrong. We
should use the diff base instead.

Also modify the Ci.get_diff_base methods to not include "..." in the
return value. This will be appended in get_changed_code_under_test
instead.

This also potentially fixes a behaviour mismatch with GitHub
PRs and diffing against the latest base branch rather than
git merge-base base-branch HEAD.
2021-10-29 09:23:33 -04:00
jonathanmetzman b77a55b9b4
[ClusterFuzzLite] Support GCB and gsutil/gcs as filestore. (#6629)
* add gsutil filestore

* lint

* Fix

* Add build image script

* get gcb fuzzing working

* fmt and fix config_utils_test

* Check that crashes are uploaded

* Add no_filestore

* fix test

* fix tests

* fix

* Print crash URL

* Fix

* fix

* fmt

* lnt

* fix

* fmt
2021-10-27 10:00:04 -04:00
Oliver Chang d951635512
Upload crash artifacts per target by its name. (#6660)
Rather than always upload to the "current" artifact.
2021-10-27 04:02:18 +00:00
Oliver Chang 570c150a05
cifuzz: set log level to info by default. (#6604)
Also fix some logging issues:

- Don't output every single stacktrace when determining if a crash is reproducible.
  It outputs too many things into the logs and makes it hard to read. 

- Log OSS-Fuzz corpus path

- Fix a minor typo and an error log with deleting the xenial image.
2021-10-26 02:18:17 +00:00
Oliver Chang d178de5e00
CFLite: Fix corpus pruning for git store. (#6434)
Fixes #6376.
2021-09-15 11:49:29 +10:00
Oliver Chang a4bc23909b
Don't upload builds in run_fuzzers. (#6151)
The current way adds a lot of ordering assumptions, and doesn't fit too
well with parallel batch fuzzing either. Add a "upload-build" boolean action
input that can be added to "build_fuzzers" to upload latest builds
instead.

Builds are now uploaded by commit hash, rather than a fixed "latest" name.
ClusterFuzzLite's download_latest_build will check the last 3 commits and download the
first available build by git hash.
2021-08-17 06:36:06 +00:00
jonathanmetzman 94cfc4fe2f
[cifuzz] Add pruning task (#6188)
Fixes: #6064
2021-08-10 11:10:10 -07:00
jonathanmetzman 32519c1601
[cifuzz] Implement get_files_covered_by_target for external users (#6132)
This should mostly complete support for affected fuzzers for external users.
This implementation is still imperfect however. 
It relies on the name of the repo being the same as the name of the directory in $SRC/ that the repo is checked out in
(i.e. repo must be checked out in $SRC/$REPO_NAME).
2021-07-29 06:35:01 -07:00
Oliver Chang 69400fb24b
Add a Git backed filestore. (#6088)
- Add storage-repo, storage-repo-branch, and
  storage-repo-branch-coverage fields to the actions, to indicate that
  the Git filestore should be used.
- The CI provided filestore is still used for crashes and builds.
- Replace generic Filestore.upload_directory with typed upload methods
  which matches the download methods.
- Rename upload_latest_build to upload_build to make it more generic.
- Make artifact name prefixes an implementation detail of the store.

For #6052.
2021-07-27 10:46:20 +10:00
jonathanmetzman c67d5b8626
[CIFuzz] Fix build uploading. (#6096)
Previously, the downloaded build was uploaded instead of the new build.
This regression was introduced when the big workspace change was made.
Also, add more logging.
2021-07-22 12:52:07 -07:00
jonathanmetzman 2a3a1e903a
[CIFuzz] Add cifuzz- prefix to all artifacts (#6084)
This will prevent conflicts with other artifacts in the repo.
2021-07-21 11:36:11 -07:00
jonathanmetzman 6baa5e3e68
[CIFuzz] Fix bug in tar_directory (#6083)
We need to split the archive_path
2021-07-21 10:19:32 -07:00
jonathanmetzman fde0a30492
[CIFuzz] Support uploading coverage reports (#6078) 2021-07-21 09:19:47 -07:00
jonathanmetzman 6004ddf363
[NFC][cifuzz] Delete debug code and improve naming (#6082) 2021-07-21 09:18:44 -07:00
Oliver Chang c7cab23c20
Make oss-fuzz-project-name optional. (#6071)
Also rename code uses from `project_name` to `oss_fuzz_project_name`, to
be more explicit, and use it to determine whether or not we're running
an OSS-Fuzz project or not.

For external fuzzing #6051.
2021-07-21 05:32:32 +00:00
jonathanmetzman 86392ca2f4
[CIFuzz][ClusterFuzzLite] Prepare to support coverage reports for external users (#6074)
1. Make coverage script accept an env var that controls where the generated report is written to. Use this in generate_coverage_report.
2. Rename CoverageGetter to OSSFuzzCoverage
3. Make affected_fuzz_targets get coverage object from clusterfuzz_deployment.
4. Add stubbed FilesystemCoverage class that will be used by non-OSS-Fuzz users.
5. Make ClusterFuzzLite able to return coverage object by downloading old coverage report and returning a FilesystemCoverage object.
6. Add stub to ClusterFuzzLite for uploading coverage.

Related: #6054
2021-07-20 10:04:57 -07:00
jonathanmetzman 0a398c892b
Fix misspelling of Implementation (#6073) 2021-07-20 07:38:16 -07:00
jonathanmetzman 0672aa4e1f
[CIFuzz] Don't make everything a subdirectory of /out (#5970)
Use different subdirectories of workspace for builds, old builds, coverage reports, corpora and artifacts/testscases.
2021-06-30 07:34:42 -07:00
jonathanmetzman ae5e4228e8
[CIFuzz][ClusterFuzzLite] Implement batch fuzzing (#5963)
[ClusterFuzzLite] Support use of github actions as a filestore
2021-06-25 08:42:10 -07:00
jonathanmetzman 26dea63cde
[CIFuzz][NFC] Replace format strings with f-strings. (#5933)
Also replace % formatting.
2021-06-17 11:26:42 -07:00
jonathanmetzman 0034bfde5d
[CIFuzz] Refactor HTTP code and use a newer python. (#5842)
* Move to http_utils

* Update dockerfiles

* Dont install python3 from apt if we copy it into image

* fix

* fmt

* Add missing
2021-06-14 09:26:04 -07:00
jonathanmetzman 8d313798ab
[CIFuzz][NFC] Add skeleton for ClusterFuzzLite and Filestore (#5843) 2021-05-26 09:14:23 -07:00
jonathanmetzman 21b47a7a22
[cifuzz][NFC] Handle TODOs (#5104)
Handle some TODOs
1. Get rid of multiple return values and replace with a more sensible
return value.
2. Eliminate some useless TODOs.
2021-02-04 07:15:51 -08:00
jonathanmetzman 7f150fe75e
[cifuzz] Abstract-away OSS-Fuzz specific bits (#5088)
Abstract away OSS-Fuzz specific bits into the OSSFuzz implementation
of the ClusterFuzzDeployment class. This will make it easier to implement
support for other deployments of ClusterFuzz (including ClusterFuzzLite).
2021-02-03 12:46:19 -08:00