- 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>
* 🌱 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>
- 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>
* 🌱 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>
* 🌱 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>
- 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>
- 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>
- 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>
- 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>
* 🌱 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>
* 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>
* 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>
- 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>
* 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>
* 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>
* 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>
* 🌱 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>
* 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>
- 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>