Commit Graph

202 Commits

Author SHA1 Message Date
Naveen
26ef752c68
Improve GitLab repo status and webhook tests (#3368)
- Update test names and response paths for statuses and webhooks
- Lower the numeric tolerance for test files
- Change the error message when fetching webhooks

[clients/gitlabrepo/statuses_test.go]
- Change the name of the test from "valid webhook" to "valid status"
- Change the name of the test from "invalid webhook" to "failure fetching the status"
- Lower the numeric tolerance for test files
- Change the response path for the valid status test from "./testdata/valid-status" to "./testdata/invalid-status"
[clients/gitlabrepo/webhook_test.go]
- Change the error message when fetching webhooks from "invalid webhook" to "failure fetching webhooks"

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-09 22:12:16 +00:00
Naveen
d7841b95ca
🌱 Unit tests for Gitlab status and WebHooks (#3367)
* 🌱 Improve gitlabrepo webhook handler tests

- Add a test for the gitlabrepo webhook handler
- Add a stubTripper for testing the webhook handler
- Add two test cases for the webhook handler: one valid and one invalid

[clients/gitlabrepo/webhook_test.go]
- Add a test for the gitlabrepo webhook handler
- Add a stubTripper for testing the webhook handler
- Add two test cases for the webhook handler: one valid and one invalid

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

* :seelding: Tests for Gitlab repo status

- Add valid status data for Gitlab repos
- Add tests for the `listStatuses` function
- Add HTTP stubbing to the tests

[clients/gitlabrepo/testdata/valid-status]
- Add a new file with valid status data for Gitlab repos
[clients/gitlabrepo/statuses_test.go]
- Add a new file `clients/gitlabrepo/statuses_test.go`
- Add tests for the `listStatuses` function
- Add HTTP stubbing to the tests

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-09 16:52:18 -05:00
Spencer Schrock
9033d51496
🐛 Fix parsing OSSFuzz project repos with subfolders and capitalization. (#3364)
* Split main_repo with correct number of parts. Add go-cmp test.

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

* force repo to lowercase when comparing names.

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

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-09 13:18:26 -07:00
Naveen
28f8dd62f7
🌱 Improve GitLab repo branches E2E test (#3362)
- Add an E2E test to check the default branch of a GitLab repo
- Initialize the repo with the HEAD commit and 0 depth
- Check that the default branch is named "main"

[clients/gitlabrepo/branches_e2e_test.go]
- Add an E2E test to check the default branch of a GitLab repo
- Initialize the repo with the HEAD commit and 0 depth
- Check that the default branch is named "main"

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-08 22:24:55 +00:00
Naveen
097f6c7f31
🌱 Add E2E test for Gitlab repo webhooks (#3346)
* 🌱 Add E2E test for Gitlab repo webhooks

- List the webhooks and check that there is at least one returned

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

* Update GitLab repo workflow for e2e tests

- Add a skipIfTokenIsNot check for GitLab
- Update the MakeGitlabRepo function to use a new URL

[clients/gitlabrepo/workflow_e2e_test.go]
- Add a skipIfTokenIsNot check for GitLab
- Update the MakeGitlabRepo function to use a new URL

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-07 18:03:04 +00:00
Naveen
76dc144814
🌱 E2e Gitlab Issues (#3343)
* 🌱 Add E2E tests for Gitlab repo issues

- Add an E2E test for Gitlab repo issues
- Add two tests: one for a repo with issues, one for a repo without issues

[clients/gitlabrepo/issues_e2e_test.go]
- Add an E2E test for Gitlab repo issues
- Add two tests: one for a repo with issues, one for a repo without issues

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

* Improve issue e2e tests & error handling

- Remove copyright notice and associated code from `clients/gitlabrepo/issues_e2e_test.go`
- Change `ListIssues` to return an error if `ListAllProjectMembers` is not available

[clients/gitlabrepo/issues_e2e_test.go]
- Remove copyright notice and associated code from `clients/gitlabrepo/issues_e2e_test.go`
- Change `ListIssues` to return an error if `ListAllProjectMembers` is not available

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

* Improve GitLab issues error handling

- Update context of test from "Test list issues - GitLab" to "Test list issues errors - GitLab"
- Change test to return errors when listing for issues with normal token

[clients/gitlabrepo/issues_e2e_test.go]
- Change context of test from "Test list issues - GitLab" to "Test list issues errors - GitLab"
- Change test from "returns branches for the repo" to "returns errors when listing for issues with normal token"

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-04 17:37:21 +00:00
Spencer Schrock
f30ff23d82
Clear all possible token env vars for token accessor test. (#3347)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-08-03 21:31:01 -07:00
Naveen
b1f3519d6e
🌱 Add e2e test for GitLab repo releases (#3342)
- Add a context for gitlabrepo list releases test
- Initialize a gitlab client and repo
- Add an assertion for the number of releases returned

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-03 19:25:24 +00:00
Naveen
2df78d9986
🌱 Unit tests badge response (#3329)
- Add a new file `clients/cii_response_test.go` to handle badge responses
- Add functions for parsing JSON responses and converting to/from JSON
- Add tests for the badge response functions

[clients/cii_response_test.go]
- Add a new file `clients/cii_response_test.go` to handle badge responses
- Add functions for parsing JSON responses and converting to/from JSON
- Add tests for the badge response functions

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-08-01 17:28:49 +00:00
Naveen
18191927b8
🌱 E2e for clients/gitlabrepo/tarball (#3330)
- Add end-to-end test for the gitlabrepo package
- Initialize a gitlab repo and list its files
- Retrieve content for a specific file in the repo

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-07-31 21:24:00 +00:00
Raghav Kaul
e9495bbaa3
🌱 GitLab: Add log message (#3319)
* log msg

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

* address pr comments

* log once
* todo

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

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-07-28 17:40:52 +00:00
Pete Wagner
b992be36e0
🌱 Bump github.com/google/go-github from v38.1.0 to v53.2.0 (#3327)
Signed-off-by: Peter Wagner <peter.wagner@shopify.com>
2023-07-28 17:05:32 +00:00
Naveen
8779de9cd2
🌱 Improve GitLab project e2e tests (#3324)
- Add e2e test for GitLab projects
- Test Project details- GitLab: check if project is archived and get createdAt date

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-07-27 10:03:23 -07:00
Naveen
2e7d37a1c5
🌱 Improve gitlabrepo.ListProgrammingLanguages e2e tests (#3309)
* 🌱 Improve `gitlabrepo.ListProgrammingLanguages` e2e tests

- Add an end-to-end test for the `gitlabrepo.ListProgrammingLanguages` function
- Include a test for repos without code to check that no programming languages are returned

[clients/gitlabrepo/languages_e2e_test.go]
- Add an e2e test for the `gitlabrepo.ListProgrammingLanguages` function
- Add a test for repos without code to check that no programming languages are returned

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

* Increase test accuracy for language e2e tests

- Lower the numeric tolerance for e2e tests in the GitLab repository

[clients/gitlabrepo/languages_e2e_test.go]
- Lower numeric tolerance for test files

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-07-26 20:27:36 +00:00
Naveen
b4ed187f88
🌱 Unit tests OSSFuzz client (#3301)
* 🌱 Unit tests OSSFuzz client

- Included tests for  IsArchived, LocalPath, ListFiles, GetFileContent, GetBranch, GetDefaultBranch, GetOrgRepoClient, GetDefaultBranchName, ListCommits, ListIssues, ListReleases, ListContributors, ListSuccessfulWorkflowRuns, ListCheckRunsForRef, ListStatuses, ListWebhooks, SearchCommits, Close, ListProgrammingLanguages,

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

* Improve OSSFuzz client tests

[clients/ossfuzz/client_test.go]
- Add a test for the `GetCreatedAt` method
- Fix the `URI` method to return the correct value

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-07-24 20:45:59 +00:00
Gabriela Gutierrez
b9ad5c4535
🐛 Fix Branch-Protection scoring (#3251)
* fix: Verify if branch is required to be up to date before merge

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

* docs: Comment tracking GraphQL bug

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

* fix: Add validation if pointers are not null before accessing the values

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

* fix: Delete debug log file

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

---------

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
2023-07-18 17:32:02 +00:00
Naveen
8613047b1b
🌱 Improve rate limit handling in roundtripper (#3237)
- Add rate limit testing and handling functionality
- Add tests for successful response and Retry-After header set scenarios

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-07-10 20:35:06 +00:00
Raghav Kaul
c8a7324b35
Gitlab: add cron repos (#3208)
* remove experimental flag

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

* add gitlab repos to weekly

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

* rename selected -> releasetest

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

* check repo access level for private repos

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

* Move e2e test to unit tests

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

* Require token for test

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

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-06-29 16:25:34 -04:00
Raghav Kaul
c72cfd5d32
🌱 Gitlab: Move tests that connect to gitlab.com out of unit-tests (#3221)
* Move tests that connect to GitLab out of e2e

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

* update

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

* mark as pat test

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

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-06-29 15:11:05 -04:00
Naveen
edacaa6ce4
🌱 Added unit tests for rpc (#3203)
- Add a mockTokenAccessor and TokenOverRPC wrapper for testing
- Add tests for TokenOverRPC.Next and TokenOverRPC.Release

[clients/githubrepo/roundtripper/tokens/rpc_test.go]
- Add a mockTokenAccessor for testing
- Add a TokenOverRPC wrapper
- Add a Next method to TokenOverRPC
- Add a Release method to TokenOverRPC
- Add a test for TokenOverRPC.Next
- Add a test for TokenOverRPC.Release

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-26 22:28:07 +00:00
Naveen
a858c06b4b
🌱 Add unit tests for roundrobin (#3202)
- Add tests for the round-robin token accessor

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-26 22:17:58 +00:00
Naveen
2aa9887f13
🌱 Improve GitHub Access Token Tests (#3206)
- Replace `startTestServer()` with `httptest.NewServer`

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-23 16:33:09 +00:00
Naveen
4edb07802f
🌱 Included tests for accessor (#3178)
* 🌱 Included tests for accessor

- Add test file for Token Accessor

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

* Code review comments.

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-21 21:57:50 +00:00
Naveen
b4c197cced
🌱 e2e for licenses (#3177)
* 🌱 e2e for licenses

- e2e for licenses

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

* Code review comments.

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-21 21:13:24 +00:00
Naveen
4c46028258
🌱 e2e for statuses (#3176)
- e2e for statuses.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-20 21:08:39 +00:00
Spencer Schrock
a50bc07b4f
🌱 Bump docker images (#3196)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-06-20 12:41:51 -07:00
Spencer Schrock
a3cf858213
Switch webhook to unit test (#3174)
Signed-off-by: Spencer Schrock <sschrock@google.com>
2023-06-17 08:16:52 -05:00
Naveen
d72deff409
🌱 Improve Githubrepo Releases handler E2E tests (#3164)
- Add e2e test for githubrepo releases handler

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-15 12:54:23 +00:00
Naveen
e11fd2e80a
🌱 Improve webhookHandler E2E tests (#3157)
* :seelding: Improve webhookHandler E2E tests

- Add e2e test for webhookHandler

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

* Fixed the location of skipif

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

* Some cleanup

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-06-14 13:07:38 +00:00
dependabot[bot]
cc6705b1c5 🌱 Bump golang in /clients/githubrepo/roundtripper/tokens/server
Bumps golang from `690e413` to `4b1fc02`.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 13:37:09 +00:00
dependabot[bot]
42cec81709
🌱 Bump distroless/base (#3122)
Bumps distroless/base from `10985f0` to `c623859`.

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-07 19:15:20 +00:00
dependabot[bot]
c417d75d85 🌱 Bump golang in /clients/githubrepo/roundtripper/tokens/server
Bumps golang from `685a22e` to `690e413`.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 23:44:49 +00:00
jimrobison
fa42daff71
🐛 Gitlab status updates (#3052)
* doc: Updating gitlab support validation status

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* bug: Updated  logic for gitlab to prevent exceptions based on releases

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* test: Added initial tests for gitlab branches

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* doc: Updated general README

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Cleaned up the query for pipelines to be focused on the commitID

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* feat: Allowed for a non-graphql method of retrieving MRs associated to a commit

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* doc: Updated status for the CI-Tests

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* bug: Updated the host url for graphql querying. This enabled the removal of the code added for handling empty returns when executing against a non-gitlab.com repository.

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

---------

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>
Co-authored-by: Raghav Kaul <8695110+raghavkaul@users.noreply.github.com>
2023-05-26 16:45:46 +00:00
raghavkaul
f997b2720d
Gitlab: Add projects to cron (#2936)
* cron: add gitlab projects

* support gitlab client
* simplify gitlab detection

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

* fix MakeGitlabRepo

* shortcut when repo url is github.com
* fixes add-projects, validate-projects

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

* Move gitlab repos to release controller

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

* Add csv headers

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

* Use gitlab.WithBaseURL

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

* formatting & logging

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

* remove spurious test

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

* consolidate logic

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

* Turn on experimental flag

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

* Add projects

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

* Update client

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

* update

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

* update

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

* update

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

* update

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

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-05-24 17:43:36 -04:00
raghavkaul
3db4e2f47e
🐛 Gitlab: Tests (#3027)
* fix tests

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

* use projectID instead of project where applicable

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

* pass ref as listcommitoption

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

* update tests

* CI-Tests: check if score > 0. pull request client is limited and can't
go back to arbitrary pull requests. CI-Tests don't run on forks, so this
can't be pinned either. But, for active repositories, we typically
expect *some* tests to be run

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

* fix commitshandler commitSHA tests

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

* update tests

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

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
Signed-off-by: raghavkaul <8695110+raghavkaul@users.noreply.github.com>
2023-05-24 14:46:11 -04:00
Naveen
b5142abe4d
🌱 E2E tests for clients/githubrepo/languages_e2e_test.go (#3000)
* 🌱 E2E tests for clients/githubrepo/languages_e2e_test.go

- Included e2e tests for clients/githubrepo/languages_e2e_test.go

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

* Fixed the token type check.

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Signed-off-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2023-05-22 17:15:35 +00:00
jimrobison
03dc18db78
🐛 Gitlab: Commit/Commitor Exceptions (#3026)
* feat: Added paging for contributor/users against gitlab projects

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Updated the bot flag for unmatched users

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* fix: Not all commit users are in the git registry instance

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* fix: Skipping check if the email is empty, as well as if the "email" doesn't contain a "." char.

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* fix: Updated to allow for commits with PRs to be accounted/added to the client.commits

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Updated to prevent linting issue regarding nested if's

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* test: Adding coverage for commits and contributors for gitlab

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Moved queries from the client to their own functions

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* bug: Need to pass the ProjectID value to the contributor query

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* bug: Updating project title versus projectID values for api querying

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* test: Updated tests to match expected property set for projectID

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* revert: Reverted based on feedback during review

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

---------

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>
2023-05-19 01:31:07 +00:00
Niket Patel
ee4f45c491
Add support for github GHES (#2999)
*  adding support for github GHES

Signed-off-by: Niket Patel <patelniket@gmail.com>

* fix: lint and cleanup

Signed-off-by: Niket Patel <patelniket@gmail.com>

* fix: flaky test

Signed-off-by: Niket Patel <patelniket@gmail.com>

* fix: address missing host

Signed-off-by: Niket Patel <patelniket@gmail.com>

* fix: lint error

Signed-off-by: Niket Patel <patelniket@gmail.com>

* 🌱 Additional e2e clients/githubrepo/checkruns.go (#2934)

* 🌱 Additional e2e clients/githubrepo/checkruns.go

- Add `net/http` and `github.com/google/go-github/v38/github` imports
- Add a test for `listCheckRunsForRef` with valid ref
- Add a test for `listCheckRunsForRef` with invalid ref

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

* Based on code review comments

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

* Some tweaks

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

---------

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

* 🌱 E2E for clients/githubrepo/contributors.go (#2939)

* 🌱 E2E for clients/githubrepo/contributors.go

- Add an end-to-end test for `contributorsHandler`

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

* Fixed based on code review comments.

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

* Fixed codereview comment.

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

---------

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

* chore: add GHES instructions

Signed-off-by: Niket Patel <patelniket@gmail.com>

* refact: use test setenv

Signed-off-by: Niket Patel <patelniket@gmail.com>

* fix: corp unit test

Signed-off-by: Niket Patel <patelniket@gmail.com>

---------

Signed-off-by: Niket Patel <patelniket@gmail.com>
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Signed-off-by: Niket Patel <patelniketm@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: raghavkaul <8695110+raghavkaul@users.noreply.github.com>
2023-05-18 18:17:00 -04:00
raghavkaul
3722a44079
gitlab: license check (#2834)
Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-05-17 15:16:57 -04:00
raghavkaul
3b4236faff
GitLab: Code Review check (#2764)
* Add GitLab support for Code-Review check

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

* Remove spurious printf

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

* Working commit

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

* update

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

* update

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

* e2e test

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

* update: test coverage

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

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-05-17 14:47:31 -04:00
dependabot[bot]
11fce076fa 🌱 Bump golang in /clients/githubrepo/roundtripper/tokens/server
Bumps golang from `31a8f92` to `685a22e`.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-15 14:38:34 +00:00
Naveen
022cd163a0
🌱 E2E for clients/githubrepo/contributors.go (#2939)
* 🌱 E2E for clients/githubrepo/contributors.go

- Add an end-to-end test for `contributorsHandler`

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

* Fixed based on code review comments.

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

* Fixed codereview comment.

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-05-13 16:11:18 +00:00
Naveen
970f435557
🌱 Additional e2e clients/githubrepo/checkruns.go (#2934)
* 🌱 Additional e2e clients/githubrepo/checkruns.go

- Add `net/http` and `github.com/google/go-github/v38/github` imports
- Add a test for `listCheckRunsForRef` with valid ref
- Add a test for `listCheckRunsForRef` with invalid ref

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

* Based on code review comments

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

* Some tweaks

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-05-13 15:44:58 +00:00
raghavkaul
3d1c472c2d
fix pat test messages (#2987)
* also fix pat tests

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-05-10 17:52:48 -04:00
dependabot[bot]
43999e9a26 🌱 Bump golang in /clients/githubrepo/roundtripper/tokens/server
Bumps golang from `403f486` to `31a8f92`.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 18:58:44 +00:00
dependabot[bot]
624e521074 🌱 Bump distroless/base
Bumps distroless/base from `e406b1d` to `10985f0`.

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 18:45:00 +00:00
jimrobison
7d59575b8f
Enable gitlab Packaging Reporting (#2941)
* feat: Added yaml file that contains the full, flattened gitlab ci/cd contents

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Updated to meet linting failures

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Updated filename for flattened gitlab

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Updated to include the generated, flattened ci yaml in the file listing

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Updated the apiFunction to be part of the handler

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Moved packaging collection to be a repoClient specific sub-package

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* feat: Added path for gitlab projects, including a basic search for lines containing nuget, poetry, twine publishes

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* test: Added tests for gitlab packaging finders

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* test: Added more tests for parsing through the client and grouping packaging data

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Utilizing existing mock objects to prevent race condition exception

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Addressed linting errors

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* test: Updated expectation for log message

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

* refactor: Reverted back to the original error

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>

---------

Signed-off-by: Robison, Jim B <jim.b.robison@lmco.com>
Co-authored-by: raghavkaul <8695110+raghavkaul@users.noreply.github.com>
2023-05-08 10:20:12 -07:00
Naveen
705a6121ef
🌱 Unit test clients/githubrepo/copy.go (#2950)
- Add tests for the utility functions
- 100% test coverage.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-05-04 17:46:44 +00:00
Naveen
7e24163646
🌱 Additional e2e clients/githubrepo/branches.go (#2931)
- Add a test for getting the default branch
- Add tests for getting and querying a branch
- Add an error check for non-existent branch
- Add an error check for non-HEAD query

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2023-05-01 14:26:31 +00:00
raghavkaul
c54fb4f8eb
Gitlab: Maintained check (#2860)
* gitlab: maintained check

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

* update workflow

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

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
2023-04-25 10:40:14 -04:00