Commit Graph

20 Commits

Author SHA1 Message Date
Chris McGehee
6a7142fe21 Fix lint issues: golint linter 2021-05-02 14:49:40 -05:00
Azeem Shaikh
86a46560c8 Rename CheckResults to Checks to match BQ schema. 2021-04-26 17:45:04 -05:00
Oliver Chang
158c2cdbde
Fix typo in scorecard date format. (#353) 2021-04-21 21:16:26 -07:00
Azeem Shaikh
bd3eff1fcf
Cron job uses line-delimited JSON (#344)
*  Refactor to reduce code duplication

* 

* Move lib/ back to checker/

* Move lib/ back to checker/

* Move lib/ back to checker/

* Address PR comments.

* Addressing PR comments.

* Separate out ReposURL nito repos/

* Add TODO in gitcache module.

* Add RepoRequest/Response types.

* Avoid printing `ShouldRetry` and `Error` in output JSON.

* Fix JSON output.

* Simplify cmd package.

* Make cron/ a package instead of module.

* Fix TODO.

* Remove binary file.

* go.mod file.

* go.mod updates.

* Refactor cron to use in-memory JSON.

* Fix JSON output.

* Fix go.mod

* Address PR comments.

* Change %w -> %v.

* Address PR comments.

* Fix err.

Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-04-19 12:49:51 -07:00
Chris McGehee
06993b72ce
🐛 Fix linting issues (1 of n) (#348)
* Fix lint issues: whitespace linter

* Fix lint issues: wrapcheck linter

* Fix lint issues: errcheck linter

* Fix lint issues: paralleltest linter

* Fix lint issues: gocritic linter
Most changes from this commit are from passing checker.CheckResult by reference and not by value. gocritic identified that as a huge parameter.
gocritic also prefers regexp.MustCompile over Compile when the pattern is a const
2021-04-19 12:18:34 -07:00
Azeem Shaikh
a58818d258
🌱 : Reduce code duplication for follow-up cron refactoring (#338)
*  Refactor to reduce code duplication

* 

* Move lib/ back to checker/

* Move lib/ back to checker/

* Move lib/ back to checker/

* Address PR comments.

* Addressing PR comments.

* Avoid printing `ShouldRetry` and `Error` in output JSON.

* Fix JSON output.

Co-authored-by: Azeem Shaikh <azeems@google.com>
2021-04-10 07:26:56 -05:00
Naveen
7ff09db2ed
Fix-Using Roundrobin tokens across multiple calls (#284)
The GitHub tokens are picked from a list for each call using Roundrobin approach.
2021-03-17 21:41:29 +00:00
naveen
7726ca7987 Feature - Include metadata in the results
Included metadata that can be passed an argument to the command line.
The same metadata will returned the `json` results.
2021-02-22 19:23:46 -05:00
Naveen
db81680172
Feat-Implement httpcache middleware for GitHub API (#203)
The GitHub API supports conditional requests
https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests

https://github.com/google/go-github supports Conditional requests
https://github.com/google/go-github#conditional-requests

As we are scaling more and more projects this would add a lot of value.

Initial run fetches information using `httpcache` as a middleware,
which caches the HTTP response initially in a large disk (PVC),
probably move to Redis later as a cache instead of disk.

Subsequent `cron runs` will utilize the `httpcache` for checking content modification and
load it from the cache if it isn't modified, which reduces the hitting the
Rate Limit of the GitHub API.
2021-02-22 17:18:28 +00:00
Nathan
554ca76bfe Fix - golangci issues gomnd, goconst
Fixed the golangci issues for gomnd and goconst.
Added ginkgo dependency in the makefile.
2021-02-17 18:22:18 -05:00
Abhishek Arya
91780fd232 Allow skipping scheme, fix regression. 2020-12-22 13:56:17 -08:00
naveen
4362368f94 Tests updated to include validation for parsing
Improved the tests to include validation for parsing the URL.
2020-12-21 22:30:41 -05:00
naveen
fd3a2a87b9 fix - URL with trailing slash
Fixes the URL with trailing slash.
Changed the URL parsing to net package implementation.
Included tests for URL parsing.
2020-12-21 15:16:32 -05:00
dlorenc
fd188f5263
Use the GraphQL API to retrieve the list of tags in signed-tags. (#45) 2020-11-06 15:28:26 -06:00
Dan Lorenc
9f686dc707 Rename repo/modules. 2020-10-27 14:23:48 -05:00
Abhishek Arya
81eab9d2d8
Add license header and code of conduct files. (#34)
* Add license header and code of conduct files.

* Fill missing field.
2020-10-26 15:22:13 -05:00
Dan Lorenc
44e39f7a00 Results over a channel as well. 2020-10-19 19:32:18 -05:00
Dan Lorenc
6a621a7396 Move printing back to root.go. 2020-10-19 19:26:48 -05:00
Dan Lorenc
a2eb4f862d More refactors. 2020-10-19 19:14:51 -05:00
dlorenc
6627531e58
Separate logic from cmd/root.go (#29)
This will make it easier to add subcommands and to serve the scorecard over HTTP.
2020-10-19 19:07:30 -05:00