Add support to helper.py for external projects for all subcommands except `download_corpora`.
External users just need to specify `build_integration_path`, `project_src_path` and `external`.
Also do a big refactor to pass a project object as part of args instead of a string containing the name of the project or its
path.
Related: #6125
Exposing the mount location for local sources to a command-line
argument makes it possible to reproduce findings with local source
even for umbrella projects with WORKDIR $SRC/.
Fix behavior of build_image --pull (Fixes#5640)
Also refactor helper.py:
1. Change behavior of functions so that most return True on success and False on failure.
2. Only main will return 1 on failure and 0 on success now. Previous behavior was very error prone.
3. Rename _get_output_dir to _get_out_dir.
4. Make function docstrings use descriptive tense.
5. Make helper.py print help when no argument is specified.
When we fail a build, we attempt to identify the first OSS-Fuzz commit
prior to the upstream commit date.
If this does not exist, we bailed out. This commit changes it such that
we at least try on the oldest integration commit.
This is a best effort attempt to parse the relevant copy command from
the Dockerfile.
Also add a main function to build_specified_commit to make it easier to
test.
When the build fails against HEAD OSS-Fuzz, we find the date of the
commit for the project, and use the latest revision of OSS-Fuzz before
it to rebuild the project builder container.
Subsequent runs will use the last built container, and if that fails
that will again find the closest revision of OSS-Fuzz.
Also factor BaseRepoManager out of RepoManager to provide a generic repo
manager class for dealing with existing checkouts (which don't need a
clone).
Let build failures continue during the actual bisection for now to keep
the bisection going. A future PR can improve the logic of that when it
happens.
* Max comments
* Added bisection tests
* Added test cases
* Docker run command added to build_specific commit
* Infer main repo uses docker image rather than docker file
* Added mores tests for repo infer
* With verbosity
* Formatting
* Bisection fixed
* Formatting updates
* Oliver small comments.
* Script infer main repo
* Detect repo and test module finished
* Detect main repo from script
* Regex searching
* Regex searching
* Max comments + bisector test script
* Oliver comments
* Max's comments
* String concat update
* Jonathan comments
* Starting the git python API
* repo manager working with tests
* Docker repo manager working, can update image with specific commit
* Working bisection
* Formatting and linting
* Working bisection
* Specific commit checkout
* Specific commit checkout
* Removed bisector and updated helper
* remove branch bug
* Max comments
* Added tests for infer main repo
* Oliver comments
* helper.py function names change
* Oliver comments pt. 2
* Olivers comments
* Formatting updates
* Removing DockerRepoManager class
* Removing DockerRepoManager class
* Changing from copying repo to docker image to mounting repo on docker image
* Jonathan comments
* Build image from commit tests
* Oliver comments pt.3
* Oliver comments pt.4
* Linting
* Max comments pt. 2
* change check commit exists
* Max comments pt. 3
* Regex updated
* Formatting updates