Commit Graph

253 Commits

Author SHA1 Message Date
dependabot[bot]
c11d89bfe6
🌱 Bump distroless/base from 29da700 to e238d40 (#4064) 2024-05-10 19:42:53 +00:00
dependabot[bot]
9e9de6ac06
🌱 Bump golang from 1.22.2 to 1.22.3 (#4098)
* 🌱 Bump golang from 1.22.2 to 1.22.3

Bumps golang from 1.22.2 to 1.22.3.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump the other 7 dockerfiles

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2024-05-10 18:08:39 +00:00
Case Wylie
39e968dceb
⚠️ errors in ErrXXX format (#4040)
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
2024-04-17 22:49:12 -07:00
Spencer Schrock
0b9dfb656f
⚠️ Replace v4 module references with v5 (#4027)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-04-12 14:51:50 -07:00
dependabot[bot]
d61c9aa11f
🌱 Bump golang from 1.22.1 to 1.22.2 (#4012) 2024-04-08 15:54:36 +00:00
dependabot[bot]
bf18c27508
🌱 Bump github.com/golangci/golangci-lint from 1.56.2 to 1.57.1 in /tools (#3966)
* 🌱 Bump github.com/golangci/golangci-lint in /tools

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.56.2 to 1.57.1.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.56.2...v1.57.1)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* remove unused wrapcheck nolint directives

wrapcheck v2.8.3 includes a fix for false positives in func literals.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* satisfy assignOp gocritic linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* convert const regex to MustCompile

included at package level to ensure regex compiles at build time.
These could stay as func regexes if desired, but we'd need test coverage
for the piper code so we know we wont panic

Signed-off-by: Spencer Schrock <sschrock@google.com>

* satisfy unslice linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* satisfy wrapperFunc linter

This seems like a nice readability change anyway

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2024-03-25 15:56:22 -07:00
Diogo Teles Sant'Anna
376ee1f4d3
⚠️ rename fields on Branch Protection Pull Request rules (#3879)
Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
2024-03-25 11:16:59 -07:00
Spencer Schrock
1d1df07770
Add experimental local OSV mode for cron releasetest worker (#3947)
* add local osv db client

Signed-off-by: Spencer Schrock <sschrock@google.com>

* enable osv experiment in cron release test

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-03-15 11:46:09 +11:00
Naveen
1bd4af7fa5
🐛 ignore .git folder for localdir (#3943)
- ignore .git folder for localdir

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2024-03-13 07:45:35 -05:00
Spencer Schrock
bfc8f37fef
🌱 Bump golang from 1.22.0 to 1.22.1 (#3941)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-03-12 03:44:15 +00:00
Spencer Schrock
6e717aa261
🐛 ignore Go stdlib vulns (#3925)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-03-06 12:31:07 -08:00
Spencer Schrock
d55dbd12e6
⚠️ Switch RepoClient file access to io.ReadCloser (#3912)
* change file access method to io.ReadCloser

callers don't always need the full file.
large files are slow and can cause crashes.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* switch tests to hardcoded readers

Previously they returned bytes or strings, which have corresponding NewReader types.
Since they don't need to be closed, io.NopCloser works well to give them a fake Close.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* switch tests which called os.ReadFile to os.Open

os.File fufills io.ReadCloser, so this is an easy change

Signed-off-by: Spencer Schrock <sschrock@google.com>

* break tarball tests into two steps: reader and read

The rest of the test was kept the same to minimize the change.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* ossfuzz doesn't implement GetFileReader

Signed-off-by: Spencer Schrock <sschrock@google.com>

* appease linter during refactor

Signed-off-by: Spencer Schrock <sschrock@google.com>

* switch git client to new method

add check which ensures git client fulfills the interface

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-03-04 17:37:50 -08:00
dependabot[bot]
b31449017e
🌱 Bump github.com/golangci/golangci-lint from 1.55.2 to 1.56.1 in /tools (#3867)
* 🌱 Bump github.com/golangci/golangci-lint in /tools

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.55.2 to 1.56.1.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.55.2...v1.56.1)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* autofix linter errors with make fix-linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* move musttag nolint directives to encode location

this was changed in v0.8.0 of the musttag linter.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2024-02-09 10:53:24 -08:00
AdamKorcz
6fc7d4c061
Add probe metadata about supported ecosystems (#3797)
* 🌱 Add probe metadata about supported ecosystems

Signed-off-by: Adam Korczynski <adam@adalogics.com>

* Add metadata for the rest of the probes

Signed-off-by: Adam Korczynski <adam@adalogics.com>

* fix wrong formatting

Signed-off-by: Adam Korczynski <adam@adalogics.com>

* remove oss-fuzz, osv, cii_blob, cii_http clients

Signed-off-by: Adam Korczynski <adam@adalogics.com>

* add github and gitlab clients for 2 probes

Signed-off-by: Adam Korczynski <adam@adalogics.com>

---------

Signed-off-by: Adam Korczynski <adam@adalogics.com>
2024-02-08 10:20:07 -08:00
Spencer Schrock
64d330790d
🌱 Update Go toolchain to 1.22 (#3859)
* update workflows to use go 1.22

Signed-off-by: Spencer Schrock <sschrock@google.com>

* update tools go.mod to 1.22.

no one imports this, so we can bump it now and
avoid issues in the future where we need to upgrade.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* bump docker files

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-02-07 11:36:37 -08:00
dependabot[bot]
6f816c80bc
🌱 Bump github.com/google/osv-scanner from 1.6.1 to 1.6.2 (#3834)
* 🌱 Bump github.com/google/osv-scanner from 1.6.1 to 1.6.2

Bumps [github.com/google/osv-scanner](https://github.com/google/osv-scanner) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/google/osv-scanner/releases)
- [Changelog](https://github.com/google/osv-scanner/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/osv-scanner/compare/v1.6.1...v1.6.2)

---
updated-dependencies:
- dependency-name: github.com/google/osv-scanner
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* specify go patch version

go mod tidy requires this. I was able to delete the toolchain directive,
and it wasn't added back.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* bump dockerfiles to 1.21.6 so the build works

Signed-off-by: Spencer Schrock <sschrock@google.com>

* bump go version used in codeql workflow

github runners currently use Go 1.20 by default,
which doesn't understand 1.21.x format.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2024-01-31 18:54:06 +00:00
Spencer Schrock
e10dbb1531
🐛 Support self-hosted GitLab instances where base URL has a path component (#3819)
* Add GL_HOST env flag

Self-hosted instances which dont use a subdomain result in broken API links.
This change may not be finished, but is intended to evaluate the solution.

Previously, self hosted instances where the instance is part of the path (foo.com/gitlab/owner/repo)
would have their API base URL registered as foo.com/api/v4/ instead of foo.com/gitlab/api/v4/

Signed-off-by: Spencer Schrock <sschrock@google.com>

* include token in gitlab project probe

Signed-off-by: Spencer Schrock <sschrock@google.com>

* consider GL_HOST when parsing gitlab repo urls

Signed-off-by: Spencer Schrock <sschrock@google.com>

* remove unneeded GL_HOST parsing

now that repoURL_parse handles GL_HOST, we dont need it elsewhere.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* cleanup

Signed-off-by: Spencer Schrock <sschrock@google.com>

* mention GL_HOST in readme

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* handle GL_HOST without scheme

Signed-off-by: Spencer Schrock <sschrock@google.com>

* move api-less check earlier

if we can avoid an API call, do it.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* try listing projects with and without auth token

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* revert passing token to list projects

the simpler the better

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-01-31 10:04:41 -08:00
Josh Soref
3b948257fc
📖 Fix spelling (#3804)
* spelling: accurate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: administrator

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: analyze

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: andtwenty

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: ascii

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: association

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: at least

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: attestor

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: barbaric

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: bucket

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: by

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: can

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: case-insensitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: case-sensitive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: checking

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: command-line

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: commit

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: committed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: conclusion

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: corresponding

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: created

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dataset

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: default

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: defines

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependabot

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: depending

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: desired

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: different

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: disclose

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: download

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: each

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: enforce

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: every time

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: exist

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: existing

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: fields

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: files

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: for

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: force-push

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: gitlab

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: ignoreed

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: implementation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: implements

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: increase

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: indicates

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: initialized

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: instructions

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: invalid

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: marshal

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: match

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: name

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: organization

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: package

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: provenance

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: query

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: readers

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: receive

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: registered

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: remediate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: representation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: requests

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: requires

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: return

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: scorecard

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: separator

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: serialization

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: sign up

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: specifications

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: specified

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: success

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: successfully

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: their

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: twenty

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unexpected

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unused

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: unverified

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: validate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: vendor

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: vulnerabilities

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: vulns

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: will

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: without

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: workflow

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: workflows

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2024-01-26 23:08:26 +00:00
Spencer Schrock
b556d932a4
🐛 Handle osvscanner errors on projects with no dependencies (#3803)
* handle osv errors for projects without packages

Signed-off-by: Spencer Schrock <sschrock@google.com>

* make test parallel

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-01-19 19:13:40 +00:00
Naveen
a4148d9f17
🌱 Included additional method to git client (#3761)
* 🌱 Included additional method to git client

- Included additional methods to satisfy the local git client

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Code review comments.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Fixed the incorrect gitlab test config.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Fixed code review comments.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2024-01-07 17:53:58 +00:00
Allen Shearin
141ac4d43d
🐛 handle gitlab repos with no commits (#3731)
* fix: handle gitlab repos with no commits

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* fix: gitlab listcommits tests, remove else in commit array length check

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* rename test file, remove unneeded test

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

---------

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
2024-01-04 11:40:08 -08:00
Allen Shearin
df7d88898f
🌱 differentiate between refs and sha gitab (#3729)
* fix: differentiate between refs and sha gitab listcheckrunsforref

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* address pr comments

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* style: move gitlab call to one line

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* update gitlab api comments

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

---------

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
2023-12-18 20:51:25 +00:00
Spencer Schrock
d03c8cbb43
🐛 revert making RequiredPullRequestReviews a pointer (#3728)
* revert the change which made RequiredPullRequestReviews a pointer

While the current approach works with the tiered scoring,
it wont work for probes or if we remove tiers. Making the struct nil to
signal that PRs aren't required hides some of the data we do have.

This is especially problematic for repo rules, where we can infer all
settings by what we see or dont see.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* add helper to deref pointers

Signed-off-by: Spencer Schrock <sschrock@google.com>

* clarify comments and keep code consistent

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-12-13 00:26:35 +00:00
Diogo Teles Sant'Anna
db7b6e70af
branch protection: requiring PRs gives partial credit (#3499)
* feat(branch-protection): consider if project requires PRs prior to make changes

As discussed at the issue #2727, we're adding the "require PRs prior
to make changes" as another requirement to tier 2. In addition to that,
we're changing the weight of the tier 2 requirements so that
"requiring 1 reviewer" has weight 2, while the other tier 2 requirements
have weight 1

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): increment and adapt testing

1. Adapt previous test cases to consider that now we'll have an aditional
Info log telling that the project requires PRs to make changes.
2. Add more cases to test relevant use cases on the tier 2 level of
branch protection

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* docs(branch-protection-check): adapt check description to consider requirement of require PRs to make changes

It adds the new tier 2 requirement, but also specify that the
"require at least 1 reviewer" will have doubled weight.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection-check): avoid duplicate funcions and enhance readability

Made some nice-to-have improvements on project readability,
making it easier easier to  understand how the branch-protection
score is computed. Also unified 8 different functions that were
doing basically the same thing.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>


* feat(branch-protection): standardize values received on evaluation

Previously, at the evaluation part of branch protetion, the
values nil and false or zero were sort of interchangeble. This commit
changes the code to set as nil only the data that could not be retrieved
from github -- all the others would have values as false, zero, true, etc

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(github-client): adapt and add tests to check if nil values are coherent

1. Add new test to evaluate how we're interpreting a rule with all
checkboxes unchecked (most shouldn't be nil)
2. Adapt existent tests to expect non-nil values for unchecked
   checkboxes

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* feat(client-github): avoid reusing bool pointers

Changes some pieces of code to prefer using pointers of
bool instantiated independently. If reusing bool pointers, at some piece
of code the value of the bool could inadvertently changed and it would change the
value of all other fields reusing that pointer.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* feat(branch-protection): enhance evaluation if scorecard was run by admin

At the evaluation step we were using some non untrusted fieldds of the
resposte to evaluate if Scorecard was run as admin or not. Now we're
using a field provided directly from the client file.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): adapt testings to say if they have admin info or not

After last commit, the client will tell the evaluation files if
Scorecard was run by administrator or not (i.e., if we have all the
infos). This commit adapts the testings to also provide this info.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(e2e-branch-protection): adapt number of logs after changes

- 2 warns (for 'last push approval' and 'codeowners review' disabled) were added because now those informations come as 'not-nil' at the evaluation part.
- 1 info was added to say that PRs are required to make changes
- 1 debug was removed because it said that we couldn't retrieve 'last push approval' information, but we actually can. It was just incorrectly set as nil

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* Revert the 2 commits with changes around how Scorecard detects admin run

Reverts commit 64c3521d89a6493e0d8c7527aa011f98c3e35719 and commit e2662b7173ef90b44b2d72c37614230440e8a919.
Both had chances around using clients/branch.go scructur to store the
information of whether Scorecard was being run by admin or not. We
decided to not change this structure for this purpose.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): change data structure to use pointer instead of value

At clients.BranchProtectionRule struct, changing
RequiredPullRequestReviews to be a pointer instead of a struct value.
This will allow the usage of the nil value of this structure to mean
that we can't say if the repository requires reviews or not.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* feat(branch-protection): use nil pointer on reviewers struct to mean
we don't know if they require PRs

The nil value of the struct RequiredPullRequestReviews will now mean
that we can't tell whether the project requires PRs to make changes or not.

When we get this case, we're printing a debug informing that we don't have
this data, but also printing a warn saying that they don't require
reviews, because that will be true at this case.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): if we're setting the reviewers struct to nil
when needed

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* doc(branch-protection): add code comment explaining different weight on tier 2 scores

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): avoid duplicate if branches on reviewers num comparation

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* docs(branch-protection): clarify commentings around data structure

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor: clean code on parsing GitHub BP data

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* feat(branch-protection): ressignify the nil PullRequestReviewRule to mean PR not required

Adapt translation of data from GitHub API, now for our internal data
modeling, having a nil PullRequestReviewRule structure will mean that
PRs are not required on the repo (can also mean we don't have data to
ensure that).

It also changes the order of the calls of copyNonAdminSettings and
copyAdminSettings to make the first one be called first. This eases the
code because the PullRequestReviewRule can be always instantiated at
this function.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): ensure we translate GitHub BP data as expected

Ensure we're correctly translating GitHub data from the old Branch
Protection config.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* feat(branch-protection): adapt score evaluation after 2efeee6512

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): adapt testings to changes of last commits

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* docs(branch-protection): add TODO comments pointing refactor opportunities

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* fix: avoid penalyzing non-admin for dismissStaleReview

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* fix(branch-protection): prevent false value from API field to become nil

When translating the API results, if the specific field `DismissesStaleReviews`
had a false value, it was not being initiated in our data model and was
remaining nil.

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor: clarify different weight on first reviewer

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor: enhance clarity of loggings and comments

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): new test to cover different rules affecting same branch

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* docs(branch-protection): change requirements ordering to keep admin ones together

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): simplify auxiliary function

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): fix code format to linter requirements

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): avoid unnecessary initializations and rename function

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): adapt test that was forgotten on commit 6858790a3e

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): use enums to represent tiers

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): remove nil fields of struct initialization when they dont contribute for clarification

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): simplify functions by using generics

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* docs(branch-protection): update docs after generate-docs run

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* fix(branch-protection): fix duplicated line on code

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* fix(branch-protection): stop exporting Tier enum

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* refactor(branch-protection): changing unchanged var to const

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

* test(branch-protection): Rename test and adapt it to be consistent with its purpose

I also changed the test to not require PRs, as it's how it is when a new GitHub
Branch Protection config is created. The changes on the loggings numbers are due
to:
1. A warning for not having DismissStaleReviews became a debug
2. Removed the warning we had for not requiring CodeOwners
3. Have a new warning for not requiring PRe

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>

---------

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
2023-12-11 22:39:02 -08:00
Allen Shearin
e4fc8150b0
🐛 Parse Gitlab Status fields to align w/Github Status and Conclusion (#3706)
* fix: parse gitlab pipeline status to their GitHub equivalent

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* change completed string to const

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

---------

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
2023-12-04 09:59:02 -08:00
Spencer Schrock
d882fc73e1
🌱 re-enable paralleltest linter (#3705)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-12-04 02:25:03 +00:00
Spencer Schrock
1625b0c578
🌱 Disable more style linters for test files (#3707)
* disable lll linter for test files
* disable goerr113 linter for tests
* disable wrapcheck linter for tests
* fix easy linter issues in tests

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-12-04 02:14:01 +00:00
Spencer Schrock
1a17bb812f
🐛 add retry loop to graphQL commit queries which timeout on large github repos (#3680)
* try to always paginate

in the event of timeouts, make our pagination smaller

Signed-off-by: Spencer Schrock <sschrock@google.com>

* add retry test

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-11-20 21:12:09 +00:00
Spencer Schrock
92470deac3
🌱 enable nolintlint linter and fix violations (#3650)
* enable nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* first chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* second chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* third chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fourth chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* include reason for the specific linter config

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fifth chunk of fixing nolintlint

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix linter errors that are somehow still triggering

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-11-15 11:44:28 -08:00
Allen Shearin
14f864bfea
Add commit depth support for GitLab (#3672)
* feat: Integrated paging to allow for querying based on the --commit-depth value provided

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* fix: rework git commits changes for readability

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

* fix: add additional commit depth test

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>

---------

Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
2023-11-15 03:24:47 +00:00
Spencer Schrock
a4ee3147a6
🌱 bump project minimum Go version to go1.21 (#3661)
* upgrade go.mod to 1.21

Signed-off-by: Spencer Schrock <sschrock@google.com>

* use slices from stdlib

Signed-off-by: Spencer Schrock <sschrock@google.com>

* use max/min builtins

Signed-off-by: Spencer Schrock <sschrock@google.com>

* multierrors

possibly spin this off into its own PR

Signed-off-by: Spencer Schrock <sschrock@google.com>

* dont call rand.Seed

As of Go 1.20, the generator is seeded randomly at startup.
https://pkg.go.dev/math/rand#Seed

Signed-off-by: Spencer Schrock <sschrock@google.com>

* update minimum Go version in documentation

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-11-13 15:12:29 -08:00
Spencer Schrock
5f3a0e2092
🌱 Enable golangci-lint test presets (#3594)
* enable test preset

Leaves some opinionated linters disabled with reasons.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix tparallel issues.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-10-27 15:05:40 -07:00
Spencer Schrock
2391edfbe1
🌱 add style linters: mirror, tenv, usestdlibvars (#3586)
* fix tenv linter and bug with t.Parallel

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix usestdlibvars linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix mirror linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-10-23 22:40:01 +00:00
Gabriela Gutierrez
ca5c404a97
🐛 scanning gitlab private repositories (#3596)
* fix: Run for gitlab private repos

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>

* test: gitlab repo is accessible

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>

* fix: linter error

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>

---------

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
Co-authored-by: Raghav Kaul <8695110+raghavkaul@users.noreply.github.com>
2023-10-23 20:57:55 +00:00
Spencer Schrock
2d9319601e
🌱 use forbidigo linter to prevent print statements (#3585)
* enable forbidigo for print statements.

include reasoning as message exposed to developer.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* remove or grant exceptions for existing print statements

Signed-off-by: Spencer Schrock <sschrock@google.com>

* swap stdout to stderr

Signed-off-by: Spencer Schrock <sschrock@google.com>

* separate msg from regex for better readability.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-10-23 13:12:50 -07:00
Spencer Schrock
d0cefa519a
🌱 enable the golangci-lint bugs preset (#3583)
* enable bugs preset

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix noctx linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix bodyclose linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix contextcheck linter

Signed-off-by: Spencer Schrock <sschrock@google.com>

* This ignores all existing cases of musttag linter complaints.

This analyzer seems useful in the future, but some of this code
is old and I don't want to change it for existing code now.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* ignore existing nilerr lints.

This behavior is from the initial commit, and primarily affects metrics.
Leaving as is, and hope to benefit from the linter in the future.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-10-23 09:35:40 -07:00
Spencer Schrock
03060f208f
🌱 Bump distroless/base from 27647a6 to 29da700 and golang from ec457a2 to e9ebfe9 (#3548)
* bump distroless.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* bump golang 1.21

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-10-09 12:09:25 -07:00
Raghav Kaul
0ce62a84ea
🐛 Fix npe for GitLab repos without license API data (#3500)
Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-09-20 09:51:43 -07:00
Raghav Kaul
f7f75d0bb3
Update URI() for GitLab repos. Add fuzzing test (#3477)
Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-09-18 19:22:25 +00:00
Pete Wagner
e515c2a8bd
Support Branch-Protection via GitHub Repository Rules (#3354)
* repo rulesets via v4 api

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* good enough fnmatch implementation.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* good enough rulesMatchingBranch

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* apply matching repo rules to branch protection settings

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* rules: consider admins and require checks

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* non-structural chanages from PR feedback

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* fetch default branch name during repo rules query

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* Testing applyRepoRules

Tests assume a single rule is being applied to a branch, which might be
guarded by a legacy branch protection rule.

I think this logic gets problematic when there are multiple rules
overlaid on the same branch: the "the existing rules does not enforce
for admins, but i do and therefore this branch now does" will give
false-positives.

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* Test_applyRepoRules: builder and standardize names

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* attempt to upgrade/downgrade EnforceAdmins as each rule is applied

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>

* simplify enforce admin for now.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* handle merging pull request reviews

Signed-off-by: Spencer Schrock <sschrock@google.com>

* handle merging check rules

Signed-off-by: Spencer Schrock <sschrock@google.com>

* handle last push approval

Signed-off-by: Spencer Schrock <sschrock@google.com>

* handle linear history

Signed-off-by: Spencer Schrock <sschrock@google.com>

* use constants for github rule types.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* add status check test.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* add e2e test for repo rules.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* handle nil branch name data

Signed-off-by: Spencer Schrock <sschrock@google.com>

* add tracking issue.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix precedence in if statement

Signed-off-by: Spencer Schrock <sschrock@google.com>

* include repo rules in the check docs.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Peter Wagner <1559510+thepwagner@users.noreply.github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2023-09-14 13:56:41 -07:00
Fred Gan
146f0eb1e5
📖 Update bestpractices links (#3448)
Signed-off-by: Fred Gan <ganshaolong@vip.qq.com>
2023-09-12 22:47:53 +00:00
dependabot[bot]
3af46eb8a2
🌱 Bump distroless/base from c623859 to 27647a6 in /clients/githubrepo/roundtripper/tokens/server (#3443)
* 🌱 Bump distroless/base

Bumps distroless/base from `c623859` to `27647a6`.

---
updated-dependencies:
- dependency-name: distroless/base
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump other distroless/base images too

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Schrock <sschrock@google.com>
2023-09-04 23:14:02 -07:00
Spencer Schrock
b69b69f1c2
🐛 Ignore missing tarballs for empty org .github repos (#3433)
* Ignore tarball errors on org's .github folder

Signed-off-by: Spencer Schrock <sschrock@google.com>

* add test.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-28 14:46:30 -07:00
Raghav Kaul
475d975cc2
🐛 Licenses: Get License SPDXId from GitLab API (#3413)
* Fix licenses check

* Update repoclient
* Get SPDXId from `key` field in GitLab Projects API
* Update e2etest repos

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* add test

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* stricter regex

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-08-23 17:03:20 +00:00
Spencer Schrock
93875dd11c
🐛 Fix loop aliasing errors causing linter to fail. (#3414)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-22 17:48:21 -07:00
Spencer Schrock
02c361bf7d
🌱 Gate GitLab e2e tests behind TEST_GITLAB_EXTERNAL (#3397)
* Move ginkgo setup suite to own file.

The other e2e suites do this already.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* rename graphql test file to reflect its e2e testing.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* gate gitlab e2e tests behind env var declared in Makefile.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-17 16:40:14 +00:00
Naveen
e82d15dc02
🌱 Add Tests for GitLab CheckRuns API (#3394)
- Add tests for the `CheckRuns` function

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-16 17:49:35 +00:00
Spencer Schrock
1a32607129
🌱 Fix failing GitLab e2e tests (#3393)
* Fix branch protection test type mismatch.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* add unit test for gitlab listissues.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* Delete gitlab issues e2e test.

It's been replaced with a unit test.

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-15 12:45:56 -07:00
Naveen
accaffdfe2
🌱 Unit tests for git client (#3328)
- Add test functions to the Git client for testing repository initialization, commit listing, and search functionality

[clients/git/client_test.go]
- Add `createTestRepo` function to set up a test repository
- Add `TestInitRepo` to test the initialization of a repository
- Add `TestListCommits` to test the listing of commits
- Add `TestSearch` to test the search functionality

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-15 17:20:38 +00:00
Spencer Schrock
5ec66fa906
🌱 Migrate to go 1.21 (#3387)
* Bump dockerfiles to 1.21
* Go minimum version should match our go.mod
* Bump GitHub action go version to 1.21 and ensure all workflows use env variable.

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-14 14:32:42 -04:00