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
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.
Repos cloned with `--branch BRANCH` will only track that branch, even
when we unshallow. If we provide a git SHA from another branch, it will
not be recognized.
To fix, this, we update the remote tracking config and fetch them.
For google/osv#88.
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