├── .github ├── dependabot.yml └── workflows │ └── pull-request.yaml ├── .gitignore ├── .golangci.yml ├── .jx └── updatebot.yaml ├── .lighthouse └── jenkins-x │ ├── lint.yaml │ ├── pullrequest.yaml │ ├── release.yaml │ └── triggers.yaml ├── BUILDING.md ├── CHANGELOG.md ├── COPYRIGHT ├── LICENSE ├── Makefile ├── OWNERS ├── OWNERS_ALIASES ├── README.md ├── go.mod ├── go.sum ├── hack ├── gofmt.sh └── linter.sh ├── pkg └── hmac │ ├── hmac.go │ └── hmac_test.go ├── scm ├── app.go ├── client.go ├── client_test.go ├── commit.go ├── const.go ├── const_test.go ├── content.go ├── deploy.go ├── driver │ ├── azure │ │ ├── azure.go │ │ ├── azure_test.go │ │ ├── content.go │ │ ├── content_test.go │ │ ├── git.go │ │ ├── git_test.go │ │ ├── integration │ │ │ ├── content_test.go │ │ │ ├── git_test.go │ │ │ ├── pr_test.go │ │ │ ├── repository_management_test.go │ │ │ └── suite_test.go │ │ ├── issue.go │ │ ├── org.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── testdata │ │ │ ├── branch_create.json │ │ │ ├── branch_create.json.golden │ │ │ ├── branches.json │ │ │ ├── branches.json.golden │ │ │ ├── commit.json │ │ │ ├── commit.json.golden │ │ │ ├── commits.json │ │ │ ├── commits.json.golden │ │ │ ├── compare.json │ │ │ ├── compare.json.golden │ │ │ ├── content.json │ │ │ ├── content.json.golden │ │ │ ├── content_create.json │ │ │ ├── content_delete.json │ │ │ ├── content_list.json │ │ │ ├── content_list.json.golden │ │ │ ├── content_update.json │ │ │ ├── hook.json │ │ │ ├── hook.json.golden │ │ │ ├── hooks.json │ │ │ ├── hooks.json.golden │ │ │ ├── pr_abandon.json │ │ │ ├── pr_active.json │ │ │ ├── pr_active.json.golden │ │ │ ├── pr_completed.json │ │ │ ├── pr_merge.json │ │ │ ├── project.json │ │ │ ├── projects.json │ │ │ ├── repo.json │ │ │ ├── repo.json.golden │ │ │ ├── repo_create.json │ │ │ ├── repos.json │ │ │ ├── repos.json.golden │ │ │ └── webhooks │ │ │ │ ├── issue_comment.json │ │ │ │ ├── issue_comment.json.golden │ │ │ │ ├── issue_comment_delete.json │ │ │ │ ├── issue_comment_delete.json.golden │ │ │ │ ├── issue_comment_edit.json │ │ │ │ ├── issue_comment_edit.json.golden │ │ │ │ ├── pr_created.json │ │ │ │ ├── pr_created.json.golden │ │ │ │ ├── pr_merged.json │ │ │ │ ├── pr_merged.json.golden │ │ │ │ ├── pr_updated.json │ │ │ │ ├── pr_updated.json.golden │ │ │ │ ├── push.json │ │ │ │ └── push.json.golden │ │ ├── user.go │ │ ├── webhook.go │ │ └── webhook_test.go │ ├── bitbucket │ │ ├── bitbucket.go │ │ ├── bitbucket_test.go │ │ ├── content.go │ │ ├── content_test.go │ │ ├── git.go │ │ ├── git_test.go │ │ ├── issue.go │ │ ├── issue_test.go │ │ ├── milestone.go │ │ ├── org.go │ │ ├── org_test.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── review_test.go │ │ ├── testdata │ │ │ ├── branch.json │ │ │ ├── branch.json.golden │ │ │ ├── branches.json │ │ │ ├── branches.json.golden │ │ │ ├── commit.json │ │ │ ├── commit.json.golden │ │ │ ├── commits.json │ │ │ ├── commits.json.golden │ │ │ ├── content.json.golden │ │ │ ├── content.txt │ │ │ ├── diffstat.json │ │ │ ├── diffstat.json.golden │ │ │ ├── error.json │ │ │ ├── hook.json │ │ │ ├── hook.json.golden │ │ │ ├── hooks.json │ │ │ ├── hooks.json.golden │ │ │ ├── perms.json │ │ │ ├── perms.json.golden │ │ │ ├── pr_create.json │ │ │ ├── pr_create.json.golden │ │ │ ├── pr_diffstat.json │ │ │ ├── pr_diffstat.json.golden │ │ │ ├── pulls.json │ │ │ ├── pulls.json.golden │ │ │ ├── ref.json │ │ │ ├── repo-permision.json │ │ │ ├── repo-permision.json.golden │ │ │ ├── repo.json │ │ │ ├── repo.json.golden │ │ │ ├── repos-2.json │ │ │ ├── repos-single.json.golden │ │ │ ├── repos.json │ │ │ ├── repos.json.golden │ │ │ ├── status.json │ │ │ ├── status.json.golden │ │ │ ├── status_input.json │ │ │ ├── statuses.json │ │ │ ├── statuses.json.golden │ │ │ ├── tag.json │ │ │ ├── tag.json.golden │ │ │ ├── tags.json │ │ │ ├── tags.json.golden │ │ │ ├── user.json │ │ │ ├── user.json.golden │ │ │ ├── webhooks │ │ │ │ ├── pr_created.json │ │ │ │ ├── pr_created.json.golden │ │ │ │ ├── pr_created_slashbranch.json │ │ │ │ ├── pr_created_slashbranch.json.golden │ │ │ │ ├── pr_declined.json │ │ │ │ ├── pr_declined.json.golden │ │ │ │ ├── pr_fulfilled.json │ │ │ │ ├── pr_fulfilled.json.golden │ │ │ │ ├── pr_updated.json │ │ │ │ ├── pr_updated.json.golden │ │ │ │ ├── push.json │ │ │ │ ├── push.json.golden │ │ │ │ ├── push_branch_create.json │ │ │ │ ├── push_branch_create.json.golden │ │ │ │ ├── push_branch_delete.json │ │ │ │ ├── push_branch_delete.json.golden │ │ │ │ ├── push_tag_create.json │ │ │ │ ├── push_tag_create.json.golden │ │ │ │ ├── push_tag_delete.json │ │ │ │ └── push_tag_delete.json.golden │ │ │ ├── workspace.json │ │ │ ├── workspace.json.golden │ │ │ ├── workspaces.json │ │ │ └── workspaces.json.golden │ │ ├── user.go │ │ ├── user_test.go │ │ ├── util.go │ │ ├── util_test.go │ │ ├── webhook.go │ │ └── webhook_test.go │ ├── fake │ │ ├── content.go │ │ ├── content_test.go │ │ ├── data.go │ │ ├── deploy.go │ │ ├── deploy_test.go │ │ ├── fake.go │ │ ├── git.go │ │ ├── issue.go │ │ ├── org.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── release.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── test_helpers.go │ │ ├── testdata │ │ │ ├── myorg │ │ │ │ └── myrepo │ │ │ │ │ ├── README.md │ │ │ │ │ └── somedir │ │ │ │ │ └── something.txt │ │ │ └── test_refs │ │ │ │ └── myorg │ │ │ │ └── myrepo │ │ │ │ ├── README.md │ │ │ │ └── refs │ │ │ │ ├── master │ │ │ │ └── something.txt │ │ │ │ └── mybranch │ │ │ │ └── something.txt │ │ ├── user.go │ │ ├── user_test.go │ │ └── utils.go │ ├── gitea │ │ ├── content.go │ │ ├── content_test.go │ │ ├── git.go │ │ ├── git_test.go │ │ ├── gitea.go │ │ ├── gitea_test.go │ │ ├── issue.go │ │ ├── issue_test.go │ │ ├── milestone.go │ │ ├── milestone_test.go │ │ ├── org.go │ │ ├── org_test.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── release.go │ │ ├── release_test.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── review_test.go │ │ ├── testdata │ │ │ ├── assign_issue.json │ │ │ ├── branch.json │ │ │ ├── branch.json.golden │ │ │ ├── branches.json │ │ │ ├── branches.json.golden │ │ │ ├── close_issue.json │ │ │ ├── close_pr.json │ │ │ ├── comment.json │ │ │ ├── comment.json.golden │ │ │ ├── comments.json │ │ │ ├── comments.json.golden │ │ │ ├── commit.json │ │ │ ├── commit.json.golden │ │ │ ├── commits.json │ │ │ ├── commits.json.golden │ │ │ ├── content_create.json │ │ │ ├── content_find.json │ │ │ ├── content_find.json.golden │ │ │ ├── content_list.json │ │ │ ├── content_list.json.golden │ │ │ ├── hook.json │ │ │ ├── hook.json.golden │ │ │ ├── hooks.json │ │ │ ├── hooks.json.golden │ │ │ ├── issue.json │ │ │ ├── issue.json.golden │ │ │ ├── issue_clear_milestone.json │ │ │ ├── issue_labels.json │ │ │ ├── issue_labels.json.golden │ │ │ ├── issue_set_milestone.json │ │ │ ├── issues.json │ │ │ ├── issues.json.golden │ │ │ ├── milestone.json │ │ │ ├── milestone.json.golden │ │ │ ├── milestone_create.json │ │ │ ├── milestones.json │ │ │ ├── milestones.json.golden │ │ │ ├── organization.json │ │ │ ├── organization.json.golden │ │ │ ├── organizations.json │ │ │ ├── organizations.json.golden │ │ │ ├── pr.json │ │ │ ├── pr.json.golden │ │ │ ├── pr_changes.json.golden │ │ │ ├── pr_changes.patch │ │ │ ├── pr_create.json │ │ │ ├── prs.json │ │ │ ├── prs.json.golden │ │ │ ├── release.json │ │ │ ├── release.json.golden │ │ │ ├── release_create.json │ │ │ ├── release_update.json │ │ │ ├── releases.json │ │ │ ├── releases.json.golden │ │ │ ├── reopen_issue.json │ │ │ ├── reopen_pr.json │ │ │ ├── repo.json │ │ │ ├── repo.json.golden │ │ │ ├── repos.json │ │ │ ├── repos.json.golden │ │ │ ├── review.json │ │ │ ├── review.json.golden │ │ │ ├── review_create.json │ │ │ ├── reviews.json │ │ │ ├── reviews.json.golden │ │ │ ├── status.json │ │ │ ├── status.json.golden │ │ │ ├── statuses.json │ │ │ ├── statuses.json.golden │ │ │ ├── tags.json │ │ │ ├── tags.json.golden │ │ │ ├── unassign_issue.json │ │ │ ├── user.json │ │ │ ├── user.json.golden │ │ │ ├── version.json │ │ │ └── webhooks │ │ │ │ ├── branch_create.json │ │ │ │ ├── branch_create.json.golden │ │ │ │ ├── branch_delete.json │ │ │ │ ├── branch_delete.json.golden │ │ │ │ ├── issue_comment_created.json │ │ │ │ ├── issue_comment_created.json.golden │ │ │ │ ├── issue_comment_deleted.json │ │ │ │ ├── issue_comment_edited.json │ │ │ │ ├── issues_closed.json │ │ │ │ ├── issues_opened.json │ │ │ │ ├── issues_opened.json.golden │ │ │ │ ├── pull_request_closed.json │ │ │ │ ├── pull_request_closed.json.golden │ │ │ │ ├── pull_request_comment_created.json │ │ │ │ ├── pull_request_comment_created.json.golden │ │ │ │ ├── pull_request_comment_created_pr.json │ │ │ │ ├── pull_request_comment_deleted.json │ │ │ │ ├── pull_request_comment_edited.json │ │ │ │ ├── pull_request_edited.json │ │ │ │ ├── pull_request_edited.json.golden │ │ │ │ ├── pull_request_merged.json │ │ │ │ ├── pull_request_merged.json.golden │ │ │ │ ├── pull_request_opened.json │ │ │ │ ├── pull_request_opened.json.golden │ │ │ │ ├── pull_request_reopened.json │ │ │ │ ├── pull_request_reopened.json.golden │ │ │ │ ├── pull_request_synchronized.json │ │ │ │ ├── pull_request_synchronized.json.golden │ │ │ │ ├── push.json │ │ │ │ ├── push.json.golden │ │ │ │ ├── release.json │ │ │ │ ├── release.json.golden │ │ │ │ ├── review_approved.json │ │ │ │ ├── review_approved.json.golden │ │ │ │ ├── tag_create.json │ │ │ │ ├── tag_create.json.golden │ │ │ │ ├── tag_delete.json │ │ │ │ └── tag_delete.json.golden │ │ ├── user.go │ │ ├── user_test.go │ │ ├── webhook.go │ │ └── webhook_test.go │ ├── github │ │ ├── app.go │ │ ├── app_test.go │ │ ├── content.go │ │ ├── content_test.go │ │ ├── deploy.go │ │ ├── deploy_test.go │ │ ├── git.go │ │ ├── git_test.go │ │ ├── github.go │ │ ├── github_test.go │ │ ├── integration │ │ │ ├── content_test.go │ │ │ ├── git_test.go │ │ │ ├── github_test.go │ │ │ ├── integration.go │ │ │ ├── issue_test.go │ │ │ ├── org_test.go │ │ │ ├── pr_test.go │ │ │ ├── repo_test.go │ │ │ └── user_test.go │ │ ├── issue.go │ │ ├── issue_test.go │ │ ├── milestone.go │ │ ├── milestone_test.go │ │ ├── org.go │ │ ├── org_test.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── release.go │ │ ├── release_test.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── review_test.go │ │ ├── testdata │ │ │ ├── add_collaborator.json │ │ │ ├── app_repo_install.json │ │ │ ├── app_repo_install.json.golden │ │ │ ├── branch.json │ │ │ ├── branch.json.golden │ │ │ ├── branches.json │ │ │ ├── branches.json.golden │ │ │ ├── changes.json │ │ │ ├── changes.json.golden │ │ │ ├── close.json │ │ │ ├── combined_status.json │ │ │ ├── combined_status.json.golden │ │ │ ├── commit.json │ │ │ ├── commit.json.golden │ │ │ ├── commits.json │ │ │ ├── commits.json.golden │ │ │ ├── content.json │ │ │ ├── content.json.golden │ │ │ ├── content_list.json │ │ │ ├── content_list.json.golden │ │ │ ├── delete_reviewers.json │ │ │ ├── delete_reviewers_pr.json │ │ │ ├── deploy.json │ │ │ ├── deploy.json.golden │ │ │ ├── deploy_create.json │ │ │ ├── deploy_create.json.golden │ │ │ ├── deploy_status.json │ │ │ ├── deploy_status.json.golden │ │ │ ├── deploy_status_create.json │ │ │ ├── deploy_status_create.json.golden │ │ │ ├── deploy_statuses.json │ │ │ ├── deploy_statuses.json.golden │ │ │ ├── deploys.json │ │ │ ├── deploys.json.golden │ │ │ ├── edit_issue_comment.json │ │ │ ├── error.json │ │ │ ├── hook.json │ │ │ ├── hook.json.golden │ │ │ ├── hooks.json │ │ │ ├── hooks.json.golden │ │ │ ├── issue.json │ │ │ ├── issue.json.golden │ │ │ ├── issue_clear_milestone.json │ │ │ ├── issue_comment.json │ │ │ ├── issue_comment.json.golden │ │ │ ├── issue_comments.json │ │ │ ├── issue_comments.json.golden │ │ │ ├── issue_search.json │ │ │ ├── issue_search.json.golden │ │ │ ├── issue_search_prs.json │ │ │ ├── issue_search_prs.json.golden │ │ │ ├── issue_set_milestone.json │ │ │ ├── issues.json │ │ │ ├── issues.json.golden │ │ │ ├── list_invitations.json │ │ │ ├── list_invitations.json.golden │ │ │ ├── list_memberships.json │ │ │ ├── list_pending_invitations.json │ │ │ ├── membership_admin.json │ │ │ ├── membership_member.json │ │ │ ├── milestone.json │ │ │ ├── milestone.json.golden │ │ │ ├── milestone_create.json │ │ │ ├── milestones.json │ │ │ ├── milestones.json.golden │ │ │ ├── org.json │ │ │ ├── org.json.golden │ │ │ ├── org_accept_invitation.json │ │ │ ├── org_members.json │ │ │ ├── org_members.json.golden │ │ │ ├── orgs.json │ │ │ ├── orgs.json.golden │ │ │ ├── pr.json │ │ │ ├── pr.json.golden │ │ │ ├── pr_comment.json │ │ │ ├── pr_comment.json.golden │ │ │ ├── pr_comments.json │ │ │ ├── pr_comments.json.golden │ │ │ ├── pr_create.json │ │ │ ├── pr_create.json.golden │ │ │ ├── pr_files.json │ │ │ ├── pr_files.json.golden │ │ │ ├── pr_merge.json │ │ │ ├── pr_update.json │ │ │ ├── pulls.json │ │ │ ├── pulls.json.golden │ │ │ ├── ref.json │ │ │ ├── ref.json.golden │ │ │ ├── release.json │ │ │ ├── release.json.golden │ │ │ ├── releases.json │ │ │ ├── releases.json.golden │ │ │ ├── reopen.json │ │ │ ├── repo.json │ │ │ ├── repo.json.golden │ │ │ ├── repo_create.json │ │ │ ├── repo_create.json.golden │ │ │ ├── repo_fork_input.json │ │ │ ├── repos.json │ │ │ ├── repos.json.golden │ │ │ ├── request_reviewers.json │ │ │ ├── reviews_create.json │ │ │ ├── reviews_dismiss.json │ │ │ ├── reviews_find.json │ │ │ ├── reviews_find.json.golden │ │ │ ├── reviews_list.json │ │ │ ├── reviews_list.json.golden │ │ │ ├── reviews_list_comments.json │ │ │ ├── reviews_list_comments.json.golden │ │ │ ├── reviews_submit.json │ │ │ ├── reviews_update.json │ │ │ ├── status.json │ │ │ ├── status.json.golden │ │ │ ├── statuses.json │ │ │ ├── statuses.json.golden │ │ │ ├── tags.json │ │ │ ├── tags.json.golden │ │ │ ├── team_members.json │ │ │ ├── team_members.json.golden │ │ │ ├── teams.json │ │ │ ├── teams.json.golden │ │ │ ├── user.json │ │ │ ├── user.json.golden │ │ │ ├── user_perm.json │ │ │ └── webhooks │ │ │ │ ├── branch_create.json │ │ │ │ ├── branch_create.json.golden │ │ │ │ ├── branch_delete.json │ │ │ │ ├── branch_delete.json.golden │ │ │ │ ├── check_run_created.json │ │ │ │ ├── check_run_created.json.golden │ │ │ │ ├── check_suite_created.json │ │ │ │ ├── check_suite_created.json.golden │ │ │ │ ├── deployment.json │ │ │ │ ├── deployment.json.golden │ │ │ │ ├── deployment_status.json │ │ │ │ ├── deployment_status.json.golden │ │ │ │ ├── fork.json │ │ │ │ ├── fork.json.golden │ │ │ │ ├── installation.json │ │ │ │ ├── installation.json.golden │ │ │ │ ├── installation_delete.json │ │ │ │ ├── installation_delete.json.golden │ │ │ │ ├── installation_repository.json │ │ │ │ ├── installation_repository.json.golden │ │ │ │ ├── issue_comment.json │ │ │ │ ├── issue_comment.json.golden │ │ │ │ ├── label_deleted.json │ │ │ │ ├── label_deleted.json.golden │ │ │ │ ├── ping.json │ │ │ │ ├── ping.json.golden │ │ │ │ ├── pr_closed.json │ │ │ │ ├── pr_closed.json.golden │ │ │ │ ├── pr_comment.json │ │ │ │ ├── pr_comment.json.golden │ │ │ │ ├── pr_converted_to_draft.json │ │ │ │ ├── pr_converted_to_draft.json.golden │ │ │ │ ├── pr_edited.json │ │ │ │ ├── pr_edited.json.golden │ │ │ │ ├── pr_labeled.json │ │ │ │ ├── pr_labeled.json.golden │ │ │ │ ├── pr_opened.json │ │ │ │ ├── pr_opened.json.golden │ │ │ │ ├── pr_ready_for_review.json │ │ │ │ ├── pr_ready_for_review.json.golden │ │ │ │ ├── pr_reopened.json │ │ │ │ ├── pr_reopened.json.golden │ │ │ │ ├── pr_review_submitted.json │ │ │ │ ├── pr_review_submitted.json.golden │ │ │ │ ├── pr_sync.json │ │ │ │ ├── pr_sync.json.golden │ │ │ │ ├── pr_unlabeled.json │ │ │ │ ├── pr_unlabeled.json.golden │ │ │ │ ├── push.json │ │ │ │ ├── push.json.golden │ │ │ │ ├── push_branch_create.json │ │ │ │ ├── push_branch_create.json.golden │ │ │ │ ├── push_branch_delete.json │ │ │ │ ├── push_branch_delete.json.golden │ │ │ │ ├── push_tag.json │ │ │ │ ├── push_tag.json.golden │ │ │ │ ├── push_tag_delete.json │ │ │ │ ├── push_tag_delete.json.golden │ │ │ │ ├── release.json │ │ │ │ ├── release.json.golden │ │ │ │ ├── repository.json │ │ │ │ ├── repository.json.golden │ │ │ │ ├── status.json │ │ │ │ ├── status.json.golden │ │ │ │ ├── tag_create.json │ │ │ │ ├── tag_create.json.golden │ │ │ │ ├── tag_delete.json │ │ │ │ └── tag_delete.json.golden │ │ ├── user.go │ │ ├── user_test.go │ │ ├── util.go │ │ ├── util_test.go │ │ ├── webhook.go │ │ └── webhook_test.go │ ├── gitlab │ │ ├── commit.go │ │ ├── commit_test.go │ │ ├── content.go │ │ ├── content_test.go │ │ ├── git.go │ │ ├── git_test.go │ │ ├── gitlab.go │ │ ├── gitlab_test.go │ │ ├── integration │ │ │ ├── content_test.go │ │ │ ├── git_test.go │ │ │ ├── gitlab_test.go │ │ │ ├── integration.go │ │ │ ├── issue_test.go │ │ │ ├── org_test.go │ │ │ ├── pr_test.go │ │ │ ├── repo_test.go │ │ │ └── user_test.go │ │ ├── issue.go │ │ ├── issue_test.go │ │ ├── milestone.go │ │ ├── milestone_test.go │ │ ├── org.go │ │ ├── org_test.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── release.go │ │ ├── release_test.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── review_test.go │ │ ├── testdata │ │ │ ├── add_collaborator.json │ │ │ ├── add_collaborator_user.json │ │ │ ├── branch.json │ │ │ ├── branch.json.golden │ │ │ ├── branches.json │ │ │ ├── branches.json.golden │ │ │ ├── combined_status.json.golden │ │ │ ├── commit.json │ │ │ ├── commit.json.golden │ │ │ ├── commit_diff.json │ │ │ ├── commit_diff.json.golden │ │ │ ├── commits.json │ │ │ ├── commits.json.golden │ │ │ ├── compare.json │ │ │ ├── compare.json.golden │ │ │ ├── content.json │ │ │ ├── content.json.golden │ │ │ ├── content_list.json │ │ │ ├── content_list.json.golden │ │ │ ├── content_update.json │ │ │ ├── contributors.json │ │ │ ├── contributors.json.golden │ │ │ ├── create_branch.json │ │ │ ├── create_branch.json.golden │ │ │ ├── create_project.json │ │ │ ├── edit_issue_note.json │ │ │ ├── find_namespace.json │ │ │ ├── fork_project.json │ │ │ ├── group.json │ │ │ ├── group.json.golden │ │ │ ├── groups.json │ │ │ ├── groups.json.golden │ │ │ ├── hook.json │ │ │ ├── hook.json.golden │ │ │ ├── hook_ssl_false.json │ │ │ ├── hook_ssl_false.json.golden │ │ │ ├── hooks.json │ │ │ ├── hooks.json.golden │ │ │ ├── issue.json │ │ │ ├── issue.json.golden │ │ │ ├── issue_events.golden.json │ │ │ ├── issue_events.json │ │ │ ├── issue_note.json │ │ │ ├── issue_note.json.golden │ │ │ ├── issue_notes.json │ │ │ ├── issue_notes.json.golden │ │ │ ├── issue_or_pr_clear_milestone.json │ │ │ ├── issue_or_pr_set_milestone.json │ │ │ ├── issues.json │ │ │ ├── issues.json.golden │ │ │ ├── merge.json │ │ │ ├── merge.json.golden │ │ │ ├── merge_diff.json │ │ │ ├── merge_diff.json.golden │ │ │ ├── merge_note.json │ │ │ ├── merge_note.json.golden │ │ │ ├── merge_notes.json │ │ │ ├── merge_notes.json.golden │ │ │ ├── merges.json │ │ │ ├── merges.json.golden │ │ │ ├── milestone.json │ │ │ ├── milestone.json.golden │ │ │ ├── milestone_create.json │ │ │ ├── milestone_update.json │ │ │ ├── milestones.json │ │ │ ├── milestones.json.golden │ │ │ ├── nested_repo.json │ │ │ ├── nested_repo.json.golden │ │ │ ├── other_repo.json │ │ │ ├── pr_create.json │ │ │ ├── pr_create.json.golden │ │ │ ├── pr_events.golden.json │ │ │ ├── pr_events.json │ │ │ ├── pr_update.json │ │ │ ├── project_member_perm.json │ │ │ ├── release.json │ │ │ ├── release.json.golden │ │ │ ├── releases.json │ │ │ ├── releases.json.golden │ │ │ ├── repo.json │ │ │ ├── repo.json.golden │ │ │ ├── repos.json │ │ │ ├── repos.json.golden │ │ │ ├── status.json │ │ │ ├── status.json.golden │ │ │ ├── statuses.json │ │ │ ├── statuses.json.golden │ │ │ ├── tag.json │ │ │ ├── tag.json.golden │ │ │ ├── tags.json │ │ │ ├── tags.json.golden │ │ │ ├── user.json │ │ │ ├── user.json.golden │ │ │ ├── user_search.json │ │ │ ├── user_search.json.golden │ │ │ └── webhooks │ │ │ │ ├── branch_create.json │ │ │ │ ├── branch_create.json.golden │ │ │ │ ├── branch_delete.json │ │ │ │ ├── branch_delete.json.golden │ │ │ │ ├── issue_closed.json │ │ │ │ ├── issue_closed.json.golden │ │ │ │ ├── issue_comment_create.json │ │ │ │ ├── issue_comment_create.json.golden │ │ │ │ ├── issue_create.json │ │ │ │ ├── issue_create.json.golden │ │ │ │ ├── issue_edited.json │ │ │ │ ├── issue_edited.json.golden │ │ │ │ ├── issue_labeled.json │ │ │ │ ├── issue_labeled.json.golden │ │ │ │ ├── issue_reopen.json │ │ │ │ ├── issue_reopen.json.golden │ │ │ │ ├── pull_request_close.json │ │ │ │ ├── pull_request_close.json.golden │ │ │ │ ├── pull_request_comment_create.json │ │ │ │ ├── pull_request_comment_create.json.golden │ │ │ │ ├── pull_request_create.json │ │ │ │ ├── pull_request_create.json.golden │ │ │ │ ├── pull_request_edited.json │ │ │ │ ├── pull_request_edited.json.golden │ │ │ │ ├── pull_request_merge.json │ │ │ │ ├── pull_request_merge.json.golden │ │ │ │ ├── pull_request_reopen.json │ │ │ │ ├── pull_request_reopen.json.golden │ │ │ │ ├── push.json │ │ │ │ ├── push.json.golden │ │ │ │ ├── push2.json │ │ │ │ ├── push2.json.golden │ │ │ │ ├── push_merge.json │ │ │ │ ├── push_merge.json.golden │ │ │ │ ├── release.json │ │ │ │ ├── release.json.golden │ │ │ │ ├── review_comment_create.json │ │ │ │ ├── review_comment_create.json.golden │ │ │ │ ├── tag_create.json │ │ │ │ ├── tag_create.json.golden │ │ │ │ ├── tag_delete.json │ │ │ │ └── tag_delete.json.golden │ │ ├── user.go │ │ ├── user_test.go │ │ ├── util.go │ │ ├── util_test.go │ │ ├── webhook.go │ │ └── webhook_test.go │ ├── gogs │ │ ├── content.go │ │ ├── content_test.go │ │ ├── git.go │ │ ├── git_test.go │ │ ├── gogs.go │ │ ├── gogs_test.go │ │ ├── issue.go │ │ ├── issue_test.go │ │ ├── milestone.go │ │ ├── org.go │ │ ├── org_test.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── release.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── review_test.go │ │ ├── testdata │ │ │ ├── branch.json │ │ │ ├── branch.json.golden │ │ │ ├── branches.json │ │ │ ├── branches.json.golden │ │ │ ├── comment.json │ │ │ ├── comment.json.golden │ │ │ ├── comments.json │ │ │ ├── comments.json.golden │ │ │ ├── commits.json │ │ │ ├── commits.json.golden │ │ │ ├── hook.json │ │ │ ├── hook.json.golden │ │ │ ├── hooks.json │ │ │ ├── hooks.json.golden │ │ │ ├── issue.json │ │ │ ├── issue.json.golden │ │ │ ├── issues.json │ │ │ ├── issues.json.golden │ │ │ ├── organization.json │ │ │ ├── organization.json.golden │ │ │ ├── organizations.json │ │ │ ├── organizations.json.golden │ │ │ ├── repo.json │ │ │ ├── repo.json.golden │ │ │ ├── repos.json │ │ │ ├── repos.json.golden │ │ │ ├── user.json │ │ │ ├── user.json.golden │ │ │ └── webhooks │ │ │ │ ├── branch_create.json │ │ │ │ ├── branch_create.json.golden │ │ │ │ ├── branch_delete.json │ │ │ │ ├── branch_delete.json.golden │ │ │ │ ├── issue_comment_created.json │ │ │ │ ├── issue_comment_created.json.golden │ │ │ │ ├── issue_comment_deleted.json │ │ │ │ ├── issue_comment_edited.json │ │ │ │ ├── issues_closed.json │ │ │ │ ├── issues_opened.json │ │ │ │ ├── issues_opened.json.golden │ │ │ │ ├── pull_request_closed.json │ │ │ │ ├── pull_request_closed.json.golden │ │ │ │ ├── pull_request_comment_created.json │ │ │ │ ├── pull_request_comment_created.json.golden │ │ │ │ ├── pull_request_comment_deleted.json │ │ │ │ ├── pull_request_comment_edited.json │ │ │ │ ├── pull_request_edited.json │ │ │ │ ├── pull_request_edited.json.golden │ │ │ │ ├── pull_request_opened.json │ │ │ │ ├── pull_request_opened.json.golden │ │ │ │ ├── pull_request_synchronized.json │ │ │ │ ├── pull_request_synchronized.json.golden │ │ │ │ ├── push.json │ │ │ │ ├── push.json.golden │ │ │ │ ├── release.json │ │ │ │ ├── release.json.golden │ │ │ │ ├── tag_create.json │ │ │ │ ├── tag_create.json.golden │ │ │ │ ├── tag_delete.json │ │ │ │ └── tag_delete.json.golden │ │ ├── user.go │ │ ├── user_test.go │ │ ├── webhook.go │ │ └── webhook_test.go │ ├── internal │ │ └── null │ │ │ ├── bool.go │ │ │ ├── int.go │ │ │ └── string.go │ └── stash │ │ ├── content.go │ │ ├── content_test.go │ │ ├── git.go │ │ ├── git_test.go │ │ ├── issue.go │ │ ├── issue_test.go │ │ ├── milestone.go │ │ ├── multipart.go │ │ ├── org.go │ │ ├── org_test.go │ │ ├── pr.go │ │ ├── pr_test.go │ │ ├── repo.go │ │ ├── repo_test.go │ │ ├── review.go │ │ ├── review_test.go │ │ ├── stash.go │ │ ├── stash_test.go │ │ ├── testdata │ │ ├── add_collaborator.json │ │ ├── branch.json │ │ ├── branch.json.golden │ │ ├── branches.json │ │ ├── branches.json.golden │ │ ├── changes.json │ │ ├── changes.json.golden │ │ ├── combined_status.json.golden │ │ ├── commit.json │ │ ├── commit.json.golden │ │ ├── commit_build_status.json │ │ ├── commit_build_status.json.golden │ │ ├── commits.json │ │ ├── commits.json.golden │ │ ├── content.json.golden │ │ ├── content.txt │ │ ├── content_create.json │ │ ├── content_list.json │ │ ├── content_update.json │ │ ├── create_ref.json │ │ ├── create_ref.json.golden │ │ ├── create_repo.json │ │ ├── default_branch.json │ │ ├── default_branch.json.golden │ │ ├── error.json │ │ ├── find_user_permission.json │ │ ├── fork_repo.json │ │ ├── group_members.json │ │ ├── org_members.json │ │ ├── org_members.json.golden │ │ ├── orgs.json │ │ ├── orgs.json.golden │ │ ├── pr.json │ │ ├── pr.json.golden │ │ ├── pr_change.json │ │ ├── pr_change.json.golden │ │ ├── pr_comment.json │ │ ├── pr_comment.json.golden │ │ ├── pr_comments.json │ │ ├── pr_comments.json.golden │ │ ├── pr_label_comment.json │ │ ├── pr_label_comments.json │ │ ├── pr_labels.json.golden │ │ ├── pr_update.json │ │ ├── project_groups.json │ │ ├── prs.json │ │ ├── prs.json.golden │ │ ├── repo.json │ │ ├── repo.json.golden │ │ ├── repos.json │ │ ├── repos.json.golden │ │ ├── tag.json │ │ ├── tag.json.golden │ │ ├── tags.json │ │ ├── tags.json.golden │ │ ├── user.json │ │ ├── user.json.golden │ │ ├── webhook.json │ │ ├── webhook.json.golden │ │ ├── webhooks.json │ │ ├── webhooks.json.golden │ │ └── webhooks │ │ │ ├── pr_approved.json │ │ │ ├── pr_approved.json.golden │ │ │ ├── pr_comment.json │ │ │ ├── pr_comment.json.golden │ │ │ ├── pr_declined.json │ │ │ ├── pr_declined.json.golden │ │ │ ├── pr_deleted.json │ │ │ ├── pr_deleted.json.golden │ │ │ ├── pr_merged.json │ │ │ ├── pr_merged.json.golden │ │ │ ├── pr_modified.json │ │ │ ├── pr_modified.json.golden │ │ │ ├── pr_needs_work.json │ │ │ ├── pr_needs_work.json.golden │ │ │ ├── pr_open.json │ │ │ ├── pr_open.json.golden │ │ │ ├── pr_ref_updated.json │ │ │ ├── pr_ref_updated.json.golden │ │ │ ├── pr_unapproved.json │ │ │ ├── pr_unapproved.json.golden │ │ │ ├── push.json │ │ │ ├── push.json.golden │ │ │ ├── push_branch_create.json │ │ │ ├── push_branch_create.json.golden │ │ │ ├── push_branch_delete.json │ │ │ ├── push_branch_delete.json.golden │ │ │ ├── push_tag_create.json │ │ │ ├── push_tag_create.json.golden │ │ │ ├── push_tag_delete.json │ │ │ └── push_tag_delete.json.golden │ │ ├── user.go │ │ ├── user_test.go │ │ ├── util.go │ │ ├── util_test.go │ │ ├── webhook.go │ │ └── webhook_test.go ├── errors.go ├── example_test.go ├── factory │ ├── drivers.go │ ├── drivers_test.go │ ├── examples │ │ ├── addlabel │ │ │ └── main.go │ │ ├── changes │ │ │ └── main.go │ │ ├── combinedstatus │ │ │ └── main.go │ │ ├── commits │ │ │ └── main.go │ │ ├── contentcreate │ │ │ └── main.go │ │ ├── contentlist │ │ │ └── main.go │ │ ├── contents │ │ │ └── main.go │ │ ├── contentupdate │ │ │ └── main.go │ │ ├── contributors │ │ │ └── main.go │ │ ├── graphql │ │ │ └── main.go │ │ ├── helpers │ │ │ └── helpers.go │ │ ├── pr │ │ │ └── main.go │ │ ├── prlabel │ │ │ └── main.go │ │ ├── ref │ │ │ └── main.go │ │ ├── release │ │ │ └── get.go │ │ ├── repo │ │ │ └── main.go │ │ ├── repos │ │ │ └── main.go │ │ └── search │ │ │ └── main.go │ ├── factory.go │ └── factory_test.go ├── git.go ├── issue.go ├── labels │ └── labels.go ├── milestone.go ├── org.go ├── pr.go ├── release.go ├── repo.go ├── review.go ├── testdata │ └── webhooks │ │ └── push.json ├── token.go ├── transport │ ├── auth.go │ ├── auth_test.go │ ├── basicauth.go │ ├── basicauth_test.go │ ├── bearer.go │ ├── bearer_test.go │ ├── custom.go │ ├── custom_test.go │ ├── doc.go │ ├── internal │ │ ├── clone.go │ │ └── clone_test.go │ ├── oauth1 │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── oauth1.go │ │ ├── oauth1_test.go │ │ ├── sign.go │ │ ├── sign_test.go │ │ ├── sort.go │ │ ├── sort_test.go │ │ ├── source.go │ │ ├── source_test.go │ │ ├── url.go │ │ └── url_test.go │ ├── oauth2 │ │ ├── oauth2.go │ │ ├── oauth2_test.go │ │ ├── refresh.go │ │ ├── refresh_test.go │ │ ├── source.go │ │ └── source_test.go │ ├── private.go │ ├── private_test.go │ ├── util.go │ └── util_test.go ├── user.go ├── util.go ├── util_test.go ├── webhook.go └── webhook_test.go └── updatebot.sh /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gomod" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yaml: -------------------------------------------------------------------------------- 1 | name: Pull Request Build 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | pr: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v2 14 | - name: build-make-linux 15 | uses: docker://golang:1.20.14 16 | with: 17 | args: -c "make check test" 18 | entrypoint: /bin/sh 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | *.env 3 | *.out 4 | _*.md 5 | .vscode 6 | .idea 7 | cmd 8 | .history 9 | -------------------------------------------------------------------------------- /.jx/updatebot.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: updatebot.jenkins-x.io/v1alpha1 2 | kind: UpdateConfig 3 | spec: 4 | rules: 5 | - urls: 6 | - https://github.com/jenkins-x/lighthouse 7 | changes: 8 | - regex: 9 | pattern: | 10 | github.com/jenkins-x/go-scm v(.*) 11 | files: 12 | - "go.mod" 13 | - command: 14 | name: go 15 | args: 16 | - mod 17 | - tidy -------------------------------------------------------------------------------- /.lighthouse/jenkins-x/lint.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | creationTimestamp: null 5 | name: lint 6 | spec: 7 | pipelineSpec: 8 | tasks: 9 | - name: go-scm-lint 10 | resources: {} 11 | timeout: 24h 12 | taskSpec: 13 | metadata: {} 14 | stepTemplate: 15 | image: uses:jenkins-x/jx3-pipeline-catalog/tasks/go/pullrequest.yaml@versionStream 16 | name: "" 17 | resources: {} 18 | workingDir: /workspace/source 19 | steps: 20 | - image: uses:jenkins-x/jx3-pipeline-catalog/tasks/git-clone/git-clone-pr.yaml@versionStream 21 | name: "" 22 | resources: {} 23 | - name: make-lint 24 | resources: {} 25 | podTemplate: {} 26 | serviceAccountName: tekton-bot 27 | timeout: 24h 28 | status: {} 29 | -------------------------------------------------------------------------------- /.lighthouse/jenkins-x/pullrequest.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | creationTimestamp: null 5 | name: pullrequest 6 | spec: 7 | pipelineSpec: 8 | tasks: 9 | - name: from-build-pack 10 | timeout: 24h 11 | resources: {} 12 | taskSpec: 13 | metadata: {} 14 | stepTemplate: 15 | image: uses:jenkins-x/jx3-pipeline-catalog/tasks/go/pullrequest.yaml@versionStream 16 | name: "" 17 | resources: {} 18 | workingDir: /workspace/source 19 | steps: 20 | - image: uses:jenkins-x/jx3-pipeline-catalog/tasks/git-clone/git-clone-pr.yaml@versionStream 21 | name: "" 22 | resources: {} 23 | - name: jx-variables 24 | resources: {} 25 | - name: build-make-linux 26 | resources: {} 27 | podTemplate: {} 28 | serviceAccountName: tekton-bot 29 | timeout: 240h0m0s 30 | status: {} -------------------------------------------------------------------------------- /.lighthouse/jenkins-x/release.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: release 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | timeout: 24h 10 | taskSpec: 11 | stepTemplate: 12 | image: uses:jenkins-x/jx3-pipeline-catalog/tasks/go/release.yaml@versionStream 13 | resources: {} 14 | workingDir: /workspace/source 15 | steps: 16 | - image: uses:jenkins-x/jx3-pipeline-catalog/tasks/git-clone/git-clone.yaml@versionStream 17 | - name: next-version 18 | - name: jx-variables 19 | - name: build-make-build 20 | - name: promote-changelog 21 | - image: uses:jenkins-x/jx3-pipeline-catalog/tasks/updatebot/release.yaml@versionStream 22 | podTemplate: {} 23 | serviceAccountName: tekton-bot 24 | timeout: 240h0m0s 25 | status: {} 26 | -------------------------------------------------------------------------------- /.lighthouse/jenkins-x/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: pr 6 | context: "pr" 7 | always_run: true 8 | optional: false 9 | trigger: (?m)^/test( all| pr),?(s+|$) 10 | rerun_command: /test pr 11 | source: "pullrequest.yaml" 12 | - name: lint 13 | context: "lint" 14 | always_run: true 15 | optional: false 16 | trigger: (?m)^/test( all| lint),?(s+|$) 17 | rerun_command: /test lint 18 | source: "lint.yaml" 19 | postsubmits: 20 | - name: release 21 | context: "release" 22 | source: "release.yaml" 23 | branches: 24 | - main 25 | - master 26 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [1.5.0] 8 | ### Added 9 | 10 | - Fix missing sha for Gitea tag hooks, from [@techknowlogick](https://github.com/techknowlogick). See [#22](https://github.com/drone/go-scm/pull/22). 11 | - Support for Gitea webhook signature verification, from [@techknowlogick](https://github.com/techknowlogick). 12 | 13 | ## [1.4.0] 14 | ### Added 15 | 16 | - Fix issues base64 decoding GitLab content, from [@bradrydzewski](https://github.com/bradrydzewski). 17 | 18 | ## [1.3.0] 19 | ### Added 20 | 21 | - Fix missing avatar in Gitea commit from [@jgeek1011](https://github.com/geek1011). 22 | - Implement GET commit endpoint for Gogs from [@ogarcia](https://github.com/ogarcia). 23 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright 2017 Drone.IO Inc. All rights reserved. 2 | Use of this source code is governed by a BSD-style 3 | license that can be found in the LICENSE file. -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - maintainers 3 | reviewers: 4 | - maintainers -------------------------------------------------------------------------------- /OWNERS_ALIASES: -------------------------------------------------------------------------------- 1 | foreignAliases: 2 | - name: jx-community -------------------------------------------------------------------------------- /hack/gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=$(find . -name "*.go" | grep -v vendor/ | grep -v ./pkg/client/openapi/all | grep -v Dockerfile | xargs gofmt -l -s) 4 | if [[ $files ]]; then 5 | echo "Gofmt errors in files:" 6 | echo "$files" 7 | diff=$(find . -name "*.go" | grep -v vendor/ | grep -v ./pkg/client/openapi/all | grep -v Dockerfile | xargs gofmt -d -s) 8 | echo "$diff" 9 | exit 1 10 | fi 11 | -------------------------------------------------------------------------------- /hack/linter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -o pipefail 4 | 5 | if [ "$DISABLE_LINTER" == "true" ] 6 | then 7 | exit 0 8 | fi 9 | 10 | linterVersion="$(golangci-lint --version | awk '{print $4}')" 11 | 12 | if [[ ! "${linterVersion}" =~ ^v?1\.6[0-9] ]]; then 13 | echo "Install GolangCI-Lint version 1.6x.x" 14 | exit 1 15 | fi 16 | 17 | export GO111MODULE=on 18 | golangci-lint run \ 19 | --verbose \ 20 | --build-tags build 21 | -------------------------------------------------------------------------------- /scm/const_test.go: -------------------------------------------------------------------------------- 1 | package scm 2 | 3 | import ( 4 | "encoding/json" 5 | "testing" 6 | ) 7 | 8 | func TestStateJSON(t *testing.T) { 9 | for i := StateUnknown; i < StateExpected; i++ { 10 | in := i 11 | t.Run(in.String(), func(t *testing.T) { 12 | b, err := json.Marshal(in) 13 | if err != nil { 14 | t.Fatal(err) 15 | } 16 | 17 | var out State 18 | if err := json.Unmarshal(b, &out); err != nil { 19 | t.Fatal(err) 20 | } 21 | 22 | if in != out { 23 | t.Errorf("%s != %s", in, out) 24 | } 25 | }) 26 | } 27 | } 28 | 29 | func TestActionJSON(t *testing.T) { 30 | for i := ActionCreate; i < ActionCompleted; i++ { 31 | in := i 32 | t.Run(in.String(), func(t *testing.T) { 33 | b, err := json.Marshal(in) 34 | if err != nil { 35 | t.Fatal(err) 36 | } 37 | 38 | var out Action 39 | if err := json.Unmarshal(b, &out); err != nil { 40 | t.Fatal(err) 41 | } 42 | 43 | if in != out { 44 | t.Errorf("%s != %s", in, out) 45 | } 46 | }) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /scm/driver/azure/testdata/branch_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "value": [ 3 | { 4 | "repositoryId": "d3d1760b-311c-4175-a726-20dfc6a7f885", 5 | "name": "refs/heads/test_branch", 6 | "oldObjectId": "0000000000000000000000000000000000000000", 7 | "newObjectId": "ffe9cba521f00d7f60e322845072238635edb451", 8 | "isLocked": false, 9 | "updateStatus": "succeeded", 10 | "success": true 11 | } 12 | ], 13 | "count": 1 14 | } 15 | -------------------------------------------------------------------------------- /scm/driver/azure/testdata/branch_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "test_branch", 3 | "Path": "refs/heads/test_branch", 4 | "Sha": "ffe9cba521f00d7f60e322845072238635edb451" 5 | } 6 | -------------------------------------------------------------------------------- /scm/driver/azure/testdata/branches.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "main", 4 | "Path": "refs/heads/main", 5 | "Sha": "e0aee6aa543294d62520fb906689da6710af149c" 6 | }, 7 | { 8 | "Name": "pr_branch", 9 | "Path": "refs/heads/pr_branch", 10 | "Sha": "01768d964c03e97260af0bd8cd9e5cd1f9ac6356" 11 | }, 12 | { 13 | "Name": "test_branch", 14 | "Path": "refs/heads/test_branch", 15 | "Sha": "d2036abdecd80290e971e263fe668ca87608f8d1" 16 | }, 17 | { 18 | "Name": "refs/pull/1/merge", 19 | "Path": "refs/pull/1/merge", 20 | "Sha": "e29c0a25614589e1310574b42f799101903b7e30" 21 | } 22 | ] -------------------------------------------------------------------------------- /scm/driver/azure/testdata/commit.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Sha": "14897f4465d2d63508242b5cbf68aa2865f693e7", 3 | "Message": "update CRUD", 4 | "Author": { 5 | "Name": "tp", 6 | "Email": "tp@harness.io", 7 | "Date": "2022-03-15T17:08:22Z", 8 | "Login": "tp", 9 | "Avatar": "" 10 | }, 11 | "Committer": { 12 | "Name": "tp", 13 | "Email": "tp@harness.io", 14 | "Date": "2022-03-15T17:08:22Z", 15 | "Login": "tp", 16 | "Avatar": "" 17 | }, 18 | "Link": "https://dev.azure.com/tphoney/d350c9c0-7749-4ff8-a78f-f9c1f0e56729/_apis/git/repositories/fde2d21f-13b9-4864-a995-83329045289a/commits/14897f4465d2d63508242b5cbf68aa2865f693e7" 19 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/compare.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "/testfile", 4 | "Added": false, 5 | "Renamed": false, 6 | "Deleted": false, 7 | "BlobID": "" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /scm/driver/azure/testdata/content.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Path": "/README.md", 3 | "Data": "SGVsbG8gV29ybGQhCg==", 4 | "Sha": "2c0c712b26c3328ed66d5771213360812be9d035", 5 | "BlobID": "0ca446aab9d09eac8625b53e3df8da661976c458" 6 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/content_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "count": 2, 3 | "value": [ 4 | { 5 | "objectId": "9804b758e84cac41a6acc4d011f57310a1f63102", 6 | "gitObjectType": "tree", 7 | "commitId": "e25d5d5f8dba6a25d5d66c020b101278d818a8b8", 8 | "path": "/", 9 | "isFolder": true, 10 | "url": "https://dev.azure.com/tphoney/d350c9c0-7749-4ff8-a78f-f9c1f0e56729/_apis/git/repositories/fde2d21f-13b9-4864-a995-83329045289a/items?path=%2F&versionType=Branch&versionOptions=None" 11 | }, 12 | { 13 | "objectId": "0ca446aab9d09eac8625b53e3df8da661976c458", 14 | "gitObjectType": "blob", 15 | "commitId": "e25d5d5f8dba6a25d5d66c020b101278d818a8b8", 16 | "path": "/README.md", 17 | "url": "https://dev.azure.com/tphoney/test_project/_apis/git/repositories/fde2d21f-13b9-4864-a995-83329045289a/items//README.md?versionType=Branch&versionOptions=None" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/content_list.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "path": "/", 4 | "kind": "directory", 5 | "Sha": "e25d5d5f8dba6a25d5d66c020b101278d818a8b8", 6 | "BlobID": "9804b758e84cac41a6acc4d011f57310a1f63102" 7 | }, 8 | { 9 | "path": "/README.md", 10 | "kind": "file", 11 | "Sha": "e25d5d5f8dba6a25d5d66c020b101278d818a8b8", 12 | "BlobID": "0ca446aab9d09eac8625b53e3df8da661976c458" 13 | } 14 | ] -------------------------------------------------------------------------------- /scm/driver/azure/testdata/hook.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "d455cb11-20a0-4b15-b546-7e9fb9973cc6", 3 | "Name": "", 4 | "Target": "http://www.bla.com", 5 | "Events": [ 6 | "git.pullrequest.created" 7 | ], 8 | "Active": true, 9 | "SkipVerify": true 10 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/hooks.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "d455cb11-20a0-4b15-b546-7e9fb9973cc6", 4 | "Name": "", 5 | "Target": "http://www.bla.com", 6 | "Events": [ 7 | "git.pullrequest.created" 8 | ], 9 | "Active": true, 10 | "SkipVerify": true 11 | }, 12 | { 13 | "ID": "d455cb11-20a0-4b15-b546-7e9fb9973cc7", 14 | "Name": "", 15 | "Target": "http://www.bla.com", 16 | "Events": [ 17 | "git.pullrequest.merged" 18 | ], 19 | "Active": true, 20 | "SkipVerify": true 21 | } 22 | ] -------------------------------------------------------------------------------- /scm/driver/azure/testdata/pr_abandon.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "abandoned" 3 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/pr_merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "completed", 3 | "lastMergeSourceCommit": { 4 | "commitId": "01768d964c03e97260af0bd8cd9e5cd1f9ac6356", 5 | "url": "https://dev.azure.com/tphoney/d350c9c0-7749-4ff8-a78f-f9c1f0e56729/_apis/git/repositories/fde2d21f-13b9-4864-a995-83329045289a/commits/01768d964c03e97260af0bd8cd9e5cd1f9ac6356" 6 | } 7 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d350c9c0-7749-4ff8-a78f-f9c1f0e56729", 3 | "name": "test_project", 4 | "url": "https://dev.azure.com/tphoney/_apis/projects/d350c9c0-7749-4ff8-a78f-f9c1f0e56729", 5 | "state": "wellFormed", 6 | "revision": 11, 7 | "visibility": "private", 8 | "lastUpdateTime": "2022-02-24T15:31:27.89Z" 9 | } 10 | -------------------------------------------------------------------------------- /scm/driver/azure/testdata/projects.json: -------------------------------------------------------------------------------- 1 | { 2 | "count": 1, 3 | "value": [ 4 | { 5 | "id": "d350c9c0-7749-4ff8-a78f-f9c1f0e56729", 6 | "name": "test_project", 7 | "url": "https://dev.azure.com/tphoney/_apis/projects/d350c9c0-7749-4ff8-a78f-f9c1f0e56729", 8 | "state": "wellFormed", 9 | "revision": 11, 10 | "visibility": "private", 11 | "lastUpdateTime": "2022-02-24T15:31:27.89Z" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/repo.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "91f0d4cb-4c36-49a5-b28d-2d72da089c4d", 3 | "name": "test_repo", 4 | "url": "https://dev.azure.com/tphoney/d350c9c0-7749-4ff8-a78f-f9c1f0e56729/_apis/git/repositories/91f0d4cb-4c36-49a5-b28d-2d72da089c4d", 5 | "project": { 6 | "id": "d350c9c0-7749-4ff8-a78f-f9c1f0e56729", 7 | "name": "test_project", 8 | "url": "https://dev.azure.com/tphoney/_apis/projects/d350c9c0-7749-4ff8-a78f-f9c1f0e56729", 9 | "state": "wellFormed", 10 | "revision": 11, 11 | "visibility": "private", 12 | "lastUpdateTime": "2022-02-24T15:31:27.89Z" 13 | }, 14 | "defaultBranch": "refs/heads/main", 15 | "size": 1232, 16 | "remoteUrl": "https://tphoney@dev.azure.com/tphoney/test_project/_git/test_project", 17 | "sshUrl": "git@ssh.dev.azure.com:v3/tphoney/test_project/test_project", 18 | "webUrl": "https://dev.azure.com/tphoney/test_project/_git/test_project", 19 | "isDisabled": false 20 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "91f0d4cb-4c36-49a5-b28d-2d72da089c4d", 3 | "Name": "test_repo", 4 | "FullName": "tphoney/test_project/test_repo", 5 | "Namespace": "tphoney/test_project", 6 | "Branch": "main", 7 | "Link": "https://dev.azure.com/tphoney/test_project/_git/test_project", 8 | "Clone": "https://tphoney@dev.azure.com/tphoney/test_project/_git/test_project", 9 | "CloneSSH": "git@ssh.dev.azure.com:v3/tphoney/test_project/test_project" 10 | } -------------------------------------------------------------------------------- /scm/driver/azure/testdata/repo_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultBranch": "", 3 | "id": "", 4 | "name": "test_project", 5 | "project": { 6 | "id": "d350c9c0-7749-4ff8-a78f-f9c1f0e56729", 7 | "name": "", 8 | "state": "", 9 | "url": "" 10 | }, 11 | "remoteUrl": "", 12 | "sshUrl": "", 13 | "webUrl": "", 14 | "url": "" 15 | } 16 | -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "master", 3 | "Path": "refs/heads/master", 4 | "Sha": "a6e5e7d797edf751cbd839d6bd4aef86c941eec9" 5 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/branches.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "master", 4 | "Path": "refs/heads/master", 5 | "Sha": "a6e5e7d797edf751cbd839d6bd4aef86c941eec9" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/commit.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Sha": "a6e5e7d797edf751cbd839d6bd4aef86c941eec9", 3 | "Message": "Add Apache 2.0 License\n", 4 | "Author": { 5 | "Name": "Adam Ahmed", 6 | "Email": "aahmed@atlassian.com", 7 | "Date": "2015-08-27T03:25:04Z", 8 | "Login": "aahmed", 9 | "Avatar": "https://bitbucket.org/account/aahmed/avatar/32/" 10 | }, 11 | "Committer": { 12 | "Name": "Adam Ahmed", 13 | "Email": "aahmed@atlassian.com", 14 | "Date": "2015-08-27T03:25:04Z", 15 | "Login": "aahmed", 16 | "Avatar": "https://bitbucket.org/account/aahmed/avatar/32/" 17 | }, 18 | "Link": "https://bitbucket.org/atlassian/stash-example-plugin/commits/a6e5e7d797edf751cbd839d6bd4aef86c941eec9" 19 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/commits.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Sha": "a6e5e7d797edf751cbd839d6bd4aef86c941eec9", 4 | "Message": "Add Apache 2.0 License\n", 5 | "Author": { 6 | "Name": "Adam Ahmed", 7 | "Email": "aahmed@atlassian.com", 8 | "Date": "2015-08-27T03:25:04Z", 9 | "Login": "aahmed", 10 | "Avatar": "https://bitbucket.org/account/aahmed/avatar/32/" 11 | }, 12 | "Committer": { 13 | "Name": "Adam Ahmed", 14 | "Email": "aahmed@atlassian.com", 15 | "Date": "2015-08-27T03:25:04Z", 16 | "Login": "aahmed", 17 | "Avatar": "https://bitbucket.org/account/aahmed/avatar/32/" 18 | }, 19 | "Link": "https://bitbucket.org/atlassian/stash-example-plugin/commits/a6e5e7d797edf751cbd839d6bd4aef86c941eec9" 20 | } 21 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/content.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Path": "README", 3 | "Data": "SEVMTE8gV09STEQK" 4 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/content.txt: -------------------------------------------------------------------------------- 1 | HELLO WORLD 2 | -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/diffstat.json: -------------------------------------------------------------------------------- 1 | { 2 | "pagelen": 500, 3 | "values": [ 4 | { 5 | "status": "modified", 6 | "old": { 7 | "path": "CONTRIBUTING.md", 8 | "type": "commit_file", 9 | "links": { 10 | "self": { 11 | "href": "https:\/\/api.bitbucket.org\/2.0\/repositories\/atlassian\/atlaskit\/src\/dec26e0fe887167743c2b7e36531dedfeb6cd478\/CONTRIBUTING.md" 12 | } 13 | } 14 | }, 15 | "lines_removed": 15, 16 | "lines_added": 15, 17 | "new": { 18 | "path": "CONTRIBUTING.md", 19 | "type": "commit_file", 20 | "links": { 21 | "self": { 22 | "href": "https:\/\/api.bitbucket.org\/2.0\/repositories\/atlassian\/atlaskit\/src\/425863f9dbe56d70c8dcdbf2e4e0805e85591fcc\/CONTRIBUTING.md" 23 | } 24 | } 25 | }, 26 | "type": "diffstat" 27 | } 28 | ], 29 | "page": 1, 30 | "size": 1 31 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/diffstat.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "CONTRIBUTING.md", 4 | "Added": false, 5 | "Renamed": false, 6 | "Deleted": false 7 | } 8 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "error", 3 | "error": { 4 | "message": "Repository dev/null not found" 5 | } 6 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/hook.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "{d53603cc-3f67-45ea-b310-aaa5ef6ec061}", 3 | "Name": "beta.drone.io", 4 | "Target": "http://example.com/webhook", 5 | "Events": [ 6 | "pullrequest:created", 7 | "pullrequest:updated", 8 | "repo:push" 9 | ], 10 | "Active": true, 11 | "SkipVerify": false 12 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/hooks.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "{d53603cc-3f67-45ea-b310-aaa5ef6ec061}", 4 | "Name": "example.com", 5 | "Target": "http://example.com/webhook", 6 | "Events": [ 7 | "pullrequest:created", 8 | "pullrequest:updated", 9 | "repo:push" 10 | ], 11 | "Active": true, 12 | "SkipVerify": false 13 | } 14 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/perms.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Pull": true, 3 | "Push": true, 4 | "Admin": true 5 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/pr_diffstat.json: -------------------------------------------------------------------------------- 1 | { 2 | "pagelen": 30, 3 | "values": [ 4 | { 5 | "status": "modified", 6 | "old": { 7 | "path": "CONTRIBUTING.md", 8 | "type": "commit_file", 9 | "links": { 10 | "self": { 11 | "href": "https:\/\/api.bitbucket.org\/2.0\/repositories\/atlassian\/atlaskit\/src\/dec26e0fe887167743c2b7e36531dedfeb6cd478\/CONTRIBUTING.md" 12 | } 13 | } 14 | }, 15 | "lines_removed": 15, 16 | "lines_added": 15, 17 | "new": { 18 | "path": "CONTRIBUTING.md", 19 | "type": "commit_file", 20 | "links": { 21 | "self": { 22 | "href": "https:\/\/api.bitbucket.org\/2.0\/repositories\/atlassian\/atlaskit\/src\/425863f9dbe56d70c8dcdbf2e4e0805e85591fcc\/CONTRIBUTING.md" 23 | } 24 | } 25 | }, 26 | "type": "diffstat" 27 | } 28 | ], 29 | "page": 1, 30 | "size": 1 31 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/pr_diffstat.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "CONTRIBUTING.md", 4 | "Added": false, 5 | "Renamed": false, 6 | "Deleted": false 7 | } 8 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/repo-permision.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Login": "5c9078461b780c2c5d7bac4c", 4 | "Name": "johndoe", 5 | "Avatar": "https://bitbucket.org/account/5c9078461b780c2c5d7bac4c/avatar/32/", 6 | "IsAdmin": false 7 | } 8 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "{7dd600e6-0d9c-4801-b967-cb4cc17359ff}", 3 | "Namespace": "atlassian", 4 | "Name": "stash-example-plugin", 5 | "FullName": "atlassian/stash-example-plugin", 6 | "Perm": null, 7 | "Branch": "master", 8 | "Private": true, 9 | "Clone": "https://bitbucket.org/atlassian/stash-example-plugin.git", 10 | "CloneSSH": "git@bitbucket.org:atlassian/stash-example-plugin.git", 11 | "Link": "https://bitbucket.org/atlassian/stash-example-plugin", 12 | "Created": "2013-04-15T03:05:05.595458Z", 13 | "Updated": "2018-04-01T16:36:35.970175Z" 14 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/repos-single.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "{7dd600e6-0d9c-4801-b967-cb4cc17359ff}", 4 | "Namespace": "atlassian", 5 | "Name": "stash-example-plugin", 6 | "FullName": "atlassian/stash-example-plugin", 7 | "Perm": null, 8 | "Branch": "master", 9 | "Private": true, 10 | "Clone": "https://bitbucket.org/atlassian/stash-example-plugin.git", 11 | "CloneSSH": "git@bitbucket.org:atlassian/stash-example-plugin.git", 12 | "Link": "https://bitbucket.org/atlassian/stash-example-plugin", 13 | "Created": "2013-04-15T03:05:05.595458Z", 14 | "Updated": "2018-04-01T16:36:35.970175Z" 15 | } 16 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "State": "success", 3 | "Label": "drone", 4 | "Desc": "Build has completed successfully", 5 | "Target": "https://ci.example.com/1000/output", 6 | "Link": "https://api.bitbucket.org/2.0/repositories/atlassian/stash-example-plugin/commit/a6e5e7d797edf751cbd839d6bd4aef86c941eec9" 7 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/status_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "state": "SUCCESSFUL", 3 | "name": "continuous-integration/drone", 4 | "key": "continuous-integration/drone", 5 | "description": "Build has completed successfully", 6 | "url": "https://ci.example.com/1000/output" 7 | } 8 | -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/statuses.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "State": "success", 4 | "Label": "drone", 5 | "Desc": "Build has completed successfully", 6 | "Target": "https://ci.example.com/1000/output", 7 | "Link": "https://api.bitbucket.org/2.0/repositories/atlassian/stash-example-plugin/commit/a6e5e7d797edf751cbd839d6bd4aef86c941eec9" 8 | } 9 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/tag.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "@atlaskit/activity@1.0.3", 3 | "Path": "refs/tags/@atlaskit/activity@1.0.3", 4 | "Sha": "ceb01356c3f062579bdfeb15bc53fe151b9e00f0" 5 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/tags.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "@atlaskit/activity@1.0.3", 4 | "Path": "refs/tags/@atlaskit/activity@1.0.3", 5 | "Sha": "ceb01356c3f062579bdfeb15bc53fe151b9e00f0" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/user.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Login": "brydzewski", 3 | "Name": "Brad Rydzewski", 4 | "Email": "", 5 | "Avatar": "https://bitbucket.org/account/brydzewski/avatar/32/" 6 | } -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/webhooks/push_branch_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "develop", 4 | "Sha": "141977fedf5cf35aa290ac87d4b5177ac4cd9de1" 5 | }, 6 | "Repo": { 7 | "ID": "{bc771cbf-829e-4c4b-b71f-a0eb3ac2b860}", 8 | "Namespace": "brydzewski", 9 | "Name": "foo", 10 | "FullName": "brydzewski/foo", 11 | "Perm": null, 12 | "Branch": "", 13 | "Private": true, 14 | "Clone": "https://bitbucket.org/brydzewski/foo.git", 15 | "CloneSSH": "git@bitbucket.org:brydzewski/foo.git", 16 | "Link": "https://bitbucket.org/brydzewski/foo", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "Login": "brydzewski", 23 | "Name": "Brad Rydzewski", 24 | "Email": "", 25 | "Avatar": "https://bitbucket.org/account/brydzewski/avatar/32/" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/webhooks/push_tag_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature/x", 4 | "Sha": "141977fedf5cf35aa290ac87d4b5177ac4cd9de1" 5 | }, 6 | "Repo": { 7 | "ID": "{bc771cbf-829e-4c4b-b71f-a0eb3ac2b860}", 8 | "Namespace": "brydzewski", 9 | "Name": "foo", 10 | "FullName": "brydzewski/foo", 11 | "Perm": null, 12 | "Branch": "", 13 | "Private": true, 14 | "Clone": "https://bitbucket.org/brydzewski/foo.git", 15 | "CloneSSH": "git@bitbucket.org:brydzewski/foo.git", 16 | "Link": "https://bitbucket.org/brydzewski/foo", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "Login": "brydzewski", 23 | "Name": "Brad Rydzewski", 24 | "Email": "", 25 | "Avatar": "https://bitbucket.org/account/brydzewski/avatar/32/" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/workspace.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atlassian", 3 | "type": "team", 4 | "display_name": "Atlassian", 5 | "uuid": "{02b941e3-cfaa-40f9-9a58-cec53e20bdc3}", 6 | "slug": "atlassian", 7 | "links": { 8 | "self": { 9 | "href": "https:\/\/api.bitbucket.org\/2.0\/teams\/atlassian" 10 | }, 11 | "html": { 12 | "href": "https:\/\/bitbucket.org\/atlassian\/" 13 | }, 14 | "avatar": { 15 | "href": "https:\/\/bitbucket.org\/workspaces\/atlassian\/avatar\/" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/workspace.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "atlassian", 3 | "Avatar": "https://bitbucket.org/workspaces/atlassian/avatar" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/bitbucket/testdata/workspaces.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "atlassian", 4 | "Avatar": "https://bitbucket.org/workspaces/atlassian/avatar" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /scm/driver/fake/testdata/myorg/myrepo/README.md: -------------------------------------------------------------------------------- 1 | root dir of a repo -------------------------------------------------------------------------------- /scm/driver/fake/testdata/myorg/myrepo/somedir/something.txt: -------------------------------------------------------------------------------- 1 | hello world -------------------------------------------------------------------------------- /scm/driver/fake/testdata/test_refs/myorg/myrepo/README.md: -------------------------------------------------------------------------------- 1 | To simulate a git service with different files in different refs create a folder for each ref -------------------------------------------------------------------------------- /scm/driver/fake/testdata/test_refs/myorg/myrepo/refs/master/something.txt: -------------------------------------------------------------------------------- 1 | main text -------------------------------------------------------------------------------- /scm/driver/fake/testdata/test_refs/myorg/myrepo/refs/mybranch/something.txt: -------------------------------------------------------------------------------- 1 | my changes on a branch -------------------------------------------------------------------------------- /scm/driver/fake/utils.go: -------------------------------------------------------------------------------- 1 | package fake 2 | 3 | func paginated(page, size, items int) (start, end int) { 4 | // handle the default value case for ListOptions. 5 | if page == 0 || size == 0 { 6 | start = 0 7 | end = items 8 | return 9 | } 10 | 11 | start = (page - 1) * size 12 | if start > items { 13 | start = items 14 | } 15 | end = start + size 16 | if end > items { 17 | end = items 18 | } 19 | return 20 | } 21 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/assign_issue.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"Bug found", 3 | "body":null, 4 | "ref":null, 5 | "assignee":null, 6 | "assignees":["a","b","string"], 7 | "milestone":null, 8 | "state":null, 9 | "due_date":null, 10 | "unset_due_date":null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "master", 3 | "commit": { 4 | "id": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a", 5 | "message": "update README\n", 6 | "author": { 7 | "name": "Jane Doe", 8 | "email": "jane.doe@mail.com", 9 | "username": "janedoe" 10 | }, 11 | "committer": { 12 | "name": "Jane Doe", 13 | "email": "jane.doe@mail.com", 14 | "username": "janedoe" 15 | }, 16 | "added": null, 17 | "removed": null, 18 | "modified": null, 19 | "timestamp": "2017-11-16T22:06:53Z" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "master", 3 | "Path": "refs/heads/master", 4 | "Sha": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a" 5 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/branches.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "master", 4 | "commit": { 5 | "id": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a", 6 | "message": "update README\n", 7 | "author": { 8 | "name": "Jane Doe", 9 | "email": "jane.doe@mail.com", 10 | "username": "janedoe" 11 | }, 12 | "committer": { 13 | "name": "Jane Doe", 14 | "email": "jane.doe@mail.com", 15 | "username": "janedoe" 16 | }, 17 | "added": null, 18 | "removed": null, 19 | "modified": null, 20 | "timestamp": "2017-11-16T22:06:53Z" 21 | } 22 | } 23 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/branches.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "master", 4 | "Path": "refs/heads/master", 5 | "Sha": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/close_issue.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"", 3 | "body":null, 4 | "ref":null, 5 | "assignee":null, 6 | "assignees":null, 7 | "milestone":null, 8 | "state":"closed", 9 | "due_date":null, 10 | "unset_due_date":null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/close_pr.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"", 3 | "body":"", 4 | "base": "", 5 | "assignee":"", 6 | "assignees": null, 7 | "labels": null, 8 | "milestone":0, 9 | "state":"closed", 10 | "due_date": null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 74, 3 | "user": { 4 | "id": 1, 5 | "login": "unknwon", 6 | "full_name": "无闻", 7 | "email": "u@gogs.io", 8 | "avatar_url": "http://localhost:3000/avatars/1" 9 | }, 10 | "body": "what?", 11 | "created_at": "2016-08-26T11:58:18-07:00", 12 | "updated_at": "2016-08-26T11:58:18-07:00" 13 | } 14 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/comment.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 74, 3 | "Body": "what?", 4 | "Author": { 5 | "ID": 1, 6 | "Login": "unknwon", 7 | "Name": "无闻", 8 | "Email": "u@gogs.io", 9 | "Avatar": "http://localhost:3000/avatars/1" 10 | }, 11 | "Created": "2016-08-26T11:58:18-07:00", 12 | "Updated": "2016-08-26T11:58:18-07:00" 13 | } 14 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/comments.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 74, 4 | "user": { 5 | "id": 1, 6 | "login": "unknwon", 7 | "full_name": "无闻", 8 | "email": "u@gogs.io", 9 | "avatar_url": "http://localhost:3000/avatars/1" 10 | }, 11 | "body": "what?", 12 | "created_at": "2016-08-26T11:58:18-07:00", 13 | "updated_at": "2016-08-26T11:58:18-07:00" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/comments.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 74, 4 | "Body": "what?", 5 | "Author": { 6 | "ID": 1, 7 | "Login": "unknwon", 8 | "Name": "无闻", 9 | "Email": "u@gogs.io", 10 | "Avatar": "http://localhost:3000/avatars/1" 11 | }, 12 | "Created": "2016-08-26T11:58:18-07:00", 13 | "Updated": "2016-08-26T11:58:18-07:00" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/commit.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "committer": { 3 | "name": "Lunny Xiao", 4 | "login": "lunny", 5 | "email": "xiaolunwen@gmail.com", 6 | "avatar": "https://secure.gravatar.com/avatar/271fc56bcea89c6f69ab0024b59b3f81?d=identicon" 7 | }, 8 | "link": "https://try.gitea.io/api/v1/repos/gitea/gitea/git/commits/c43399cad8766ee521b873a32c1652407c5a4630", 9 | "sha": "c43399cad8766ee521b873a32c1652407c5a4630", 10 | "message": "Fixes repo branch endpoint summary (#4893)" 11 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/commits.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "committer": { 4 | "name": "Lunny Xiao", 5 | "login": "lunny", 6 | "email": "xiaolunwen@gmail.com", 7 | "avatar": "https://secure.gravatar.com/avatar/271fc56bcea89c6f69ab0024b59b3f81?d=identicon" 8 | }, 9 | "link": "https://try.gitea.io/api/v1/repos/gitea/gitea/git/commits/c43399cad8766ee521b873a32c1652407c5a4630", 10 | "sha": "c43399cad8766ee521b873a32c1652407c5a4630", 11 | "message": "Fixes repo branch endpoint summary (#4893)" 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/content_create.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/content_list.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": ".gitignore", 4 | "Path": ".gitignore", 5 | "Type": "file", 6 | "Size": 1928, 7 | "Sha": "8d8863546a1b476ec51d4a9f150a031264d35eef", 8 | "Link": "https://try.gitea.io/go-gitea/gitea/raw/branch/master/.gitignore" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/hook.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 20, 3 | "type": "gogs", 4 | "config": { 5 | "content_type": "json", 6 | "url": "http://gogs.io" 7 | }, 8 | "events": [ 9 | "create", 10 | "push" 11 | ], 12 | "active": true, 13 | "updated_at": "2015-08-29T11:31:22.453572732+08:00", 14 | "created_at": "2015-08-29T11:31:22.453569275+08:00" 15 | } 16 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/hook.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "20", 3 | "Name": "", 4 | "Target": "http://gogs.io", 5 | "Events": [ 6 | "create", 7 | "push" 8 | ], 9 | "Active": true, 10 | "SkipVerify": false 11 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/hooks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 20, 4 | "type": "gogs", 5 | "config": { 6 | "content_type": "json", 7 | "url": "http://gogs.io" 8 | }, 9 | "events": [ 10 | "create", 11 | "push" 12 | ], 13 | "active": true, 14 | "updated_at": "2015-08-29T11:31:22.453572732+08:00", 15 | "created_at": "2015-08-29T11:31:22.453569275+08:00" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/hooks.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "20", 4 | "Name": "", 5 | "Target": "http://gogs.io", 6 | "Events": [ 7 | "create", 8 | "push" 9 | ], 10 | "Active": true, 11 | "SkipVerify": false 12 | } 13 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/issue.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Number": 1, 3 | "Title": "Bug found", 4 | "Body": "I'm having a problem with this.", 5 | "Link": "", 6 | "Labels": [ 7 | "string" 8 | ], 9 | "Assignees": [ 10 | { 11 | "Login": "string", 12 | "Name": "string", 13 | "Email": "user@example.com", 14 | "Avatar": "string", 15 | "isAdmin": true 16 | } 17 | ], 18 | "Closed": false, 19 | "Locked": false, 20 | "Author": { 21 | "ID": 1, 22 | "Login": "janedoe", 23 | "Name": "", 24 | "Email": "janedoe@mail.com", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | }, 27 | "Created": "2017-09-23T19:24:01Z", 28 | "Updated": "2017-09-23T19:24:01Z" 29 | } 30 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/issue_clear_milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"", 3 | "body":null, 4 | "ref":null, 5 | "assignee":null, 6 | "assignees":null, 7 | "milestone":null, 8 | "state":null, 9 | "due_date":null, 10 | "unset_due_date":null 11 | } 12 | 13 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/issue_labels.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "color": "00aabb", 4 | "description": "string", 5 | "id": 0, 6 | "name": "string", 7 | "url": "string" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/issue_labels.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "color": "00aabb", 4 | "description": "string", 5 | "id": 0, 6 | "name": "string", 7 | "url": "string" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/issue_set_milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"", 3 | "body":null, 4 | "ref":null, 5 | "assignee":null, 6 | "assignees":null, 7 | "milestone":1, 8 | "state":null, 9 | "due_date":null, 10 | "unset_due_date":null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/issues.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "number": 1, 5 | "user": { 6 | "id": 1, 7 | "login": "janedoe", 8 | "full_name": "", 9 | "email": "janedoe@mail.com", 10 | "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87", 11 | "username": "janedoe" 12 | }, 13 | "title": "Bug found", 14 | "body": "I'm having a problem with this.", 15 | "labels": [ 16 | { 17 | "color": "00aabb", 18 | "description": "string", 19 | "id": 0, 20 | "name": "string", 21 | "url": "string" 22 | } 23 | ], 24 | "milestone": null, 25 | "assignee": null, 26 | "state": "open", 27 | "comments": 0, 28 | "created_at": "2017-09-23T19:24:01Z", 29 | "updated_at": "2017-09-23T19:24:01Z", 30 | "pull_request": null 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/issues.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Number": 1, 4 | "Title": "Bug found", 5 | "Body": "I'm having a problem with this.", 6 | "Link": "", 7 | "Labels": [ 8 | "string" 9 | ], 10 | "Closed": false, 11 | "Locked": false, 12 | "Author": { 13 | "ID": 1, 14 | "Login": "janedoe", 15 | "Name": "", 16 | "Email": "janedoe@mail.com", 17 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 18 | }, 19 | "Created": "2017-09-23T19:24:01Z", 20 | "Updated": "2017-09-23T19:24:01Z" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "closed_at": "2020-09-11T19:32:38.046Z", 3 | "closed_issues": 0, 4 | "created_at": "2020-09-11T19:32:38.046Z", 5 | "description": "string", 6 | "due_on": "2020-09-11T19:32:38.046Z", 7 | "id": 1, 8 | "open_issues": 0, 9 | "state": "open", 10 | "title": "string", 11 | "updated_at": "2020-09-11T19:32:38.046Z" 12 | } 13 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/milestone.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Description": "string", 3 | "DueDate": "2020-09-11T19:32:38.046Z", 4 | "ID": 1, 5 | "Number": 1, 6 | "State": "open", 7 | "Title": "string" 8 | } 9 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/milestone_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "v1.0", 3 | "description": "Tracking milestone for version 1.0", 4 | "state": "open", 5 | "due_on": "2012-10-09T23:39:01Z" 6 | } 7 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/milestones.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "closed_at": "2020-09-11T19:32:38.046Z", 4 | "closed_issues": 0, 5 | "created_at": "2020-09-11T19:32:38.046Z", 6 | "description": "string", 7 | "due_on": "2020-09-11T19:32:38.046Z", 8 | "id": 1, 9 | "open_issues": 0, 10 | "state": "open", 11 | "title": "string", 12 | "updated_at": "2020-09-11T19:32:38.046Z" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/milestones.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Description": "string", 4 | "DueDate": "2020-09-11T19:32:38.046Z", 5 | "ID": 1, 6 | "Number": 1, 7 | "State": "open", 8 | "Title": "string" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/organization.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "username": "gogits", 4 | "full_name": "gogits", 5 | "avatar_url": "http://gogits.io/avatars/1", 6 | "description": "", 7 | "website": "", 8 | "location": "" 9 | } 10 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/organization.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "gogits", 3 | "Avatar": "http://gogits.io/avatars/1" 4 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/organizations.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "username": "gogits", 5 | "full_name": "gogits", 6 | "avatar_url": "http://gogits.io/avatars/1", 7 | "description": "", 8 | "website": "", 9 | "location": "" 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/organizations.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "gogits", 4 | "Avatar": "http://gogits.io/avatars/1" 5 | } 6 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/pr_changes.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "README", 4 | "Added": true, 5 | "Additions": 1 6 | }, 7 | { 8 | "Path": "script.sh", 9 | "PreviousPath": "script.sh", 10 | "Additions": 1, 11 | "Deletions": 1 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/pr_changes.patch: -------------------------------------------------------------------------------- 1 | From 3c716f1eb086c9039745e3cadf873c9cbbb481e5 Mon Sep 17 00:00:00 2001 2 | From: jenkins-x-bot 3 | Date: Fri, 4 Sep 2020 15:16:56 +0000 4 | Subject: [PATCH] Adding for test PR 5 | 6 | --- 7 | README | 1 + 8 | script.sh | 2 +- 9 | 2 files changed, 2 insertions(+), 1 deletion(-) 10 | create mode 100644 README 11 | 12 | diff --git a/README b/README 13 | new file mode 100644 14 | index 0000000..70c379b 15 | --- /dev/null 16 | +++ b/README 17 | @@ -0,0 +1 @@ 18 | +Hello world 19 | \ No newline at end of file 20 | diff --git a/script.sh b/script.sh 21 | index 4915bcb..2c42f17 100644 22 | --- a/script.sh 23 | +++ b/script.sh 24 | @@ -1,3 +1,3 @@ 25 | #!/bin/bash 26 | 27 | -echo "This passes" 28 | +echo "This has changed but still passes" 29 | -- 30 | 2.24.3 31 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/pr_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Add License File", 3 | "body": "Using a BSD License", 4 | "base": "master", 5 | "head": "feature", 6 | "assignee":"", 7 | "assignees": null, 8 | "labels": null, 9 | "milestone":0, 10 | "due_date": null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/release.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "name": "v1.0.0", 4 | "body": "Description of the release", 5 | "url": "https://try.gitea.com/api/v1/repos/octocat/Hello-World/123", 6 | "tag_name": "v1.0.0", 7 | "target_commitish": "master", 8 | "draft": false, 9 | "prerelease": false 10 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/release.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Title": "v1.0.0", 4 | "Description": "Description of the release", 5 | "Link": "https://try.gitea.com/octocat/Hello-World/releases/tag/v1.0.0", 6 | "Tag": "v1.0.0", 7 | "Commitish": "master", 8 | "Draft": false, 9 | "Prerelease": false 10 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/release_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "tag_name": "v1.0.0", 3 | "target_commitish": "master", 4 | "name": "v1.0.0", 5 | "body": "Description of the release", 6 | "draft": false, 7 | "prerelease": false 8 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/release_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "tag_name": "v1.0.0", 3 | "target_commitish": "master", 4 | "name": "v1.0.0", 5 | "body": "Description of the release", 6 | "draft": false, 7 | "prerelease": false 8 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/releases.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "v1.0.0", 5 | "body": "Description of the release", 6 | "url": "https://try.gitea.com/api/v1/repos/octocat/Hello-World/123", 7 | "tag_name": "v1.0.0", 8 | "target_commitish": "master", 9 | "draft": false, 10 | "prerelease": false 11 | } 12 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/releases.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Title": "v1.0.0", 5 | "Description": "Description of the release", 6 | "Link": "https://try.gitea.com/octocat/Hello-World/releases/tag/v1.0.0", 7 | "Tag": "v1.0.0", 8 | "Commitish": "master", 9 | "Draft": false, 10 | "Prerelease": false 11 | } 12 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/reopen_issue.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"", 3 | "body":null, 4 | "ref":null, 5 | "assignee":null, 6 | "assignees":null, 7 | "milestone":null, 8 | "state":"open", 9 | "due_date":null, 10 | "unset_due_date":null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/reopen_pr.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"", 3 | "body":"", 4 | "base": "", 5 | "assignee":"", 6 | "assignees": null, 7 | "labels": null, 8 | "milestone":0, 9 | "state":"open", 10 | "due_date": null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/repo.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "owner": { 4 | "id": 1, 5 | "login": "go-gitea", 6 | "full_name": "go-gitea", 7 | "email": "", 8 | "avatar_url": "http://gogs.io/avatars/1", 9 | "username": "go-gitea" 10 | }, 11 | "name": "gitea", 12 | "full_name": "go-gitea/gitea", 13 | "description": "", 14 | "private": true, 15 | "fork": false, 16 | "parent": null, 17 | "empty": false, 18 | "mirror": false, 19 | "size": 4485120, 20 | "html_url": "https://try.gitea.io/go-gitea/gitea", 21 | "ssh_url": "git@try.gitea.io:go-gitea/gitea.git", 22 | "clone_url": "https://try.gitea.io/go-gitea/gitea.git", 23 | "website": "", 24 | "stars_count": 0, 25 | "forks_count": 0, 26 | "watchers_count": 2, 27 | "open_issues_count": 0, 28 | "default_branch": "master", 29 | "created_at": "2017-10-22T18:25:33Z", 30 | "updated_at": "2017-11-16T22:07:01Z", 31 | "permissions": { 32 | "admin": true, 33 | "push": true, 34 | "pull": true 35 | } 36 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "Namespace": "go-gitea", 4 | "Name": "gitea", 5 | "FullName": "go-gitea/gitea", 6 | "Perm": { 7 | "Pull": true, 8 | "Push": true, 9 | "Admin": true 10 | }, 11 | "Branch": "master", 12 | "Private": true, 13 | "Clone": "https://try.gitea.io/go-gitea/gitea.git", 14 | "CloneSSH": "git@try.gitea.io:go-gitea/gitea.git", 15 | "Link": "https://try.gitea.io/go-gitea/gitea", 16 | "Created": "2017-10-22T18:25:33Z", 17 | "Updated": "2017-11-16T22:07:01Z" 18 | } 19 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/repos.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1", 4 | "Namespace": "go-gitea", 5 | "Name": "gitea", 6 | "FullName": "go-gitea/gitea", 7 | "Perm": { 8 | "Pull": true, 9 | "Push": true, 10 | "Admin": true 11 | }, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "https://try.gitea.io/go-gitea/gitea.git", 15 | "CloneSSH": "git@try.gitea.io:go-gitea/gitea.git", 16 | "Link": "https://try.gitea.io/go-gitea/gitea", 17 | "Created": "2017-10-22T18:25:33Z", 18 | "Updated": "2017-11-16T22:07:01Z" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/review.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "This is a review", 3 | "comments_count": 0, 4 | "commit_id": "5c23b301e7eb47aa83de90cf08e0a75b4c0906c8", 5 | "html_url": "https://try.gitea.io/jcitizen/my-repo/pulls/1/reviews/1", 6 | "id": 1, 7 | "official": true, 8 | "pull_request_url": "https://try.gitea.io/jcitizen/my-repo/pulls/1", 9 | "stale": false, 10 | "state": "PENDING", 11 | "submitted_at": "2020-09-07T16:19:57.863Z", 12 | "user": { 13 | "id": 6641, 14 | "login": "jcitizen", 15 | "full_name": "", 16 | "email": "jcitizen@example.com", 17 | "avatar_url": "https://secure.gravatar.com/avatar/66f07ff48e6a9cb393de7a34e03bb52a?d=identicon", 18 | "language": "en-US" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/review.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Body": "This is a review", 3 | "Sha": "5c23b301e7eb47aa83de90cf08e0a75b4c0906c8", 4 | "Link": "https://try.gitea.io/jcitizen/my-repo/pulls/1/reviews/1", 5 | "ID": 1, 6 | "State": "PENDING", 7 | "Created": "2020-09-07T16:19:57.863Z", 8 | "Author": { 9 | "ID": 6641, 10 | "Login": "jcitizen", 11 | "Email": "jcitizen@example.com", 12 | "Avatar": "https://secure.gravatar.com/avatar/66f07ff48e6a9cb393de7a34e03bb52a?d=identicon" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/review_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "This is a review", 3 | "comments": [ 4 | { 5 | "body": "some comment", 6 | "new_position": 10, 7 | "old_position": 0, 8 | "path": "some/file" 9 | } 10 | ], 11 | "commit_id": "5c23b301e7eb47aa83de90cf08e0a75b4c0906c8", 12 | "event": "PENDING" 13 | } 14 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/reviews.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "body": "This is a review", 4 | "comments_count": 0, 5 | "commit_id": "5c23b301e7eb47aa83de90cf08e0a75b4c0906c8", 6 | "html_url": "https://try.gitea.io/jcitizen/my-repo/pulls/1/reviews/1", 7 | "id": 1, 8 | "official": true, 9 | "pull_request_url": "https://try.gitea.io/jcitizen/my-repo/pulls/1", 10 | "stale": false, 11 | "state": "PENDING", 12 | "submitted_at": "2020-09-07T16:19:57.863Z", 13 | "user": { 14 | "id": 6641, 15 | "login": "jcitizen", 16 | "full_name": "", 17 | "email": "jcitizen@example.com", 18 | "avatar_url": "https://secure.gravatar.com/avatar/66f07ff48e6a9cb393de7a34e03bb52a?d=identicon", 19 | "language": "en-US" 20 | } 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/reviews.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Body": "This is a review", 4 | "Sha": "5c23b301e7eb47aa83de90cf08e0a75b4c0906c8", 5 | "Link": "https://try.gitea.io/jcitizen/my-repo/pulls/1/reviews/1", 6 | "ID": 1, 7 | "State": "PENDING", 8 | "Created": "2020-09-07T16:19:57.863Z", 9 | "Author": { 10 | "ID": 6641, 11 | "Login": "jcitizen", 12 | "Email": "jcitizen@example.com", 13 | "Avatar": "https://secure.gravatar.com/avatar/66f07ff48e6a9cb393de7a34e03bb52a?d=identicon" 14 | } 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/status.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "status": "success", 4 | "target_url": "https://example.com", 5 | "description": "", 6 | "url": "https://try.gitea.io/api/v1/jcitizen/my-repo/statuses/f026eb4eb1d83a7149e52058bf2134f4360d9bc4", 7 | "context": "continuous-integration/drone", 8 | "creator": { 9 | "id": 6641, 10 | "login": "jcitizen", 11 | "full_name": "", 12 | "email": "jane@example.com", 13 | "avatar_url": "https://secure.gravatar.com/avatar/66f07ff48e6a9cb393de7a34e03bb52a?d=identicon", 14 | "language": "en-US", 15 | "username": "jcitizen" 16 | }, 17 | "created_at": "2018-07-06T02:03:38Z", 18 | "updated_at": "2018-07-06T02:03:38Z" 19 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "State": "success", 3 | "Label": "continuous-integration/drone", 4 | "Desc": "", 5 | "Target": "https://example.com" 6 | } -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/statuses.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "status": "success", 5 | "target_url": "https://example.com", 6 | "description": "", 7 | "url": "https://try.gitea.io/api/v1/jcitizen/my-repo/statuses/f026eb4eb1d83a7149e52058bf2134f4360d9bc4", 8 | "context": "continuous-integration/drone", 9 | "creator": { 10 | "id": 6641, 11 | "login": "jcitizen", 12 | "full_name": "", 13 | "email": "jane@example.com", 14 | "avatar_url": "https://secure.gravatar.com/avatar/66f07ff48e6a9cb393de7a34e03bb52a?d=identicon", 15 | "language": "en-US", 16 | "username": "jcitizen" 17 | }, 18 | "created_at": "2018-07-06T02:03:38Z", 19 | "updated_at": "2018-07-06T02:03:38Z" 20 | } 21 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/statuses.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "State": "success", 4 | "Label": "continuous-integration/drone", 5 | "Desc": "", 6 | "Target": "https://example.com" 7 | } 8 | ] -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/tags.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "commit": { 4 | "sha": "c43399cad8766ee521b873a32c1652407c5a4630", 5 | "url": "string" 6 | }, 7 | "id": "c43399cad8766ee521b873a32c1652407c5a4630", 8 | "name": "some-tag", 9 | "tarball_url": "string", 10 | "zipball_url": "string" 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/tags.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "some-tag", 4 | "Path": "refs/tags/some-tag", 5 | "Sha": "c43399cad8766ee521b873a32c1652407c5a4630" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/unassign_issue.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"Bug found", 3 | "body":null, 4 | "ref":null, 5 | "assignee":null, 6 | "assignees":[], 7 | "milestone":null, 8 | "state":null, 9 | "due_date":null, 10 | "unset_due_date":null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "login": "jcitizen", 4 | "full_name": "Jane Citizen", 5 | "email": "jane@example.com", 6 | "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87", 7 | "language": "en-US", 8 | "username": "jcitizen" 9 | } 10 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/user.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Login": "jcitizen", 4 | "Name": "Jane Citizen", 5 | "Email": "jane@example.com", 6 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 7 | } 8 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.12.4" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/webhooks/branch_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Branch": "master", 12 | "Private": true, 13 | "Clone": "http://try.gitea.io/gogits/hello-world.git", 14 | "CloneSSH": "git@localhost:gogits/hello-world.git", 15 | "Link": "http://try.gitea.io/gogits/hello-world", 16 | "Created": "2017-12-09T01:30:43Z", 17 | "Updated": "2017-12-09T01:33:46Z" 18 | }, 19 | "Action": "created", 20 | "Sender": { 21 | "ID": 1, 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/webhooks/branch_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Branch": "master", 12 | "Private": true, 13 | "Clone": "http://try.gitea.io/gogits/hello-world.git", 14 | "CloneSSH": "git@localhost:gogits/hello-world.git", 15 | "Link": "http://try.gitea.io/gogits/hello-world", 16 | "Created": "2017-12-09T01:30:43Z", 17 | "Updated": "2017-12-09T01:37:02Z" 18 | }, 19 | "Action": "deleted", 20 | "Sender": { 21 | "ID": 1, 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/webhooks/tag_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v1.0.0", 4 | "Sha": "599d25c67b05717269f50ac082b34f176d085179" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Branch": "master", 12 | "Private": true, 13 | "Clone": "http://try.gitea.io/gogits/hello-world.git", 14 | "CloneSSH": "git@localhost:gogits/hello-world.git", 15 | "Link": "http://try.gitea.io/gogits/hello-world", 16 | "Created": "2017-12-09T01:30:43Z", 17 | "Updated": "2017-12-09T01:38:03Z" 18 | }, 19 | "Action": "created", 20 | "Sender": { 21 | "ID": 1, 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gitea/testdata/webhooks/tag_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v1.0.0", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Branch": "master", 12 | "Private": true, 13 | "Clone": "http://try.gitea.io/gogits/hello-world.git", 14 | "CloneSSH": "git@localhost:gogits/hello-world.git", 15 | "Link": "http://try.gitea.io/gogits/hello-world", 16 | "Created": "2017-12-09T01:30:43Z", 17 | "Updated": "2017-12-09T01:38:47Z" 18 | }, 19 | "Action": "deleted", 20 | "Sender": { 21 | "ID": 1, 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/github/integration/integration.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package integration 6 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/app_repo_install.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "AppID": 1, 4 | "TargetID": 1, 5 | "TargetType": "Organization", 6 | "RepositorySelection": "all", 7 | "Account": { 8 | "ID": 1, 9 | "Login": "github", 10 | "Link": "https://github.com/github" 11 | }, 12 | "AccessTokensLink": "https://api.github.com/installations/1/access_tokens", 13 | "RepositoriesURL": "https://api.github.com/installation/repositories", 14 | "Link": "https://github.com/organizations/github/settings/installations/1", 15 | "Events": [ 16 | "push", 17 | "pull_request" 18 | ], 19 | "CreatedAt": "2018-02-09T20:51:14Z", 20 | "UpdatedAt": "2018-02-09T20:51:14Z" 21 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "master", 3 | "Path": "refs/heads/master", 4 | "Sha": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d" 5 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/branches.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "master", 4 | "commit": { 5 | "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", 6 | "url": "https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc" 7 | }, 8 | "protected": true, 9 | "protection_url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection" 10 | } 11 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/branches.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "master", 4 | "Path": "refs/heads/master", 5 | "Sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/changes.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "file1.txt", 4 | "Added": true, 5 | "Renamed": false, 6 | "Deleted": false, 7 | "Additions": 103, 8 | "Deletions": 21, 9 | "Changes": 124, 10 | "Tree": { 11 | "Sha": "b4eecafa9be2f2006ce1b709d6857b07069b4608", 12 | "Link": "https://api.github.com/repos/octocat/Hello-World/git/trees/b4eecafa9be2f2006ce1b709d6857b07069b4608" 13 | }, 14 | "BlobURL": "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt", 15 | "Sha": "bbcd538c8e72b8c175046e27cc8f907076331401", 16 | "Patch": "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/close.json: -------------------------------------------------------------------------------- 1 | { 2 | "state": "closed" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/combined_status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "State": "success", 3 | "Sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", 4 | "Statuses": [ 5 | { 6 | "State": "success", 7 | "Label": "continuous-integration/jenkins", 8 | "Desc": "Build has completed successfully", 9 | "Target": "https://ci.example.com/1000/output", 10 | "Link": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" 11 | }, 12 | { 13 | "State": "success", 14 | "Label": "security/brakeman", 15 | "Desc": "Testing has completed successfully", 16 | "Target": "https://ci.example.com/2000/output", 17 | "Link": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/content.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Path": "README", 3 | "Data": "SGVsbG8gV29ybGQhCg==", 4 | "Sha": "980a0d5f19a64b4b30a87d4206aade58726b60e3" 5 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/content_list.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "octokit.rb", 4 | "Path": "lib/octokit.rb", 5 | "Type": "file", 6 | "Size": 625, 7 | "Sha": "fff6fe3a23bf1c8ea0692b4a883af99bee26fd3b", 8 | "Link": "https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit.rb" 9 | }, 10 | { 11 | "Name": "octokit", 12 | "Path": "lib/octokit", 13 | "Type": "dir", 14 | "Size": 0, 15 | "Sha": "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d", 16 | "Link": "https://api.github.com/repos/octokit/octokit.rb/contents/lib/octokit" 17 | } 18 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/delete_reviewers.json: -------------------------------------------------------------------------------- 1 | { 2 | "reviewers": [ 3 | "octocat", 4 | "hubot", 5 | "other_user" 6 | ], 7 | "team_reviewers": [ 8 | "justice-league" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/deploy_status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "State": "success", 4 | "Author": { 5 | "ID": 1, 6 | "Login": "octocat", 7 | "Name": "", 8 | "Email": "", 9 | "Avatar": "https://github.com/images/error/octocat_happy.gif", 10 | "Link": "https://github.com/octocat", 11 | "Created": "0001-01-01T00:00:00Z", 12 | "Updated": "0001-01-01T00:00:00Z" 13 | }, 14 | "Description": "Deployment finished successfully.", 15 | "Environment": "production", 16 | "DeploymentLink": "https://api.github.com/repos/octocat/example/deployments/42", 17 | "EnvironmentLink": "", 18 | "LogLink": "https://example.com/deployment/42/output", 19 | "RepositoryLink": "https://api.github.com/repos/octocat/example", 20 | "TargetLink": "https://example.com/deployment/42/output", 21 | "Created": "2012-07-20T01:19:13Z", 22 | "Updated": "2012-07-20T01:19:13Z" 23 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/deploy_status_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "State": "success", 4 | "Author": { 5 | "ID": 1, 6 | "Login": "octocat", 7 | "Name": "", 8 | "Email": "", 9 | "Avatar": "https://github.com/images/error/octocat_happy.gif", 10 | "Link": "https://github.com/octocat", 11 | "Created": "0001-01-01T00:00:00Z", 12 | "Updated": "0001-01-01T00:00:00Z" 13 | }, 14 | "Description": "Deployment finished successfully.", 15 | "Environment": "production", 16 | "DeploymentLink": "https://api.github.com/repos/octocat/example/deployments/42", 17 | "EnvironmentLink": "", 18 | "LogLink": "https://example.com/deployment/42/output", 19 | "RepositoryLink": "https://api.github.com/repos/octocat/example", 20 | "TargetLink": "https://example.com/deployment/42/output", 21 | "Created": "2012-07-20T01:19:13Z", 22 | "Updated": "2012-07-20T01:19:13Z" 23 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/deploy_statuses.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1", 4 | "State": "success", 5 | "Author": { 6 | "ID": 1, 7 | "Login": "octocat", 8 | "Name": "", 9 | "Email": "", 10 | "Avatar": "https://github.com/images/error/octocat_happy.gif", 11 | "Link": "https://github.com/octocat", 12 | "Created": "0001-01-01T00:00:00Z", 13 | "Updated": "0001-01-01T00:00:00Z" 14 | }, 15 | "Description": "Deployment finished successfully.", 16 | "Environment": "production", 17 | "DeploymentLink": "https://api.github.com/repos/octocat/example/deployments/42", 18 | "EnvironmentLink": "", 19 | "LogLink": "https://example.com/deployment/42/output", 20 | "RepositoryLink": "https://api.github.com/repos/octocat/example", 21 | "TargetLink": "https://example.com/deployment/42/output", 22 | "Created": "2012-07-20T01:19:13Z", 23 | "Updated": "2012-07-20T01:19:13Z" 24 | } 25 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/edit_issue_comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "what?" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Not Found", 3 | "documentation_url": "https://developer.github.com/v3" 4 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/hook.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "url": "https://api.github.com/repos/octocat/Hello-World/hooks/1", 4 | "test_url": "https://api.github.com/repos/octocat/Hello-World/hooks/1/test", 5 | "ping_url": "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings", 6 | "name": "web", 7 | "events": [ 8 | "push", 9 | "pull_request" 10 | ], 11 | "active": true, 12 | "config": { 13 | "url": "http://example.com/webhook", 14 | "content_type": "json", 15 | "insecure_ssl": "1" 16 | }, 17 | "updated_at": "2011-09-06T20:39:23Z", 18 | "created_at": "2011-09-06T17:26:27Z" 19 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/hook.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "Name": "", 4 | "Target": "http://example.com/webhook", 5 | "Events": [ 6 | "push", 7 | "pull_request" 8 | ], 9 | "Active": true, 10 | "SkipVerify": true 11 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/hooks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "url": "https://api.github.com/repos/octocat/Hello-World/hooks/1", 5 | "test_url": "https://api.github.com/repos/octocat/Hello-World/hooks/1/test", 6 | "ping_url": "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings", 7 | "name": "web", 8 | "events": [ 9 | "push", 10 | "pull_request" 11 | ], 12 | "active": true, 13 | "config": { 14 | "url": "http://example.com/webhook", 15 | "content_type": "json" 16 | }, 17 | "updated_at": "2011-09-06T20:39:23Z", 18 | "created_at": "2011-09-06T17:26:27Z" 19 | } 20 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/hooks.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1", 4 | "Name": "", 5 | "Target": "http://example.com/webhook", 6 | "Events": [ 7 | "push", 8 | "pull_request" 9 | ], 10 | "Active": true, 11 | "SkipVerify": false 12 | } 13 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/issue_clear_milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "milestone": null 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/issue_comment.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Body": "Me too", 4 | "Author": { 5 | "Login": "octocat", 6 | "Name": "", 7 | "Email": "", 8 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 9 | }, 10 | "Link": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1", 11 | "Created": "2011-04-14T16:00:49Z", 12 | "Updated": "2011-04-14T16:00:49Z" 13 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/issue_comments.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Body": "Me too", 5 | "Author": { 6 | "Login": "octocat", 7 | "Name": "", 8 | "Email": "", 9 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 10 | }, 11 | "Link": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1", 12 | "Created": "2011-04-14T16:00:49Z", 13 | "Updated": "2011-04-14T16:00:49Z" 14 | } 15 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/issue_set_milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "milestone": 1 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/list_invitations.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Repo": { 5 | "ID": "1296269", 6 | "Namespace": "octocat", 7 | "Name": "Hello-World", 8 | "FullName": "octocat/Hello-World", 9 | "CloneSSH": "git@github.com:octocat/Hello-World.git", 10 | "Link": "https://github.com/octocat/Hello-World", 11 | "Perm": {} 12 | }, 13 | "Invitee": { 14 | "ID": 1, 15 | "Login": "octocat", 16 | "Avatar": "https://github.com/images/error/octocat_happy.gif", 17 | "Link": "https://github.com/octocat" 18 | }, 19 | "Inviter": { 20 | "ID": 1, 21 | "Login": "octocat", 22 | "Avatar": "https://github.com/images/error/octocat_happy.gif", 23 | "Link": "https://github.com/octocat" 24 | }, 25 | "Permissions": "write", 26 | "Link": "https://api.github.com/user/repository_invitations/1296269", 27 | "Created": "2016-06-13T14:52:50-05:00" 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/milestone.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Link": "https://github.com/octocat/Hello-World/milestones/v1.0", 3 | "ID": 1002604, 4 | "Number": 1, 5 | "State": "open", 6 | "Title": "v1.0", 7 | "Description": "Tracking milestone for version 1.0", 8 | "DueDate": "2012-10-09T23:39:01Z" 9 | } 10 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/milestone_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "state": "open", 3 | "title": "v1.0", 4 | "description": "Tracking milestone for version 1.0", 5 | "due_on": "2012-10-09T23:39:01Z" 6 | } 7 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/milestones.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Link": "https://github.com/octocat/Hello-World/milestones/v1.0", 4 | "ID": 1002604, 5 | "Number": 1, 6 | "State": "open", 7 | "Title": "v1.0", 8 | "Description": "Tracking milestone for version 1.0", 9 | "DueDate": "2012-10-09T23:39:01Z" 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/org.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Name": "github", 4 | "Avatar": "https://github.com/images/error/octocat_happy.gif", 5 | "Permissions": { 6 | "MembersCreatePrivate": true, 7 | "MembersCreatePublic": true, 8 | "MembersCreateInternal": true 9 | } 10 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/org_members.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Login": "octocat" 4 | } 5 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/orgs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "login": "github", 4 | "id": 1, 5 | "url": "https://api.github.com/orgs/github", 6 | "repos_url": "https://api.github.com/orgs/github/repos", 7 | "events_url": "https://api.github.com/orgs/github/events", 8 | "hooks_url": "https://api.github.com/orgs/github/hooks", 9 | "issues_url": "https://api.github.com/orgs/github/issues", 10 | "members_url": "https://api.github.com/orgs/github/members{/member}", 11 | "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", 12 | "avatar_url": "https://github.com/images/error/octocat_happy.gif", 13 | "description": "A great organization" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/orgs.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Name": "github", 5 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/pr_comment.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 10, 3 | "Body": "Great stuff", 4 | "Path": "file1.txt", 5 | "Sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", 6 | "Line": 1, 7 | "Link": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1", 8 | "Author": { 9 | "Login": "octocat", 10 | "Name": "", 11 | "Email": "", 12 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 13 | }, 14 | "Created": "2011-04-14T16:00:49Z", 15 | "Updated": "2011-04-14T16:00:49Z" 16 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/pr_comments.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 10, 4 | "Body": "Great stuff", 5 | "Path": "file1.txt", 6 | "Sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", 7 | "Line": 1, 8 | "Link": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1", 9 | "Author": { 10 | "Login": "octocat", 11 | "Name": "", 12 | "Email": "", 13 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 14 | }, 15 | "Created": "2011-04-14T16:00:49Z", 16 | "Updated": "2011-04-14T16:00:49Z" 17 | } 18 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/pr_files.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "sha": "bbcd538c8e72b8c175046e27cc8f907076331401", 4 | "filename": "file1.txt", 5 | "status": "added", 6 | "additions": 103, 7 | "deletions": 21, 8 | "changes": 124, 9 | "blob_url": "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt", 10 | "raw_url": "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt", 11 | "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e", 12 | "patch": "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" 13 | } 14 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/pr_files.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "file1.txt", 4 | "Added": true, 5 | "Renamed": false, 6 | "Deleted": false, 7 | "Additions": 103, 8 | "Deletions": 21, 9 | "Changes": 124, 10 | "Tree": { 11 | "Sha": "b4eecafa9be2f2006ce1b709d6857b07069b4608", 12 | "Link": "https://api.github.com/repos/octocat/Hello-World/git/trees/b4eecafa9be2f2006ce1b709d6857b07069b4608" 13 | }, 14 | "BlobURL": "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt", 15 | "Sha": "bbcd538c8e72b8c175046e27cc8f907076331401", 16 | "Patch": "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/pr_merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "merge_method": "rebase" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/pr_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "A new title", 3 | "body": "A new description" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "refs/heads/featureA", 3 | "node_id": "MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlQQ==", 4 | "url": "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/featureA", 5 | "object": { 6 | "type": "commit", 7 | "sha": "aa218f56b14c9653891f9e74264a383fa43fefbd", 8 | "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/ref.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "refs/heads/featureA", 3 | "Path": "refs/heads/featureA", 4 | "Sha": "aa218f56b14c9653891f9e74264a383fa43fefbd" 5 | } 6 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/release.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Title": "v1.0.0", 4 | "Description": "Description of the release", 5 | "Link": "https://github.com/octocat/Hello-World/releases/v1.0.0", 6 | "Tag": "v1.0.0", 7 | "Commitish": "master", 8 | "Draft": false, 9 | "Prerelease": false, 10 | "Created": "2013-02-27T19:35:32Z", 11 | "Published": "2013-02-27T19:35:32Z" 12 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/releases.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Title": "v1.0.0", 5 | "Description": "Description of the release", 6 | "Link": "https://github.com/octocat/Hello-World/releases/v1.0.0", 7 | "Tag": "v1.0.0", 8 | "Commitish": "master", 9 | "Draft": false, 10 | "Prerelease": false, 11 | "Created": "2013-02-27T19:35:32Z", 12 | "Published": "2013-02-27T19:35:32Z" 13 | } 14 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/reopen.json: -------------------------------------------------------------------------------- 1 | { 2 | "state": "open" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1296269", 3 | "Namespace": "octocat", 4 | "Name": "Hello-World", 5 | "FullName": "octocat/Hello-World", 6 | "Perm": { 7 | "Pull": true, 8 | "Push": true, 9 | "Admin": true 10 | }, 11 | "Branch": "master", 12 | "Private": true, 13 | "Clone": "https://github.com/octocat/Hello-World.git", 14 | "CloneSSH": "git@github.com:octocat/Hello-World.git", 15 | "Link": "https://github.com/octocat/Hello-World", 16 | "Created": "2011-01-26T19:01:12Z", 17 | "Updated": "2011-01-26T19:14:43Z" 18 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/repo_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1296269", 3 | "Namespace": "octocat", 4 | "Name": "Hello-World", 5 | "FullName": "octocat/Hello-World", 6 | "Perm": { 7 | "Pull": true, 8 | "Push": false, 9 | "Admin": false 10 | }, 11 | "Branch": "master", 12 | "Private": false, 13 | "Clone": "https://github.com/octocat/Hello-World.git", 14 | "CloneSSH": "git@github.com:octocat/Hello-World.git", 15 | "Link": "https://github.com/octocat/Hello-World", 16 | "Created": "2011-01-26T19:01:12Z", 17 | "Updated": "2011-01-26T19:14:43Z" 18 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/repo_fork_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "organization": "octocat" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/repos.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1296269", 4 | "Namespace": "octocat", 5 | "Name": "Hello-World", 6 | "FullName": "octocat/Hello-World", 7 | "Perm": { 8 | "Pull": true, 9 | "Push": true, 10 | "Admin": true 11 | }, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "https://github.com/octocat/Hello-World.git", 15 | "CloneSSH": "git@github.com:octocat/Hello-World.git", 16 | "Link": "https://github.com/octocat/Hello-World", 17 | "Created": "2011-01-26T19:01:12Z", 18 | "Updated": "2011-01-26T19:14:43Z" 19 | } 20 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/request_reviewers.json: -------------------------------------------------------------------------------- 1 | { 2 | "reviewers": [ 3 | "octocat", 4 | "hubot", 5 | "other_user" 6 | ], 7 | "team_reviewers": [ 8 | "justice-league" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/reviews_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "commit_id": "ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091", 3 | "body": "This is close to perfect! Please address the suggested inline change.", 4 | "event": "REQUEST_CHANGES", 5 | "comments": [ 6 | { 7 | "path": "file.md", 8 | "position": 6, 9 | "body": "Please add more information here, and fix this typo." 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/reviews_dismiss.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Dismissing" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/reviews_find.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 80, 3 | "Body": "Here is the body for the review.", 4 | "Sha": "ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091", 5 | "Link": "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80", 6 | "State": "APPROVED", 7 | "Author": { 8 | "Login": "octocat", 9 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 10 | }, 11 | "Created": "2019-11-17T17:43:43Z" 12 | } 13 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/reviews_list.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 80, 4 | "Body": "Here is the body for the review.", 5 | "Sha": "ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091", 6 | "Link": "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80", 7 | "State": "APPROVED", 8 | "Author": { 9 | "Login": "octocat", 10 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 11 | }, 12 | "Created": "2019-11-17T17:43:43Z" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/reviews_list_comments.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Body": "Great stuff!", 4 | "Path": "file1.txt", 5 | "Sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", 6 | "Line": 1, 7 | "Link": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1", 8 | "Author": { 9 | "Login": "octocat", 10 | "Avatar": "https://github.com/images/error/octocat_happy.gif" 11 | }, 12 | "Created": "2011-04-14T16:00:49Z", 13 | "Updated": "2011-04-14T16:00:49Z" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/reviews_submit.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "", 3 | "event": "APPROVE" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/reviews_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "Updated body" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "State": "success", 3 | "Label": "continuous-integration/drone", 4 | "Desc": "Build has completed successfully", 5 | "Target": "https://ci.example.com/1000/output", 6 | "Link": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" 7 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/statuses.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "State": "success", 4 | "Label": "continuous-integration/drone", 5 | "Desc": "Build has completed successfully", 6 | "Target": "https://ci.example.com/1000/output", 7 | "Link": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" 8 | }, 9 | { 10 | "State": "failure", 11 | "Label": "continuous-integration/drone", 12 | "Desc": "Build failed", 13 | "Target": "https://ci.example.com/1000/output", 14 | "Link": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" 15 | } 16 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/tags.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "v0.1", 4 | "commit": { 5 | "sha": "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc", 6 | "url": "https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc" 7 | }, 8 | "zipball_url": "https://github.com/octocat/Hello-World/zipball/v0.1", 9 | "tarball_url": "https://github.com/octocat/Hello-World/tarball/v0.1" 10 | } 11 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/tags.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "v0.1", 4 | "Path": "refs/tags/v0.1", 5 | "Sha": "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/team_members.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Login": "octocat" 4 | } 5 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/teams.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "node_id": "MDQ6VGVhbTE=", 5 | "url": "https://api.github.com/teams/1", 6 | "name": "Justice League", 7 | "slug": "justice-league", 8 | "description": "A great team.", 9 | "privacy": "closed", 10 | "permission": "admin", 11 | "members_url": "https://api.github.com/teams/1/members{/member}", 12 | "repositories_url": "https://api.github.com/teams/1/repos", 13 | "parent": null 14 | } 15 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/teams.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "url": "https://api.github.com/teams/1", 5 | "Name": "Justice League", 6 | "Slug": "justice-league", 7 | "Description": "A great team.", 8 | "Privacy": "closed", 9 | "Permission": "admin" 10 | } 11 | ] -------------------------------------------------------------------------------- /scm/driver/github/testdata/user.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Login": "octocat", 4 | "Name": "monalisa octocat", 5 | "Email": "octocat@github.com", 6 | "Avatar": "https://github.com/images/error/octocat_happy.gif", 7 | "Link": "https://github.com/octocat", 8 | "Created": "2008-01-14T04:33:35Z", 9 | "Updated": "2008-01-14T04:33:35Z" 10 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/webhooks/branch_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature-branch", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "13933572", 8 | "Namespace": "bradrydzewski", 9 | "Name": "drone-test-go", 10 | "FullName": "bradrydzewski/drone-test-go", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "https://github.com/bradrydzewski/drone-test-go.git", 15 | "CloneSSH": "git@github.com:bradrydzewski/drone-test-go.git", 16 | "Link": "https://github.com/bradrydzewski/drone-test-go", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "created", 21 | "Sender": { 22 | "ID": 817538, 23 | "Login": "bradrydzewski", 24 | "Name": "", 25 | "Email": "", 26 | "Link": "https://github.com/bradrydzewski", 27 | "Avatar": "https://avatars1.githubusercontent.com/u/817538?v=4" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/webhooks/branch_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature-branch", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "13933572", 8 | "Namespace": "bradrydzewski", 9 | "Name": "drone-test-go", 10 | "FullName": "bradrydzewski/drone-test-go", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "https://github.com/bradrydzewski/drone-test-go.git", 15 | "CloneSSH": "git@github.com:bradrydzewski/drone-test-go.git", 16 | "Link": "https://github.com/bradrydzewski/drone-test-go", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "ID": 817538, 23 | "Login": "bradrydzewski", 24 | "Name": "", 25 | "Email": "", 26 | "Link": "https://github.com/bradrydzewski", 27 | "Avatar": "https://avatars1.githubusercontent.com/u/817538?v=4" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/webhooks/fork.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Repo": { 3 | "ID": "186853002", 4 | "Namespace": "Codertocat", 5 | "Name": "Hello-World", 6 | "FullName": "Codertocat/Hello-World", 7 | "Perm": { 8 | "Pull": false, 9 | "Push": false, 10 | "Admin": false 11 | }, 12 | "Branch": "master", 13 | "Private": false, 14 | "Clone": "https://github.com/Codertocat/Hello-World.git", 15 | "CloneSSH": "git@github.com:Codertocat/Hello-World.git", 16 | "Link": "https://github.com/Codertocat/Hello-World", 17 | "Created": "2019-05-15T15:19:25Z", 18 | "Updated": "2019-05-15T15:20:41Z" 19 | }, 20 | "Sender": { 21 | "ID": 38302899, 22 | "Login": "Octocoders", 23 | "Name": "", 24 | "Email": "", 25 | "Avatar": "https://avatars1.githubusercontent.com/u/38302899?v=4", 26 | "Link": "https://github.com/Octocoders", 27 | "Created": "0001-01-01T00:00:00Z", 28 | "Updated": "0001-01-01T00:00:00Z" 29 | }, 30 | "Installation": null 31 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/webhooks/ping.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Repo": { 3 | "ID": "215576972", 4 | "Namespace": "jstrachan", 5 | "Name": "nodey227", 6 | "FullName": "jstrachan/nodey227", 7 | "Perm": { 8 | "Pull": false, 9 | "Push": false, 10 | "Admin": false 11 | }, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "https://github.com/jstrachan/nodey227.git", 15 | "CloneSSH": "git@github.com:jstrachan/nodey227.git", 16 | "Link": "https://github.com/jstrachan/nodey227", 17 | "Created": "2019-10-16T15:03:50Z", 18 | "Updated": "2019-10-16T15:13:57Z" 19 | }, 20 | "Sender": { 21 | "ID": 30140, 22 | "Login": "jstrachan", 23 | "Name": "", 24 | "Email": "", 25 | "Avatar": "https://avatars1.githubusercontent.com/u/30140?v=4", 26 | "Link": "https://github.com/jstrachan", 27 | "Created": "0001-01-01T00:00:00Z", 28 | "Updated": "0001-01-01T00:00:00Z" 29 | }, 30 | "Installation": null, 31 | "GUID": "f2467dea-70d6-11e8-8955-3c83993e0aef" 32 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/webhooks/repository.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Action": "", 3 | "Repo": { 4 | "ID": "186853002", 5 | "Namespace": "Codertocat", 6 | "Name": "Hello-World", 7 | "FullName": "Codertocat/Hello-World", 8 | "Perm": { 9 | "Pull": false, 10 | "Push": false, 11 | "Admin": false 12 | }, 13 | "Branch": "master", 14 | "Private": false, 15 | "Clone": "https://github.com/Codertocat/Hello-World.git", 16 | "CloneSSH": "git@github.com:Codertocat/Hello-World.git", 17 | "Link": "https://github.com/Codertocat/Hello-World", 18 | "Created": "2019-05-15T15:19:25Z", 19 | "Updated": "2019-05-15T15:21:03Z" 20 | }, 21 | "Sender": { 22 | "ID": 21031067, 23 | "Login": "Codertocat", 24 | "Name": "", 25 | "Email": "", 26 | "Avatar": "https://avatars1.githubusercontent.com/u/21031067?v=4", 27 | "Link": "https://github.com/Codertocat", 28 | "Created": "0001-01-01T00:00:00Z", 29 | "Updated": "0001-01-01T00:00:00Z" 30 | }, 31 | "Installation": null 32 | } -------------------------------------------------------------------------------- /scm/driver/github/testdata/webhooks/tag_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v0.0.1", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "13933572", 8 | "Namespace": "bradrydzewski", 9 | "Name": "drone-test-go", 10 | "FullName": "bradrydzewski/drone-test-go", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "https://github.com/bradrydzewski/drone-test-go.git", 15 | "CloneSSH": "git@github.com:bradrydzewski/drone-test-go.git", 16 | "Link": "https://github.com/bradrydzewski/drone-test-go", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "created", 21 | "Sender": { 22 | "ID": 817538, 23 | "Login": "bradrydzewski", 24 | "Name": "", 25 | "Email": "", 26 | "Link": "https://github.com/bradrydzewski", 27 | "Avatar": "https://avatars1.githubusercontent.com/u/817538?v=4" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /scm/driver/github/testdata/webhooks/tag_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v0.0.1", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "13933572", 8 | "Namespace": "bradrydzewski", 9 | "Name": "drone-test-go", 10 | "FullName": "bradrydzewski/drone-test-go", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "https://github.com/bradrydzewski/drone-test-go.git", 15 | "CloneSSH": "git@github.com:bradrydzewski/drone-test-go.git", 16 | "Link": "https://github.com/bradrydzewski/drone-test-go", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "ID": 817538, 23 | "Login": "bradrydzewski", 24 | "Name": "", 25 | "Email": "", 26 | "Link": "https://github.com/bradrydzewski", 27 | "Avatar": "https://avatars1.githubusercontent.com/u/817538?v=4" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /scm/driver/gitlab/integration/integration.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package integration 6 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/add_collaborator.json: -------------------------------------------------------------------------------- 1 | { 2 | "user_id": 1, 3 | "access_level": 30 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/add_collaborator_user.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "username": "john_smith", 4 | "name": "John Smith", 5 | "state": "active", 6 | "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", 7 | "web_url": "http://192.168.1.8:3000/root", 8 | "expires_at": "2012-10-22T14:13:35Z", 9 | "access_level": 30, 10 | "group_saml_identity": null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "master", 3 | "merged": false, 4 | "protected": true, 5 | "developers_can_push": false, 6 | "developers_can_merge": false, 7 | "commit": { 8 | "author_email": "john@example.com", 9 | "author_name": "John Smith", 10 | "authored_date": "2012-06-27T05:51:39-07:00", 11 | "committed_date": "2012-06-28T03:44:20-07:00", 12 | "committer_email": "john@example.com", 13 | "committer_name": "John Smith", 14 | "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", 15 | "short_id": "7b5c3cc", 16 | "title": "add projects API", 17 | "message": "add projects API", 18 | "parent_ids": [ 19 | "4ad91d3c1144c406e50c7b33bae684bd6837faf8" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "master", 3 | "Path": "refs/heads/master", 4 | "Sha": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c" 5 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/branches.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "master", 4 | "merged": false, 5 | "protected": true, 6 | "developers_can_push": false, 7 | "developers_can_merge": false, 8 | "commit": { 9 | "author_email": "john@example.com", 10 | "author_name": "John Smith", 11 | "authored_date": "2012-06-27T05:51:39-07:00", 12 | "committed_date": "2012-06-28T03:44:20-07:00", 13 | "committer_email": "john@example.com", 14 | "committer_name": "John Smith", 15 | "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", 16 | "short_id": "7b5c3cc", 17 | "title": "add projects API", 18 | "message": "add projects API", 19 | "parent_ids": [ 20 | "4ad91d3c1144c406e50c7b33bae684bd6837faf8" 21 | ] 22 | } 23 | } 24 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/branches.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "master", 4 | "Path": "refs/heads/master", 5 | "Sha": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/combined_status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "State": "pending", 3 | "Sha": "18f3e63d05582537db6d183d9d557be09e1f90c8", 4 | "Statuses": [ 5 | { 6 | "State": "pending", 7 | "Label": "default", 8 | "Desc": "the dude abides", 9 | "Target": "https://gitlab.example.com/thedude/gitlab-ce/builds/91" 10 | }, 11 | { 12 | "State": "success", 13 | "Label": "test", 14 | "Target": "https://gitlab.example.com/thedude/gitlab-foss/builds/90" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/commit.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6", 3 | "short_id": "6104942438c", 4 | "title": "Sanitize for network graph", 5 | "author_name": "randx", 6 | "author_email": "dmitriy.zaporozhets@gmail.com", 7 | "committer_name": "Dmitriy", 8 | "committer_email": "dmitriy.zaporozhets@gmail.com", 9 | "created_at": "2012-06-28T03:44:20-07:00", 10 | "message": "Sanitize for network graph", 11 | "committed_date": "2012-06-28T03:44:20-07:00", 12 | "authored_date": "2012-06-28T03:44:20-07:00", 13 | "parent_ids": [ 14 | "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba" 15 | ], 16 | "last_pipeline": { 17 | "id": 8, 18 | "ref": "master", 19 | "sha": "2dc6aa325a317eda67812f05600bdf0fcdc70ab0", 20 | "status": "created" 21 | }, 22 | "stats": { 23 | "additions": 15, 24 | "deletions": 10, 25 | "total": 25 26 | }, 27 | "status": "running" 28 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/commit.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Sha": "6104942438c14ec7bd21c6cd5bd995272b3faff6", 3 | "Message": "Sanitize for network graph", 4 | "Author": { 5 | "Name": "randx", 6 | "Email": "dmitriy.zaporozhets@gmail.com", 7 | "Date": "2012-06-28T03:44:20-07:00", 8 | "Login": "randx", 9 | "Avatar": "" 10 | }, 11 | "Committer": { 12 | "Name": "Dmitriy", 13 | "Email": "dmitriy.zaporozhets@gmail.com", 14 | "Date": "2012-06-28T03:44:20-07:00", 15 | "Login": "Dmitriy", 16 | "Avatar": "" 17 | }, 18 | "Link": "" 19 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/commit_diff.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "diff": "--- a/doc/update/5.4-to-6.0.md\n+++ b/doc/update/5.4-to-6.0.md\n@@ -71,6 +71,8 @@\n sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production\n sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production\n \n+sudo -u git -H bundle exec rake gitlab:assets:compile RAILS_ENV=production\n+\n ```\n \n ### 6. Update config files", 4 | "new_path": "doc/update/5.4-to-6.0.md", 5 | "old_path": "doc/update/5.4-to-6.0.md", 6 | "a_mode": null, 7 | "b_mode": "100644", 8 | "new_file": true, 9 | "renamed_file": false, 10 | "deleted_file": false 11 | } 12 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/commit_diff.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "doc/update/5.4-to-6.0.md", 4 | "PreviousPath": "doc/update/5.4-to-6.0.md", 5 | "Added": true, 6 | "Renamed": false, 7 | "Deleted": false, 8 | "Patch": "--- a/doc/update/5.4-to-6.0.md\n+++ b/doc/update/5.4-to-6.0.md\n@@ -71,6 +71,8 @@\n sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production\n sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production\n \n+sudo -u git -H bundle exec rake gitlab:assets:compile RAILS_ENV=production\n+\n ```\n \n ### 6. Update config files" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/commits.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6", 4 | "short_id": "6104942438c", 5 | "title": "Sanitize for network graph", 6 | "author_name": "randx", 7 | "author_email": "dmitriy.zaporozhets@gmail.com", 8 | "authored_date": "2012-06-28T03:44:20-07:00", 9 | "committer_name": "Dmitriy", 10 | "committer_email": "dmitriy.zaporozhets@gmail.com", 11 | "committed_date": "2012-06-28T03:44:20-07:00", 12 | "created_at": "2012-09-20T09:06:12+03:00", 13 | "message": "Sanitize for network graph", 14 | "parent_ids": [ 15 | "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba" 16 | ] 17 | } 18 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/commits.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Sha": "6104942438c14ec7bd21c6cd5bd995272b3faff6", 4 | "Message": "Sanitize for network graph", 5 | "Author": { 6 | "Name": "randx", 7 | "Email": "dmitriy.zaporozhets@gmail.com", 8 | "Date": "2012-06-28T03:44:20-07:00", 9 | "Login": "randx", 10 | "Avatar": "" 11 | }, 12 | "Committer": { 13 | "Name": "Dmitriy", 14 | "Email": "dmitriy.zaporozhets@gmail.com", 15 | "Date": "2012-06-28T03:44:20-07:00", 16 | "Login": "Dmitriy", 17 | "Avatar": "" 18 | }, 19 | "Link": "" 20 | } 21 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/compare.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "PreviousPath": "config/config.prod.json", 4 | "Path": "config/config.prod.json", 5 | "Added": false, 6 | "Renamed": false, 7 | "Deleted": false, 8 | "Patch": "@@ -52,11 +52,7 @@\n \"homeserverUrl\": \"https://gitter.ems.host\",\n \"serverName\": \"gitter.im\",\n \"applicationServiceUrl\": \"https://matrix.gitter.im\",\n- \"senderLocalpart\": \"matrixbot\",\n- \"gitterRoomAllowList\": [\n- \"5faa0809d73408ce4ff3ad8e\",\n- \"5faa0a0ed73408ce4ff3ada9\"\n- ]\n+ \"senderLocalpart\": \"matrixbot\"\n }\n },\n \"virtualUsers\": {\n" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/content_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_path": "README", 3 | "branch": "my-test-branch" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/contributors.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Login": "raymond_smith", 5 | "Name": "Raymond Smith", 6 | "Avatar": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon" 7 | }, 8 | { 9 | "ID": 2, 10 | "Login": "john_doe", 11 | "Name": "John Doe", 12 | "Avatar": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon" 13 | }, 14 | { 15 | "ID": 3, 16 | "Login": "foo_bar", 17 | "Name": "Foo bar", 18 | "Avatar": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/create_branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "commit": { 3 | "author_email": "john@example.com", 4 | "author_name": "John Smith", 5 | "authored_date": "2012-06-27T05:51:39-07:00", 6 | "committed_date": "2012-06-28T03:44:20-07:00", 7 | "committer_email": "john@example.com", 8 | "committer_name": "John Smith", 9 | "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", 10 | "short_id": "7b5c3cc", 11 | "title": "add projects API", 12 | "message": "add projects API", 13 | "parent_ids": [ 14 | "4ad91d3c1144c406e50c7b33bae684bd6837faf8" 15 | ] 16 | }, 17 | "name": "newbranch", 18 | "merged": false, 19 | "protected": false, 20 | "default": false, 21 | "developers_can_push": false, 22 | "developers_can_merge": false, 23 | "can_push": true, 24 | "web_url": "http://gitlab.example.com/diaspora/diaspora/-/tree/newbranch" 25 | } 26 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/create_branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "newbranch", 3 | "Sha": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/create_project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "diaspora", 3 | "namespace_id": 120836, 4 | "visibility": "public" 5 | } 6 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/edit_issue_note.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "closed" 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/find_namespace.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 120836, 4 | "name": "diaspora", 5 | "path": "diaspora", 6 | "kind": "group", 7 | "full_path": "diaspora", 8 | "parent_id": null 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/fork_project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "diaspora", 3 | "namespace_path": "diaspora" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/group.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 4, 3 | "Name": "twitter", 4 | "Avatar": "http://localhost:3000/uploads/group/avatar/1/twitter.jpg" 5 | } 6 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/groups.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "Twitter", 5 | "path": "twitter", 6 | "description": "An interesting group", 7 | "visibility": "public", 8 | "lfs_enabled": true, 9 | "avatar_url": "http://localhost:3000/uploads/group/avatar/1/twitter.jpg", 10 | "web_url": "http://localhost:3000/groups/twitter", 11 | "request_access_enabled": false, 12 | "full_name": "Twitter", 13 | "full_path": "twitter", 14 | "parent_id": null 15 | } 16 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/groups.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Name": "twitter", 5 | "Avatar": "http://localhost:3000/uploads/group/avatar/1/twitter.jpg" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/hook.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "url": "http://example.com/hook", 4 | "project_id": 3, 5 | "push_events": true, 6 | "issues_events": true, 7 | "merge_requests_events": true, 8 | "tag_push_events": true, 9 | "note_events": true, 10 | "job_events": true, 11 | "pipeline_events": true, 12 | "wiki_page_events": true, 13 | "enable_ssl_verification": true, 14 | "created_at": "2012-10-12T17:04:47Z" 15 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/hook.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "Name": "", 4 | "Target": "http://example.com/hook", 5 | "Events": [ 6 | "issues", 7 | "tag", 8 | "push", 9 | "comment", 10 | "merge" 11 | ], 12 | "Active": true, 13 | "SkipVerify": false 14 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/hook_ssl_false.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "url": "http://example.com/hook", 4 | "project_id": 3, 5 | "push_events": true, 6 | "issues_events": true, 7 | "merge_requests_events": true, 8 | "tag_push_events": true, 9 | "note_events": true, 10 | "job_events": true, 11 | "pipeline_events": true, 12 | "wiki_page_events": true, 13 | "enable_ssl_verification": false, 14 | "created_at": "2012-10-12T17:04:47Z" 15 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/hook_ssl_false.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "Name": "", 4 | "Target": "http://example.com/hook", 5 | "Events": [ 6 | "issues", 7 | "tag", 8 | "push", 9 | "comment", 10 | "merge" 11 | ], 12 | "Active": true, 13 | "SkipVerify": true 14 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/hooks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "url": "http://example.com/hook", 5 | "project_id": 3, 6 | "push_events": true, 7 | "issues_events": true, 8 | "merge_requests_events": true, 9 | "tag_push_events": true, 10 | "note_events": true, 11 | "job_events": true, 12 | "pipeline_events": true, 13 | "wiki_page_events": true, 14 | "enable_ssl_verification": true, 15 | "created_at": "2012-10-12T17:04:47Z" 16 | } 17 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/hooks.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1", 4 | "Name": "", 5 | "Target": "http://example.com/hook", 6 | "Events": [ 7 | "issues", 8 | "tag", 9 | "push", 10 | "comment", 11 | "merge" 12 | ], 13 | "Active": true, 14 | "SkipVerify": false 15 | } 16 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Number": 1, 3 | "Title": "Ut commodi ullam eos dolores perferendis nihil sunt.", 4 | "Body": "Omnis vero earum sunt corporis dolor et placeat.", 5 | "State": "closed", 6 | "Link": "http://example.com/example/example/issues/1", 7 | "Labels": [], 8 | "Closed": true, 9 | "Locked": false, 10 | "Author": { 11 | "Login": "root", 12 | "Name": "Administrator", 13 | "Email": "", 14 | "Avatar": "" 15 | }, 16 | "Assignees": [ 17 | { 18 | "ID": 9, 19 | "Login": "lennie", 20 | "Name": "Dr. Luella Kovacek", 21 | "Link": "https://gitlab.example.com/lennie" 22 | } 23 | ], 24 | "Created": "2016-01-04T15:31:46.176Z", 25 | "Updated": "2016-01-04T15:31:46.176Z" 26 | } 27 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue_events.golden.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Actor": { 4 | "ID": 1, 5 | "Name": "Administrator", 6 | "Login": "root", 7 | "Avatar": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" 8 | }, 9 | "Created": "2018-08-20T13:38:20.077Z", 10 | "Label": { 11 | "ID": 73, 12 | "Name": "a1", 13 | "Color": "#34495E", 14 | "Description": "" 15 | }, 16 | "Event": "labeled" 17 | }, 18 | { 19 | "Actor": { 20 | "ID": 1, 21 | "Name": "Administrator", 22 | "Login": "root", 23 | "Avatar": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" 24 | }, 25 | "Created": "2018-08-20T13:38:20.077Z", 26 | "Label": { 27 | "ID": 74, 28 | "Name": "p1", 29 | "Color": "#0033CC", 30 | "Description": "" 31 | }, 32 | "Event": "unlabeled" 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue_note.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 302, 3 | "body": "closed", 4 | "attachment": null, 5 | "author": { 6 | "id": 1, 7 | "username": "pipin", 8 | "email": "admin@example.com", 9 | "name": "Pip", 10 | "state": "active", 11 | "created_at": "2013-09-30T13:46:01Z" 12 | }, 13 | "created_at": "2013-10-02T09:22:45Z", 14 | "updated_at": "2013-10-02T10:22:45Z", 15 | "system": true, 16 | "noteable_id": 377, 17 | "noteable_type": "Issue", 18 | "noteable_iid": 377 19 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue_note.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 302, 3 | "Body": "closed", 4 | "Author": { 5 | "Login": "pipin", 6 | "Name": "Pip", 7 | "Email": "", 8 | "Avatar": "" 9 | }, 10 | "Created": "2013-10-02T09:22:45Z", 11 | "Updated": "2013-10-02T10:22:45Z" 12 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue_notes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 302, 4 | "body": "closed", 5 | "attachment": null, 6 | "author": { 7 | "id": 1, 8 | "username": "pipin", 9 | "email": "admin@example.com", 10 | "name": "Pip", 11 | "state": "active", 12 | "created_at": "2013-09-30T13:46:01Z" 13 | }, 14 | "created_at": "2013-10-02T09:22:45Z", 15 | "updated_at": "2013-10-02T10:22:45Z", 16 | "system": true, 17 | "noteable_id": 377, 18 | "noteable_type": "Issue", 19 | "noteable_iid": 377 20 | } 21 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue_notes.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 302, 4 | "Body": "closed", 5 | "Author": { 6 | "Login": "pipin", 7 | "Name": "Pip", 8 | "Email": "", 9 | "Avatar": "" 10 | }, 11 | "Created": "2013-10-02T09:22:45Z", 12 | "Updated": "2013-10-02T10:22:45Z" 13 | } 14 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue_or_pr_clear_milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "milestone_id": 0 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issue_or_pr_set_milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "milestone_id": 1 3 | } 4 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/issues.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Number": 1, 4 | "Title": "Ut commodi ullam eos dolores perferendis nihil sunt.", 5 | "Body": "Omnis vero earum sunt corporis dolor et placeat.", 6 | "State": "closed", 7 | "Link": "http://example.com/example/example/issues/1", 8 | "Labels": [], 9 | "Closed": true, 10 | "Locked": false, 11 | "Author": { 12 | "Login": "root", 13 | "Name": "Administrator", 14 | "Email": "", 15 | "Avatar": "" 16 | }, 17 | "Assignees": [ 18 | { 19 | "ID": 9, 20 | "Login": "lennie", 21 | "Name": "Dr. Luella Kovacek", 22 | "Link": "https://gitlab.example.com/lennie" 23 | } 24 | ], 25 | "Created": "2016-01-04T15:31:46.176Z", 26 | "Updated": "2016-01-04T15:31:46.176Z" 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/merge_diff.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "VERSION", 4 | "PreviousPath": "VERSION", 5 | "Added": false, 6 | "Renamed": false, 7 | "Deleted": false, 8 | "Patch": "--- a/VERSION\\ +++ b/VERSION\\ @@ -1 +1 @@\\ -1.9.7\\ +1.9.8" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/merge_note.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 301, 3 | "body": "Comment for MR", 4 | "attachment": null, 5 | "author": { 6 | "id": 1, 7 | "username": "pipin", 8 | "email": "admin@example.com", 9 | "name": "Pip", 10 | "state": "active", 11 | "created_at": "2013-09-30T13:46:01Z" 12 | }, 13 | "created_at": "2013-10-02T08:57:14Z", 14 | "updated_at": "2013-10-02T08:57:14Z", 15 | "system": false, 16 | "noteable_id": 2, 17 | "noteable_type": "MergeRequest", 18 | "noteable_iid": 2 19 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/merge_note.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 301, 3 | "Body": "Comment for MR", 4 | "Author": { 5 | "Login": "pipin", 6 | "Name": "Pip", 7 | "Email": "", 8 | "Avatar": "" 9 | }, 10 | "Created": "2013-10-02T08:57:14Z", 11 | "Updated": "2013-10-02T08:57:14Z" 12 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/merge_notes.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 301, 4 | "body": "Comment for MR", 5 | "attachment": null, 6 | "author": { 7 | "id": 1, 8 | "username": "pipin", 9 | "email": "admin@example.com", 10 | "name": "Pip", 11 | "state": "active", 12 | "created_at": "2013-09-30T13:46:01Z" 13 | }, 14 | "created_at": "2013-10-02T08:57:14Z", 15 | "updated_at": "2013-10-02T08:57:14Z", 16 | "system": false, 17 | "noteable_id": 2, 18 | "noteable_type": "MergeRequest", 19 | "noteable_iid": 2 20 | } 21 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/merge_notes.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 301, 4 | "Body": "Comment for MR", 5 | "Author": { 6 | "Login": "pipin", 7 | "Name": "Pip", 8 | "Email": "", 9 | "Avatar": "" 10 | }, 11 | "Created": "2013-10-02T08:57:14Z", 12 | "Updated": "2013-10-02T08:57:14Z" 13 | } 14 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/milestone.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 12, 3 | "iid": 3, 4 | "project_id": 16, 5 | "title": "10.0", 6 | "description": "Version", 7 | "due_date": "2013-11-29", 8 | "start_date": "2013-11-10", 9 | "state": "active", 10 | "updated_at": "2013-10-02T09:24:18Z", 11 | "created_at": "2013-10-02T09:24:18Z", 12 | "expired": false 13 | } 14 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/milestone.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 12, 3 | "Number": 12, 4 | "Title": "10.0", 5 | "Description": "Version", 6 | "DueDate": "2013-11-29T00:00:00Z", 7 | "State": "active" 8 | } 9 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/milestone_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "v1.0", 3 | "description": "Tracking milestone for version 1.0", 4 | "due_date": "2012-10-09" 5 | } 6 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/milestone_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "v1.0", 3 | "description": "Tracking milestone for version 1.0", 4 | "state_event": "close", 5 | "due_date": "2012-10-09" 6 | } 7 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/milestones.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 12, 4 | "iid": 3, 5 | "project_id": 16, 6 | "title": "10.0", 7 | "description": "Version", 8 | "due_date": "2013-11-29", 9 | "start_date": "2013-11-10", 10 | "state": "active", 11 | "updated_at": "2013-10-02T09:24:18Z", 12 | "created_at": "2013-10-02T09:24:18Z", 13 | "expired": false 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/milestones.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 12, 4 | "Number": 12, 5 | "Title": "10.0", 6 | "Description": "Version", 7 | "DueDate": "2013-11-29T00:00:00Z", 8 | "State": "active" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/nested_repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "31639063", 3 | "Namespace": "jx-gitlab-test", 4 | "Name": "cluster/gitlab-import-test-1", 5 | "FullName": "jx-gitlab-test/cluster/gitlab-import-test-1", 6 | "Perm": { 7 | "Pull": true, 8 | "Push": true, 9 | "Admin": true 10 | }, 11 | "Branch": "main", 12 | "Private": true, 13 | "Clone": "https://gitlab.com/jx-gitlab-test/cluster/gitlab-import-test-1.git", 14 | "CloneSSH": "git@gitlab.com:jx-gitlab-test/cluster/gitlab-import-test-1.git", 15 | "Link": "https://gitlab.com/jx-gitlab-test/cluster/gitlab-import-test-1", 16 | "Created": "2015-03-03T18:37:05.387+00:00", 17 | "Updated": "0001-01-01T00:00:00Z" 18 | } 19 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/pr_events.golden.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Actor": { 4 | "ID": 1, 5 | "Name": "Administrator", 6 | "Login": "root", 7 | "Avatar": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" 8 | }, 9 | "Created": "2018-08-20T06:17:28.394Z", 10 | "Label": { 11 | "ID": 74, 12 | "Name": "p1", 13 | "Color": "#0033CC", 14 | "Description": "" 15 | }, 16 | "Event": "labeled" 17 | }, 18 | { 19 | "Actor": { 20 | "ID": 1, 21 | "Name": "Administrator", 22 | "Login": "root", 23 | "Avatar": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" 24 | }, 25 | "Created": "2018-08-20T06:17:28.394Z", 26 | "Label": { 27 | "ID": 41, 28 | "Name": "project", 29 | "Color": "#D1D100", 30 | "Description": "" 31 | }, 32 | "Event": "labeled" 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/pr_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "A new title", 3 | "description": "A new description" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/project_member_perm.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "username": "raymond_smith", 4 | "name": "Raymond Smith", 5 | "state": "active", 6 | "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", 7 | "web_url": "http://192.168.1.8:3000/root", 8 | "access_level": 30, 9 | "expires_at": null, 10 | "group_saml_identity": null 11 | } 12 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/release.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 0, 3 | "Title": "Awesome app v0.1 alpha", 4 | "Description": "## CHANGELOG\r\n\r\n- Remove limit of 100 when searching repository code. !8671\r\n- Show error message when attempting to reopen an MR and there is an open MR for the same branch. !16447 (Akos Gyimesi)\r\n- Fix a bug where internal email pattern wasn't respected. !22516", 5 | "Link": "", 6 | "Tag": "v0.1", 7 | "Commitish": "f8d3d94cbd347e924aa7b715845e439d00e80ca4", 8 | "Draft": false, 9 | "Prerelease": false 10 | } 11 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/releases.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Title": "Awesome app v0.2 beta", 4 | "Description": "## CHANGELOG\r\n\r\n- Escape label and milestone titles to prevent XSS in GFM autocomplete. !2740\r\n- Prevent private snippets from being embeddable.\r\n- Add subresources removal to member destroy service.", 5 | "Tag": "v0.2", 6 | "Commitish": "079e90101242458910cccd35eab0e211dfc359c0" 7 | }, 8 | { 9 | "Title": "Awesome app v0.1 alpha", 10 | "Description": "## CHANGELOG\r\n\r\n-Remove limit of 100 when searching repository code. !8671\r\n- Show error message when attempting to reopen an MR and there is an open MR for the same branch. !16447 (Akos Gyimesi)\r\n- Fix a bug where internal email pattern wasn't respected. !22516", 11 | "Tag": "v0.1", 12 | "Commitish": "f8d3d94cbd347e924aa7b715845e439d00e80ca4" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "32732", 3 | "Namespace": "diaspora", 4 | "Name": "diaspora", 5 | "FullName": "diaspora/diaspora", 6 | "Perm": { 7 | "Pull": true, 8 | "Push": false, 9 | "Admin": false 10 | }, 11 | "Branch": "master", 12 | "Private": false, 13 | "Clone": "https://gitlab.com/diaspora/diaspora.git", 14 | "CloneSSH": "git@gitlab.com:diaspora/diaspora.git", 15 | "Link": "https://gitlab.com/diaspora/diaspora", 16 | "Created": "2015-03-03T18:37:05.387+00:00", 17 | "Updated": "0001-01-01T00:00:00Z" 18 | } 19 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/repos.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "32732", 4 | "Namespace": "diaspora", 5 | "Name": "diaspora", 6 | "FullName": "diaspora/diaspora", 7 | "Perm": { 8 | "Pull": true, 9 | "Push": false, 10 | "Admin": false 11 | }, 12 | "Branch": "master", 13 | "Private": false, 14 | "Clone": "https://gitlab.com/diaspora/diaspora.git", 15 | "CloneSSH": "git@gitlab.com:diaspora/diaspora.git", 16 | "Link": "https://gitlab.com/diaspora/diaspora", 17 | "Created": "2015-03-03T18:37:05.387+00:00", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/status.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "web_url": "https://gitlab.example.com/thedude", 4 | "name": "Jeff Lebowski", 5 | "avatar_url": "https://gitlab.example.com/uploads/user/avatar/28/The-Big-Lebowski-400-400.png", 6 | "username": "thedude", 7 | "state": "active", 8 | "id": 28 9 | }, 10 | "name": "default", 11 | "sha": "18f3e63d05582537db6d183d9d557be09e1f90c8", 12 | "status": "pending", 13 | "coverage": 100.0, 14 | "description": "the dude abides", 15 | "id": 93, 16 | "target_url": "https://gitlab.example.com/thedude/gitlab-ce/builds/91", 17 | "ref": null, 18 | "started_at": null, 19 | "created_at": "2016-01-19T09:05:50.355Z", 20 | "allow_failure": false, 21 | "finished_at": "2016-01-19T09:05:50.365Z" 22 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "State": "pending", 3 | "Label": "default", 4 | "Desc": "the dude abides", 5 | "Target": "https://gitlab.example.com/thedude/gitlab-ce/builds/91" 6 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/statuses.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "State": "pending", 4 | "Label": "default", 5 | "Desc": "the dude abides", 6 | "Target": "https://gitlab.example.com/thedude/gitlab-ce/builds/91" 7 | }, 8 | { 9 | "State": "success", 10 | "Label": "test", 11 | "Target": "https://gitlab.example.com/thedude/gitlab-foss/builds/90" 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/tag.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "v1.0.0", 3 | "message": null, 4 | "commit": { 5 | "id": "2695effb5807a22ff3d138d593fd856244e155e7", 6 | "short_id": "2695effb", 7 | "title": "Initial commit", 8 | "created_at": "2017-07-26T11:08:53.000+02:00", 9 | "parent_ids": [ 10 | "2a4b78934375d7f53875269ffd4f45fd83a84ebe" 11 | ], 12 | "message": "v1.0.0\n", 13 | "author_name": "Arthur Verschaeve", 14 | "author_email": "contact@arthurverschaeve.be", 15 | "authored_date": "2015-02-01T21:56:31.000+01:00", 16 | "committer_name": "Arthur Verschaeve", 17 | "committer_email": "contact@arthurverschaeve.be", 18 | "committed_date": "2015-02-01T21:56:31.000+01:00" 19 | }, 20 | "release": null 21 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/tag.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "v1.0.0", 3 | "Path": "refs/tags/v1.0.0", 4 | "Sha": "2695effb5807a22ff3d138d593fd856244e155e7" 5 | } -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/tags.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "commit": { 4 | "id": "2695effb5807a22ff3d138d593fd856244e155e7", 5 | "short_id": "2695effb", 6 | "title": "Initial commit", 7 | "created_at": "2017-07-26T11:08:53.000+02:00", 8 | "parent_ids": [ 9 | "2a4b78934375d7f53875269ffd4f45fd83a84ebe" 10 | ], 11 | "message": "Initial commit", 12 | "author_name": "John Smith", 13 | "author_email": "john@example.com", 14 | "authored_date": "2015-02-01T21:56:31.000+01:00", 15 | "committer_name": "Jack Smith", 16 | "committer_email": "jack@example.com", 17 | "committed_date": "2015-02-01T21:56:31.000+01:00" 18 | }, 19 | "release": { 20 | "tag_name": "1.0.0", 21 | "description": "Amazing release. Wow" 22 | }, 23 | "name": "v1.0.0", 24 | "message": null 25 | } 26 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/tags.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "v1.0.0", 4 | "Path": "refs/tags/v1.0.0", 5 | "Sha": "2695effb5807a22ff3d138d593fd856244e155e7" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/user.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Login": "john_smith", 4 | "Name": "John Smith", 5 | "Email": "john@example.com", 6 | "Avatar": "http://localhost:3000/uploads/user/avatar/1/index.jpg" 7 | } 8 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/user_search.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Login": "john_smith", 4 | "Name": "John Smith", 5 | "Email": "john@example.com", 6 | "Avatar": "http://localhost:3000/uploads/user/avatar/1/index.jpg" 7 | } 8 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/branch_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature", 4 | "Sha": "c4c79227ed610f1151f05bbc5be33b4f340d39c8" 5 | }, 6 | "Repo": { 7 | "ID": "4861503", 8 | "Namespace": "gitlab-org", 9 | "Name": "hello-world", 10 | "FullName": "gitlab-org/hello-world", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": false, 14 | "Clone": "https://gitlab.com/gitlab-org/hello-world.git", 15 | "CloneSSH": "git@gitlab.com:gitlab-org/hello-world.git", 16 | "Link": "https://gitlab.com/gitlab-org/hello-world", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "Login": "sytses", 23 | "Name": "Sid Sijbrandij", 24 | "Email": "noreply@gitlab.com", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87?s=80&d=identicon" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/issue_closed.json.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/go-scm/5563991054cc6b390d2ad7aeb17d7de2768a561e/scm/driver/gitlab/testdata/webhooks/issue_closed.json.golden -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/issue_create.json.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/go-scm/5563991054cc6b390d2ad7aeb17d7de2768a561e/scm/driver/gitlab/testdata/webhooks/issue_create.json.golden -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/issue_edited.json.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/go-scm/5563991054cc6b390d2ad7aeb17d7de2768a561e/scm/driver/gitlab/testdata/webhooks/issue_edited.json.golden -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/issue_labeled.json.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/go-scm/5563991054cc6b390d2ad7aeb17d7de2768a561e/scm/driver/gitlab/testdata/webhooks/issue_labeled.json.golden -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/issue_reopen.json.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/go-scm/5563991054cc6b390d2ad7aeb17d7de2768a561e/scm/driver/gitlab/testdata/webhooks/issue_reopen.json.golden -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/push_merge.json.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/go-scm/5563991054cc6b390d2ad7aeb17d7de2768a561e/scm/driver/gitlab/testdata/webhooks/push_merge.json.golden -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/review_comment_create.json.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/go-scm/5563991054cc6b390d2ad7aeb17d7de2768a561e/scm/driver/gitlab/testdata/webhooks/review_comment_create.json.golden -------------------------------------------------------------------------------- /scm/driver/gitlab/testdata/webhooks/tag_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v1.0.0", 4 | "Sha": "2adc9465c4edfc33834e173fe89436a7cb899a1d" 5 | }, 6 | "Repo": { 7 | "ID": "4861503", 8 | "Namespace": "gitlab-org", 9 | "Name": "hello-world", 10 | "FullName": "gitlab-org/hello-world", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": false, 14 | "Clone": "https://gitlab.com/gitlab-org/hello-world.git", 15 | "CloneSSH": "git@gitlab.com:gitlab-org/hello-world.git", 16 | "Link": "https://gitlab.com/gitlab-org/hello-world", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "Login": "sytses", 23 | "Name": "Sid Sijbrandij", 24 | "Email": "noreply@gitlab.com", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87?s=80\u0026d=identicon" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gogs/release.go: -------------------------------------------------------------------------------- 1 | package gogs 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/jenkins-x/go-scm/scm" 7 | ) 8 | 9 | type release struct { 10 | ID int `json:"id"` 11 | Title string `json:"name"` 12 | Description string `json:"body"` 13 | Tag string `json:"tag_name"` 14 | Commitish string `json:"target_commitish"` 15 | Draft bool `json:"draft"` 16 | Prerelease bool `json:"prerelease"` 17 | Author *user `json:"author"` 18 | Created time.Time `json:"created_at"` 19 | } 20 | 21 | func convertRelease(from *release) *scm.Release { 22 | return &scm.Release{ 23 | ID: from.ID, 24 | Title: from.Title, 25 | Description: from.Description, 26 | Tag: from.Tag, 27 | Commitish: from.Commitish, 28 | Draft: from.Draft, 29 | Prerelease: from.Prerelease, 30 | Created: from.Created, 31 | Published: from.Created, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "master", 3 | "commit": { 4 | "id": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a", 5 | "message": "update README\n", 6 | "author": { 7 | "name": "Jane Doe", 8 | "email": "jane.doe@mail.com", 9 | "username": "janedoe" 10 | }, 11 | "committer": { 12 | "name": "Jane Doe", 13 | "email": "jane.doe@mail.com", 14 | "username": "janedoe" 15 | }, 16 | "added": null, 17 | "removed": null, 18 | "modified": null, 19 | "timestamp": "2017-11-16T22:06:53Z" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "master", 3 | "Path": "refs/heads/master", 4 | "Sha": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a" 5 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/branches.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "master", 4 | "commit": { 5 | "id": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a", 6 | "message": "update README\n", 7 | "author": { 8 | "name": "Jane Doe", 9 | "email": "jane.doe@mail.com", 10 | "username": "janedoe" 11 | }, 12 | "committer": { 13 | "name": "Jane Doe", 14 | "email": "jane.doe@mail.com", 15 | "username": "janedoe" 16 | }, 17 | "added": null, 18 | "removed": null, 19 | "modified": null, 20 | "timestamp": "2017-11-16T22:06:53Z" 21 | } 22 | } 23 | ] -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/branches.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "master", 4 | "Path": "refs/heads/master", 5 | "Sha": "f05f642b892d59a0a9ef6a31f6c905a24b5db13a" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 74, 3 | "user": { 4 | "id": 1, 5 | "username": "unknwon", 6 | "full_name": "无闻", 7 | "email": "u@gogs.io", 8 | "avatar_url": "http://localhost:3000/avatars/1" 9 | }, 10 | "body": "what?", 11 | "created_at": "2016-08-26T11:58:18-07:00", 12 | "updated_at": "2016-08-26T11:58:18-07:00" 13 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/comment.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 74, 3 | "Body": "what?", 4 | "Author": { 5 | "Login": "unknwon", 6 | "Name": "无闻", 7 | "Email": "u@gogs.io", 8 | "Avatar": "http://localhost:3000/avatars/1" 9 | }, 10 | "Created": "2016-08-26T11:58:18-07:00", 11 | "Updated": "2016-08-26T11:58:18-07:00" 12 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/comments.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 74, 4 | "user": { 5 | "id": 1, 6 | "username": "unknwon", 7 | "full_name": "无闻", 8 | "email": "u@gogs.io", 9 | "avatar_url": "http://localhost:3000/avatars/1" 10 | }, 11 | "body": "what?", 12 | "created_at": "2016-08-26T11:58:18-07:00", 13 | "updated_at": "2016-08-26T11:58:18-07:00" 14 | } 15 | ] -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/comments.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 74, 4 | "Body": "what?", 5 | "Author": { 6 | "Login": "unknwon", 7 | "Name": "无闻", 8 | "Email": "u@gogs.io", 9 | "Avatar": "http://localhost:3000/avatars/1" 10 | }, 11 | "Created": "2016-08-26T11:58:18-07:00", 12 | "Updated": "2016-08-26T11:58:18-07:00" 13 | } 14 | ] -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/commits.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Stephen Lane-Walsh", 4 | "email": "sdl.slane@gmail.com" 5 | }, 6 | "committer": { 7 | "name": "Unknwon", 8 | "login": "unknwon", 9 | "email": "u@gogs.io", 10 | "avatar": "https://secure.gravatar.com/avatar/d8b2871cdac01b57bbda23716cc03b96?d=identicon" 11 | }, 12 | "message": "conf/gitignore: add Unreal Engine (#5623)", 13 | "link": "https://try.gogs.io/api/v1/repos/gogs/gogs/commits/2c3e2b701e012294d457937e6bfbffd63dd8ae4f", 14 | "sha": "2c3e2b701e012294d457937e6bfbffd63dd8ae4f" 15 | } 16 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/hook.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 20, 3 | "type": "gogs", 4 | "config": { 5 | "content_type": "json", 6 | "url": "http://gogs.io" 7 | }, 8 | "events": [ 9 | "create", 10 | "push" 11 | ], 12 | "active": true, 13 | "updated_at": "2015-08-29T11:31:22.453572732+08:00", 14 | "created_at": "2015-08-29T11:31:22.453569275+08:00" 15 | } 16 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/hook.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "20", 3 | "Name": "", 4 | "Target": "http://gogs.io", 5 | "Events": [ 6 | "create", 7 | "push" 8 | ], 9 | "Active": true, 10 | "SkipVerify": false 11 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/hooks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 20, 4 | "type": "gogs", 5 | "config": { 6 | "content_type": "json", 7 | "url": "http://gogs.io" 8 | }, 9 | "events": [ 10 | "create", 11 | "push" 12 | ], 13 | "active": true, 14 | "updated_at": "2015-08-29T11:31:22.453572732+08:00", 15 | "created_at": "2015-08-29T11:31:22.453569275+08:00" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/hooks.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "20", 4 | "Name": "", 5 | "Target": "http://gogs.io", 6 | "Events": [ 7 | "create", 8 | "push" 9 | ], 10 | "Active": true, 11 | "SkipVerify": false 12 | } 13 | ] -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/issue.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "id": 1, 4 | "number": 1, 5 | "user": { 6 | "id": 1, 7 | "login": "janedoe", 8 | "full_name": "", 9 | "email": "janedoe@mail.com", 10 | "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87", 11 | "username": "janedoe" 12 | }, 13 | "title": "Bug found", 14 | "body": "I'm having a problem with this.", 15 | "labels": [ 16 | 17 | ], 18 | "milestone": null, 19 | "assignee": null, 20 | "state": "open", 21 | "comments": 0, 22 | "created_at": "2017-09-23T19:24:01Z", 23 | "updated_at": "2017-09-23T19:24:01Z", 24 | "pull_request": null 25 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/issue.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Number": 1, 3 | "Title": "Bug found", 4 | "Body": "I'm having a problem with this.", 5 | "Link": "", 6 | "Labels": null, 7 | "Closed": false, 8 | "Locked": false, 9 | "Author": { 10 | "Login": "janedoe", 11 | "Name": "", 12 | "Email": "janedoe@mail.com", 13 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 14 | }, 15 | "Created": "2017-09-23T19:24:01Z", 16 | "Updated": "2017-09-23T19:24:01Z" 17 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/issues.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "number": 1, 5 | "user": { 6 | "id": 1, 7 | "login": "janedoe", 8 | "full_name": "", 9 | "email": "janedoe@mail.com", 10 | "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87", 11 | "username": "janedoe" 12 | }, 13 | "title": "Bug found", 14 | "body": "I'm having a problem with this.", 15 | "labels": [ 16 | 17 | ], 18 | "milestone": null, 19 | "assignee": null, 20 | "state": "open", 21 | "comments": 0, 22 | "created_at": "2017-09-23T19:24:01Z", 23 | "updated_at": "2017-09-23T19:24:01Z", 24 | "pull_request": null 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/issues.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Number": 1, 4 | "Title": "Bug found", 5 | "Body": "I'm having a problem with this.", 6 | "Link": "", 7 | "Labels": null, 8 | "Closed": false, 9 | "Locked": false, 10 | "Author": { 11 | "Login": "janedoe", 12 | "Name": "", 13 | "Email": "janedoe@mail.com", 14 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 15 | }, 16 | "Created": "2017-09-23T19:24:01Z", 17 | "Updated": "2017-09-23T19:24:01Z" 18 | } 19 | ] -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/organization.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "username": "gogits", 4 | "full_name": "gogits", 5 | "avatar_url": "http://gogits.io/avatars/1", 6 | "description": "", 7 | "website": "", 8 | "location": "" 9 | } 10 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/organization.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "gogits", 3 | "Avatar": "http://gogits.io/avatars/1" 4 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/organizations.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "username": "gogits", 5 | "full_name": "gogits", 6 | "avatar_url": "http://gogits.io/avatars/1", 7 | "description": "", 8 | "website": "", 9 | "location": "" 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/organizations.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "gogits", 4 | "Avatar": "http://gogits.io/avatars/1" 5 | } 6 | ] -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/repo.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "owner": { 4 | "id": 1, 5 | "login": "gogits", 6 | "full_name": "gogits", 7 | "email": "", 8 | "avatar_url": "http://gogs.io/avatars/1", 9 | "username": "gogits" 10 | }, 11 | "name": "gogs", 12 | "full_name": "gogits/gogs", 13 | "description": "", 14 | "private": true, 15 | "fork": false, 16 | "parent": null, 17 | "empty": false, 18 | "mirror": false, 19 | "size": 4485120, 20 | "html_url": "http://gogs.io/drone/cover", 21 | "ssh_url": "git@localhost:drone/cover.git", 22 | "clone_url": "http://gogs.io/drone/cover.git", 23 | "website": "", 24 | "stars_count": 0, 25 | "forks_count": 0, 26 | "watchers_count": 2, 27 | "open_issues_count": 0, 28 | "default_branch": "master", 29 | "created_at": "2017-10-22T18:25:33Z", 30 | "updated_at": "2017-11-16T22:07:01Z", 31 | "permissions": { 32 | "admin": true, 33 | "push": true, 34 | "pull": true 35 | } 36 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "Namespace": "gogits", 4 | "Name": "gogs", 5 | "FullName": "gogits/gogs", 6 | "Perm": { 7 | "Pull": true, 8 | "Push": true, 9 | "Admin": true 10 | }, 11 | "Branch": "master", 12 | "Private": true, 13 | "Clone": "http://gogs.io/drone/cover.git", 14 | "CloneSSH": "git@localhost:drone/cover.git", 15 | "Link": "", 16 | "Created": "0001-01-01T00:00:00Z", 17 | "Updated": "0001-01-01T00:00:00Z" 18 | } 19 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/repos.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1", 4 | "Namespace": "gogits", 5 | "Name": "gogs", 6 | "FullName": "gogits/gogs", 7 | "Perm": { 8 | "Pull": true, 9 | "Push": true, 10 | "Admin": true 11 | }, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "http://gogs.io/drone/cover.git", 15 | "CloneSSH": "git@localhost:drone/cover.git", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "login": "jcitizen", 4 | "full_name": "Jane Citizen", 5 | "email": "jane@example.com", 6 | "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87", 7 | "username": "jcitizen" 8 | } 9 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/user.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Login": "jcitizen", 3 | "Name": "Jane Citizen", 4 | "Email": "jane@example.com", 5 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 6 | } -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/webhooks/branch_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Perm": {}, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "http://try.gogs.io/gogits/hello-world.git", 15 | "CloneSSH": "git@localhost:gogits/hello-world.git", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "created", 21 | "Sender": { 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/webhooks/branch_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "feature", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Perm": {}, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "http://try.gogs.io/gogits/hello-world.git", 15 | "CloneSSH": "git@localhost:gogits/hello-world.git", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/webhooks/tag_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v1.0.0", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Perm": {}, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "http://try.gogs.io/gogits/hello-world.git", 15 | "CloneSSH": "git@localhost:gogits/hello-world.git", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "created", 21 | "Sender": { 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/gogs/testdata/webhooks/tag_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v1.0.0", 4 | "Sha": "" 5 | }, 6 | "Repo": { 7 | "ID": "61", 8 | "Namespace": "gogits", 9 | "Name": "hello-world", 10 | "FullName": "gogits/hello-world", 11 | "Perm": {}, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "http://try.gogs.io/gogits/hello-world.git", 15 | "CloneSSH": "git@localhost:gogits/hello-world.git", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "Login": "unknwon", 23 | "Name": "", 24 | "Email": "noreply@gogs.io", 25 | "Avatar": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scm/driver/stash/multipart.go: -------------------------------------------------------------------------------- 1 | package stash 2 | 3 | import "mime/multipart" 4 | 5 | type MultipartWriter struct { 6 | Writer *multipart.Writer 7 | Error error 8 | } 9 | 10 | func (mw *MultipartWriter) Write(f, v string) { 11 | if mw.Error != nil { 12 | return 13 | } 14 | if v == "" { 15 | return 16 | } 17 | mw.Error = mw.Writer.WriteField(f, v) 18 | } 19 | 20 | func (mw *MultipartWriter) Close() { 21 | mw.Writer.Close() 22 | } 23 | 24 | func (mw *MultipartWriter) FormDataContentType() string { 25 | return mw.Writer.FormDataContentType() 26 | } 27 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/add_collaborator.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jcitizen", 3 | "permission": "REPO_ADMIN" 4 | } 5 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "id": "refs/heads/master", 8 | "displayId": "master", 9 | "type": "BRANCH", 10 | "latestCommit": "11ce869211917dd65610e70fcee454943b35ac6e", 11 | "latestChangeset": "11ce869211917dd65610e70fcee454943b35ac6e", 12 | "isDefault": true 13 | } 14 | ], 15 | "start": 0 16 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "master", 3 | "Path": "refs/heads/master", 4 | "Sha": "11ce869211917dd65610e70fcee454943b35ac6e" 5 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/branches.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "id": "refs/heads/master", 8 | "displayId": "master", 9 | "type": "BRANCH", 10 | "latestCommit": "11ce869211917dd65610e70fcee454943b35ac6e", 11 | "latestChangeset": "11ce869211917dd65610e70fcee454943b35ac6e", 12 | "isDefault": true 13 | } 14 | ], 15 | "start": 0 16 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/branches.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "master", 4 | "Path": "refs/heads/master", 5 | "Sha": "11ce869211917dd65610e70fcee454943b35ac6e" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/stash/testdata/changes.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": ".gitignore", 4 | "Added": false, 5 | "Modified": false, 6 | "Renamed": false, 7 | "Deleted": true 8 | }, 9 | { 10 | "Path": "COPYING", 11 | "Added": false, 12 | "Modified": true, 13 | "Renamed": false, 14 | "Deleted": false 15 | }, 16 | { 17 | "Path": "README.md", 18 | "PreviousPath": "README", 19 | "Added": false, 20 | "Modified": false, 21 | "Renamed": true, 22 | "Deleted": false 23 | }, 24 | { 25 | "Path": "main.go", 26 | "Added": true, 27 | "Modified": false, 28 | "Renamed": false, 29 | "Deleted": false 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/combined_status.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "State": "success", 3 | "Sha": "b02e90353e4c94cda868dbcdb2301c5691a78b6c", 4 | "Statuses": [ 5 | { 6 | "State": "success", 7 | "Label": "first-key", 8 | "Desc": "This commit looks good.", 9 | "Target": "http://example.com/master-1/job/kyounger/job/repo-1/job/master/23/display/redirect" 10 | }, 11 | { 12 | "State": "success", 13 | "Label": "second-key", 14 | "Desc": "This commit looks good.", 15 | "Target": "http://example.com/master-1/job/kyounger/job/repo-1/job/master/22something/display/redirect" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/commit.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Sha": "131cb13f4aed12e725177bc4b7c28db67839bf9f", 3 | "Message": "update files", 4 | "Author": { 5 | "ID": 1, 6 | "Name": "Jane Citizen", 7 | "Email": "jane@example.com", 8 | "Date": "2018-07-04T09:01:42-07:00", 9 | "Login": "jcitizen", 10 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 11 | }, 12 | "Committer": { 13 | "ID": 1, 14 | "Name": "Jane Citizen", 15 | "Email": "jane@example.com", 16 | "Date": "2018-07-04T09:01:42-07:00", 17 | "Login": "jcitizen", 18 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 19 | }, 20 | "Link": "" 21 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/commit_build_status.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "State": "failure", 4 | "Label": "first-key", 5 | "Desc": "This commit looks bad.", 6 | "Target": "http://example.com/master-1/job/kyounger/job/repo-1/job/master/22/display/redirect" 7 | }, 8 | { 9 | "State": "success", 10 | "Label": "second-key", 11 | "Desc": "This commit looks good.", 12 | "Target": "http://example.com/master-1/job/kyounger/job/repo-1/job/master/22something/display/redirect" 13 | }, 14 | { 15 | "State": "success", 16 | "Label": "first-key", 17 | "Desc": "This commit looks good.", 18 | "Target": "http://example.com/master-1/job/kyounger/job/repo-1/job/master/23/display/redirect" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/commits.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /scm/driver/stash/testdata/commits.json.golden: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /scm/driver/stash/testdata/content.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Path": "README", 3 | "Data": "SGVsbG8gV29ybGQK" 4 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/content.txt: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/content_create.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "abcdef0123abcdef4567abcdef8987abcdef6543", 3 | "displayId": "abcdef0123a", 4 | "author": { 5 | "name": "Zaki", 6 | "emailAddress": "zaki@example.com" 7 | }, 8 | "authorTimestamp": 1734286823374, 9 | "committer": { 10 | "name": "Zaki", 11 | "emailAddress": "zaki@example.com" 12 | }, 13 | "committerTimestamp": 1734286823374, 14 | "message": "WIP on feature 1", 15 | "parents": [ 16 | { 17 | "id": "abcdef0123abcdef4567abcdef8987abcdef6543", 18 | "displayId": "abcdef0" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/content_list.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | ".tekton/pr-1.yaml", 7 | ".tekton/pr-2.yaml" 8 | ], 9 | "start": 0 10 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/content_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "abcdef0123abcdef4567abcdef8987abcdef6543", 3 | "displayId": "abcdef0123a", 4 | "author": { 5 | "name": "Zaki", 6 | "emailAddress": "zaki@example.com" 7 | }, 8 | "authorTimestamp": 1734286823374, 9 | "committer": { 10 | "name": "Zaki", 11 | "emailAddress": "zaki@example.com" 12 | }, 13 | "committerTimestamp": 1734286823374, 14 | "message": "WIP on feature 1", 15 | "parents": [ 16 | { 17 | "id": "abcdef0123abcdef4567abcdef8987abcdef6543", 18 | "displayId": "abcdef0" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/create_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "refs/heads/scm-branch", 3 | "displayId": "scm-branch", 4 | "type": "BRANCH", 5 | "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", 6 | "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", 7 | "isDefault": false 8 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/create_ref.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "scm-branch", 3 | "Path": "refs/heads/scm-branch", 4 | "Sha": "8d51122def5632836d1cb1026e879069e10a1e13" 5 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/create_repo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-repo", 3 | "scmId": "git", 4 | "public": false 5 | } 6 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/default_branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "refs/heads/master", 3 | "displayId": "master", 4 | "type": "BRANCH", 5 | "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", 6 | "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", 7 | "isDefault": true 8 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/default_branch.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "master", 3 | "Path": "refs/heads/master", 4 | "Sha": "8d51122def5632836d1cb1026e879069e10a1e13" 5 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors": [ 3 | { 4 | "context": null, 5 | "message": "Project dev does not exist.", 6 | "exceptionName": "com.atlassian.bitbucket.project.NoSuchProjectException" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/find_user_permission.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "user": { 8 | "name": "jcitizen", 9 | "emailAddress": "jane@example.com", 10 | "id": 101, 11 | "displayName": "Jane Citizen", 12 | "active": true, 13 | "slug": "jcitizen", 14 | "type": "NORMAL" 15 | }, 16 | "permission": "REPO_READ" 17 | } 18 | ], 19 | "start": 0 20 | } 21 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/fork_repo.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": { 3 | "key": "PRJ" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/org_members.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 2, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "user": { 8 | "name": "jcitizen", 9 | "emailAddress": "jane@example.com", 10 | "id": 101, 11 | "displayName": "Jane Citizen", 12 | "active": true, 13 | "slug": "jcitizen", 14 | "type": "NORMAL" 15 | }, 16 | "permission": "ADMIN" 17 | }, 18 | { 19 | "user": { 20 | "name": "bob", 21 | "emailAddress": "bob@example.com", 22 | "id": 102, 23 | "displayName": "Bob", 24 | "active": true, 25 | "slug": "bob", 26 | "type": "NORMAL" 27 | }, 28 | "permission": "PROJECT_WRITE" 29 | } 30 | ], 31 | "start": 0 32 | } 33 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/org_members.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Login": "jcitizen" 4 | }, 5 | { 6 | "Login": "bob" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/orgs.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "key": "PRJ", 8 | "id": 1, 9 | "name": "My Cool Project", 10 | "description": "The description for my cool project.", 11 | "public": true, 12 | "type": "NORMAL", 13 | "links": { 14 | "self": [ 15 | { 16 | "href": "http://link/to/project" 17 | } 18 | ] 19 | } 20 | } 21 | ], 22 | "start": 0 23 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/orgs.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Name": "PRJ", 5 | "Avatar": "", 6 | "Permissions": { 7 | "MembersCreatePrivate": true, 8 | "MembersCreatePublic": true, 9 | "MembersCreateInternal": true 10 | } 11 | } 12 | ] -------------------------------------------------------------------------------- /scm/driver/stash/testdata/pr_change.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Path": "COPYING", 4 | "Added": true, 5 | "Modified": false, 6 | "Renamed": false, 7 | "Deleted": false 8 | }, 9 | { 10 | "Path": "README", 11 | "Added": false, 12 | "Modified": false, 13 | "Renamed": false, 14 | "Deleted": true 15 | }, 16 | { 17 | "Path": "README.md", 18 | "Added": true, 19 | "Modified": false, 20 | "Renamed": false, 21 | "Deleted": false 22 | }, 23 | { 24 | "Path": "main.go", 25 | "Added": true, 26 | "Modified": false, 27 | "Renamed": false, 28 | "Deleted": false 29 | } 30 | ] -------------------------------------------------------------------------------- /scm/driver/stash/testdata/pr_comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "repositoryId": 1 4 | }, 5 | "id": 1, 6 | "version": 5, 7 | "text": "this is a comment", 8 | "author": { 9 | "name": "jcitizen", 10 | "emailAddress": "jane@example.com", 11 | "id": 1, 12 | "displayName": "Jane Citizen", 13 | "active": true, 14 | "slug": "jcitizen", 15 | "type": "NORMAL", 16 | "links": { 17 | "self": [ 18 | { 19 | "href": "http://example.com:7990/users/jcitizen" 20 | } 21 | ] 22 | } 23 | }, 24 | "createdDate": 1530770325043, 25 | "updatedDate": 1530770325043, 26 | "comments": [], 27 | "tasks": [], 28 | "permittedOperations": { 29 | "editable": true, 30 | "deletable": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/pr_comment.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Body": "this is a comment", 4 | "Author": { 5 | "ID": 1, 6 | "Login": "jcitizen", 7 | "Name": "Jane Citizen", 8 | "Email": "jane@example.com", 9 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 10 | }, 11 | "Version": 5, 12 | "Created": "2018-07-04T22:58:45-07:00", 13 | "Updated": "2018-07-04T22:58:45-07:00" 14 | } 15 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/pr_comments.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 1, 4 | "Body": "A measured reply.", 5 | "Author": { 6 | "ID": 101, 7 | "Login": "jcitizen", 8 | "Name": "Jane Citizen", 9 | "Email": "jane@example.com", 10 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 11 | }, 12 | "Version": 1, 13 | "Created": "2018-07-04T22:58:45-07:00", 14 | "Updated": "2018-07-04T22:58:45-07:00" 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/pr_label_comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "repositoryId": 1 4 | }, 5 | "id": 1, 6 | "version": 5, 7 | "text": "/jx-label test", 8 | "author": { 9 | "name": "jcitizen", 10 | "emailAddress": "jane@example.com", 11 | "id": 1, 12 | "displayName": "Jane Citizen", 13 | "active": true, 14 | "slug": "jcitizen", 15 | "type": "NORMAL", 16 | "links": { 17 | "self": [ 18 | { 19 | "href": "http://example.com:7990/users/jcitizen" 20 | } 21 | ] 22 | } 23 | }, 24 | "createdDate": 1530770325043, 25 | "updatedDate": 1530770325043, 26 | "comments": [], 27 | "tasks": [], 28 | "permittedOperations": { 29 | "editable": true, 30 | "deletable": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/pr_labels.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "test", 4 | } 5 | ] -------------------------------------------------------------------------------- /scm/driver/stash/testdata/pr_update.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "version": 0, 4 | "title": "A new title", 5 | "description": "A new description" 6 | } 7 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/project_groups.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "group": { 8 | "name": "some-group" 9 | }, 10 | "permission": "ADMIN" 11 | }, 12 | { 13 | "group": { 14 | "name": "jx-group-2" 15 | }, 16 | "permission": "PROJECT_WRITE" 17 | } 18 | ], 19 | "start": 0 20 | } 21 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/repo.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "Namespace": "PRJ", 4 | "Name": "my-repo", 5 | "FullName": "PRJ/my-repo", 6 | "Perm": null, 7 | "Branch": "master", 8 | "Private": true, 9 | "Clone": "http://example.com:7990/scm/prj/my-repo.git", 10 | "CloneSSH": "ssh://git@example.com:7999/prj/my-repo.git", 11 | "Link": "http://example.com:7990/projects/PRJ/repos/my-repo/browse", 12 | "Created": "0001-01-01T00:00:00Z", 13 | "Updated": "0001-01-01T00:00:00Z" 14 | } 15 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/repos.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1", 4 | "Namespace": "PRJ", 5 | "Name": "my-repo", 6 | "FullName": "PRJ/my-repo", 7 | "Perm": null, 8 | "Branch": "master", 9 | "Private": true, 10 | "Clone": "http://example.com:7990/scm/prj/my-repo.git", 11 | "CloneSSH": "ssh://git@example.com:7999/prj/my-repo.git", 12 | "Link": "http://example.com:7990/projects/PRJ/repos/my-repo/browse", 13 | "Created": "0001-01-01T00:00:00Z", 14 | "Updated": "0001-01-01T00:00:00Z" 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/tag.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "id": "refs/tags/v1.0.0", 8 | "displayId": "v1.0.0", 9 | "type": "TAG", 10 | "latestCommit": "11ce869211917dd65610e70fcee454943b35ac6e", 11 | "latestChangeset": "11ce869211917dd65610e70fcee454943b35ac6e", 12 | "hash": null 13 | } 14 | ], 15 | "start": 0 16 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/tag.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "v1.0.0", 3 | "Path": "refs/tags/v1.0.0", 4 | "Sha": "11ce869211917dd65610e70fcee454943b35ac6e" 5 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/tags.json: -------------------------------------------------------------------------------- 1 | { 2 | "size": 1, 3 | "limit": 25, 4 | "isLastPage": true, 5 | "values": [ 6 | { 7 | "id": "refs/tags/v1.0.0", 8 | "displayId": "v1.0.0", 9 | "type": "TAG", 10 | "latestCommit": "11ce869211917dd65610e70fcee454943b35ac6e", 11 | "latestChangeset": "11ce869211917dd65610e70fcee454943b35ac6e", 12 | "hash": null 13 | } 14 | ], 15 | "start": 0 16 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/tags.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "v1.0.0", 4 | "Path": "refs/tags/v1.0.0", 5 | "Sha": "11ce869211917dd65610e70fcee454943b35ac6e" 6 | } 7 | ] -------------------------------------------------------------------------------- /scm/driver/stash/testdata/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jcitizen", 3 | "emailAddress": "jane@example.com", 4 | "id": 1, 5 | "displayName": "Jane Citizen", 6 | "active": true, 7 | "slug": "jcitizen", 8 | "type": "NORMAL", 9 | "links": { 10 | "self": [ 11 | { 12 | "href": "http://example.com:7990/users/jcitizen" 13 | } 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/user.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": 1, 3 | "Login": "jcitizen", 4 | "Name": "Jane Citizen", 5 | "Email": "jane@example.com", 6 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 7 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/webhook.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "name": "example", 4 | "createdDate": 1530808431270, 5 | "updatedDate": 1530808431270, 6 | "events": [ 7 | "repo:refs_changed", 8 | "repo:comment:edited", 9 | "pr:declined", 10 | "pr:reviewer:approved", 11 | "pr:modified", 12 | "pr:deleted", 13 | "pr:opened", 14 | "pr:reviewer:unapproved", 15 | "repo:comment:deleted", 16 | "pr:comment:added", 17 | "pr:comment:deleted", 18 | "pr:merged", 19 | "pr:comment:edited", 20 | "repo:comment:added", 21 | "pr:reviewer:needs_work" 22 | ], 23 | "configuration": { 24 | "secret": "12345" 25 | }, 26 | "url": "http://example.com", 27 | "active": true 28 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/webhook.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "1", 3 | "Name": "example", 4 | "Target": "http://example.com", 5 | "Events": [ 6 | "repo:refs_changed", 7 | "repo:comment:edited", 8 | "pr:declined", 9 | "pr:reviewer:approved", 10 | "pr:modified", 11 | "pr:deleted", 12 | "pr:opened", 13 | "pr:reviewer:unapproved", 14 | "repo:comment:deleted", 15 | "pr:comment:added", 16 | "pr:comment:deleted", 17 | "pr:merged", 18 | "pr:comment:edited", 19 | "repo:comment:added", 20 | "pr:reviewer:needs_work" 21 | ], 22 | "Active": true, 23 | "SkipVerify": false 24 | } -------------------------------------------------------------------------------- /scm/driver/stash/testdata/webhooks.json.golden: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": "1", 4 | "Name": "example", 5 | "Target": "http://example.com", 6 | "Events": [ 7 | "repo:refs_changed", 8 | "repo:comment:edited", 9 | "pr:declined", 10 | "pr:reviewer:approved", 11 | "pr:modified", 12 | "pr:deleted", 13 | "pr:opened", 14 | "pr:reviewer:unapproved", 15 | "repo:comment:deleted", 16 | "pr:comment:added", 17 | "pr:comment:deleted", 18 | "pr:merged", 19 | "pr:comment:edited", 20 | "repo:comment:added", 21 | "pr:reviewer:needs_work" 22 | ], 23 | "Active": true, 24 | "SkipVerify": false 25 | } 26 | ] -------------------------------------------------------------------------------- /scm/driver/stash/testdata/webhooks/push_branch_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "develop", 4 | "Sha": "208b0a5c05eddadad01f2aed8802fe0c3b3eaf5e" 5 | }, 6 | "Repo": { 7 | "ID": "1", 8 | "Namespace": "PRJ", 9 | "Name": "my-repo", 10 | "FullName": "PRJ/my-repo", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "", 15 | "CloneSSH": "", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "ID": 1, 23 | "Login": "jcitizen", 24 | "Name": "Jane Citizen", 25 | "Email": "jane@example.com", 26 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/webhooks/push_tag_create.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v1.1.0", 4 | "Sha": "823b2230a56056231c9425d63758fa87078a66b4" 5 | }, 6 | "Repo": { 7 | "ID": "1", 8 | "Namespace": "PRJ", 9 | "Name": "my-repo", 10 | "FullName": "PRJ/my-repo", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "", 15 | "CloneSSH": "", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "created", 21 | "Sender": { 22 | "ID": 1, 23 | "Login": "jcitizen", 24 | "Name": "Jane Citizen", 25 | "Email": "jane@example.com", 26 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scm/driver/stash/testdata/webhooks/push_tag_delete.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "Ref": { 3 | "Name": "v1.1.0", 4 | "Sha": "823b2230a56056231c9425d63758fa87078a66b4" 5 | }, 6 | "Repo": { 7 | "ID": "1", 8 | "Namespace": "PRJ", 9 | "Name": "my-repo", 10 | "FullName": "PRJ/my-repo", 11 | "Perm": null, 12 | "Branch": "master", 13 | "Private": true, 14 | "Clone": "", 15 | "CloneSSH": "", 16 | "Link": "", 17 | "Created": "0001-01-01T00:00:00Z", 18 | "Updated": "0001-01-01T00:00:00Z" 19 | }, 20 | "Action": "deleted", 21 | "Sender": { 22 | "ID": 1, 23 | "Login": "jcitizen", 24 | "Name": "Jane Citizen", 25 | "Email": "jane@example.com", 26 | "Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scm/factory/examples/contributors/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/jenkins-x/go-scm/scm" 9 | "github.com/jenkins-x/go-scm/scm/factory" 10 | "github.com/jenkins-x/go-scm/scm/factory/examples/helpers" 11 | ) 12 | 13 | func main() { 14 | args := os.Args 15 | if len(args) < 2 { 16 | fmt.Println("usage: repo") 17 | os.Exit(1) 18 | return 19 | } 20 | repo := args[1] 21 | client, err := factory.NewClientFromEnvironment() 22 | if err != nil { 23 | helpers.Fail(err) 24 | return 25 | } 26 | 27 | fmt.Printf("listing collaborators on repository %s\n", repo) 28 | 29 | ctx := context.Background() 30 | users, _, err := client.Repositories.ListCollaborators(ctx, repo, &scm.ListOptions{}) 31 | if err != nil { 32 | helpers.Fail(err) 33 | return 34 | } 35 | fmt.Printf("Found %d collaborators\n", len(users)) 36 | 37 | for _, u := range users { 38 | fmt.Printf(" user: %#v\n", u) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /scm/factory/examples/helpers/helpers.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | // Fail fails the program due to an error 9 | func Fail(err error) { 10 | fmt.Printf("ERROR: %s\n", err.Error()) 11 | os.Exit(1) 12 | } 13 | -------------------------------------------------------------------------------- /scm/factory/examples/ref/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/jenkins-x/go-scm/scm/factory" 9 | "github.com/jenkins-x/go-scm/scm/factory/examples/helpers" 10 | ) 11 | 12 | func main() { 13 | args := os.Args 14 | if len(args) < 3 { 15 | fmt.Println("usage: repo ref") 16 | os.Exit(1) 17 | return 18 | } 19 | repo := args[1] 20 | ref := args[2] 21 | 22 | client, err := factory.NewClientFromEnvironment() 23 | if err != nil { 24 | helpers.Fail(err) 25 | return 26 | } 27 | 28 | fmt.Printf("finding in repo: %s ref: %s\n", repo, ref) 29 | 30 | ctx := context.Background() 31 | answer, _, err := client.Git.FindRef(ctx, repo, ref) 32 | if err != nil { 33 | helpers.Fail(err) 34 | return 35 | } 36 | fmt.Printf("Found: %s\n", answer) 37 | } 38 | -------------------------------------------------------------------------------- /scm/factory/examples/release/get.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/jenkins-x/go-scm/scm/factory" 9 | "github.com/jenkins-x/go-scm/scm/factory/examples/helpers" 10 | ) 11 | 12 | func main() { 13 | args := os.Args 14 | if len(args) < 3 { 15 | fmt.Println("usage: repo tag") 16 | os.Exit(1) 17 | return 18 | } 19 | repo := args[1] 20 | tag := args[2] 21 | client, err := factory.NewClientFromEnvironment() 22 | if err != nil { 23 | helpers.Fail(err) 24 | return 25 | } 26 | 27 | fmt.Printf("finding release for repo: %s tag: %s\n", repo, tag) 28 | 29 | ctx := context.Background() 30 | release, _, err := client.Releases.FindByTag(ctx, repo, tag) 31 | if err != nil { 32 | helpers.Fail(err) 33 | return 34 | } 35 | fmt.Printf("found %v\n", release) 36 | } 37 | -------------------------------------------------------------------------------- /scm/factory/examples/repo/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/jenkins-x/go-scm/scm" 9 | 10 | "github.com/jenkins-x/go-scm/scm/factory" 11 | "github.com/jenkins-x/go-scm/scm/factory/examples/helpers" 12 | ) 13 | 14 | func main() { 15 | args := os.Args 16 | if len(args) == 1 { 17 | fmt.Printf("usage: repoName") 18 | return 19 | } 20 | 21 | client, err := factory.NewClientFromEnvironment() 22 | if err != nil { 23 | helpers.Fail(err) 24 | return 25 | } 26 | ctx := context.Background() 27 | 28 | name := args[1] 29 | fmt.Printf("finding repository %s\n", name) 30 | 31 | repo, _, err := client.Repositories.Find(ctx, name) 32 | if scm.IsScmNotFound(err) { 33 | fmt.Printf("not found\n") 34 | return 35 | } 36 | if err != nil { 37 | fmt.Printf("failed: %s\n", err.Error()) 38 | return 39 | } 40 | fmt.Printf("found %#v\n", repo) 41 | } 42 | -------------------------------------------------------------------------------- /scm/token.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package scm 6 | 7 | import ( 8 | "context" 9 | "time" 10 | ) 11 | 12 | type ( 13 | // Token represents the credentials used to authorize 14 | // the requests to access protected resources. 15 | Token struct { 16 | Token string 17 | Refresh string 18 | Expires time.Time 19 | } 20 | 21 | // TokenSource returns a token. 22 | TokenSource interface { 23 | Token(context.Context) (*Token, error) 24 | } 25 | 26 | // TokenKey is the key to use with the context.WithValue 27 | // function to associate an Token value with a context. 28 | TokenKey struct{} 29 | ) 30 | 31 | // WithContext returns a copy of parent in which the token value is set 32 | func WithContext(parent context.Context, token *Token) context.Context { 33 | return context.WithValue(parent, TokenKey{}, token) 34 | } 35 | -------------------------------------------------------------------------------- /scm/transport/custom_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package transport 6 | 7 | import ( 8 | "net/http" 9 | "testing" 10 | 11 | "gopkg.in/h2non/gock.v1" 12 | ) 13 | 14 | func TestCustomTransport(t *testing.T) { 15 | defer gock.Off() 16 | 17 | gock.New("https://try.gogs.io"). 18 | Get("/api/user"). 19 | MatchHeader("Authorization", "token mF_9.B5f-4.1JqM"). 20 | Reply(200) 21 | 22 | client := &http.Client{ 23 | Transport: &Custom{ 24 | Before: func(r *http.Request) { 25 | r.Header.Set("Authorization", "token mF_9.B5f-4.1JqM") 26 | }, 27 | }, 28 | } 29 | 30 | res, err := client.Get("https://try.gogs.io/api/user") 31 | if err != nil { 32 | t.Error(err) 33 | return 34 | } 35 | defer res.Body.Close() 36 | } 37 | -------------------------------------------------------------------------------- /scm/transport/doc.go: -------------------------------------------------------------------------------- 1 | // Package transport provides facilities for setting up 2 | // authenticated http.RoundTripper given credentials and 3 | // base RoundTripper. 4 | package transport 5 | -------------------------------------------------------------------------------- /scm/transport/internal/clone.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import "net/http" 8 | 9 | // CloneRequest returns a clone of the provided 10 | // http.Request. The clone is a shallow copy of the struct 11 | // and its Header map. 12 | func CloneRequest(r *http.Request) *http.Request { 13 | // shallow copy of the struct 14 | r2 := new(http.Request) 15 | *r2 = *r 16 | // deep copy of the Header 17 | r2.Header = make(http.Header, len(r.Header)) 18 | for k, s := range r.Header { 19 | r2.Header[k] = append([]string(nil), s...) 20 | } 21 | return r2 22 | } 23 | -------------------------------------------------------------------------------- /scm/transport/internal/clone_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "bytes" 9 | "net/http" 10 | "testing" 11 | 12 | "github.com/google/go-cmp/cmp" 13 | ) 14 | 15 | func TestCloneRequest(t *testing.T) { 16 | b := new(bytes.Buffer) 17 | r1, _ := http.NewRequest("GET", "http://example.com", b) 18 | r1.Header.Set("Accept", "application/json") 19 | r1.Header.Set("Etag", "1") 20 | r2 := CloneRequest(r1) 21 | if r1 == r2 { 22 | t.Errorf("Expect http.Request cloned") 23 | } 24 | if diff := cmp.Diff(r1.Header, r2.Header); diff != "" { 25 | t.Errorf("Expect http.Header cloned") 26 | t.Log(diff) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scm/transport/oauth1/oauth1_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package oauth1 6 | -------------------------------------------------------------------------------- /scm/transport/oauth1/sign_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package oauth1 6 | -------------------------------------------------------------------------------- /scm/transport/oauth1/sort.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Dalton Hubble. All rights reserved. 2 | // Copyrights licensed under the MIT License. 3 | 4 | package oauth1 5 | 6 | import ( 7 | "fmt" 8 | "sort" 9 | ) 10 | 11 | // sortParameters sorts parameters by key and returns a 12 | // slice of formatted key value pairs. 13 | func sortParameters(params map[string]string, format string) []string { 14 | // sort by key 15 | keys := make([]string, len(params)) 16 | i := 0 17 | for key := range params { 18 | keys[i] = key 19 | i++ 20 | } 21 | sort.Strings(keys) 22 | // parameter join 23 | pairs := make([]string, len(params)) 24 | for i, key := range keys { 25 | pairs[i] = fmt.Sprintf(format, key, params[key]) 26 | } 27 | return pairs 28 | } 29 | -------------------------------------------------------------------------------- /scm/transport/oauth1/sort_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package oauth1 6 | 7 | import ( 8 | "testing" 9 | 10 | "github.com/google/go-cmp/cmp" 11 | ) 12 | 13 | func TestSortParameters(t *testing.T) { 14 | params := map[string]string{ 15 | "page": "1", 16 | "per_page": "25", 17 | "oauth_version": "1.0", 18 | "oauth_signature_method": "RSA-SHA1", 19 | "oauth_consumer_key": "12345", 20 | } 21 | want := []string{ 22 | "oauth_consumer_key=12345", 23 | "oauth_signature_method=RSA-SHA1", 24 | "oauth_version=1.0", 25 | "page=1", 26 | "per_page=25", 27 | } 28 | got := sortParameters(params, "%s=%s") 29 | if diff := cmp.Diff(want, got); diff != "" { 30 | t.Errorf("Unexpected Results") 31 | t.Log(diff) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /scm/transport/oauth1/source_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package oauth1 6 | 7 | import ( 8 | "context" 9 | "testing" 10 | 11 | "github.com/jenkins-x/go-scm/scm" 12 | ) 13 | 14 | func TestContextTokenSource(t *testing.T) { 15 | source := ContextTokenSource() 16 | want := new(scm.Token) 17 | 18 | ctx := context.Background() 19 | ctx = context.WithValue(ctx, scm.TokenKey{}, want) 20 | got, err := source.Token(ctx) 21 | if err != nil { 22 | t.Error(err) 23 | return 24 | } 25 | if got != want { 26 | t.Errorf("Expect token retrieved from Context") 27 | } 28 | } 29 | 30 | func TestContextTokenSource_Nil(t *testing.T) { 31 | source := ContextTokenSource() 32 | 33 | ctx := context.Background() 34 | token, err := source.Token(ctx) 35 | if err != nil { 36 | t.Error(err) 37 | return 38 | } 39 | if token != nil { 40 | t.Errorf("Expect nil token from Context") 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /scm/transport/oauth1/url.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Dalton Hubble. All rights reserved. 2 | // Copyrights licensed under the MIT License. 3 | 4 | package oauth1 5 | 6 | import ( 7 | "fmt" 8 | "net/http" 9 | "strings" 10 | ) 11 | 12 | // baseURI returns the base string URI of a request 13 | // according to RFC 5849 3.4.1.2. 14 | func baseURI(r *http.Request) string { 15 | scheme := strings.ToLower(r.URL.Scheme) 16 | host := strings.ToLower(r.URL.Host) 17 | if hostPort := strings.Split(host, ":"); len(hostPort) == 2 && (hostPort[1] == "80" || hostPort[1] == "443") { 18 | host = hostPort[0] 19 | } 20 | path := r.URL.EscapedPath() 21 | return fmt.Sprintf("%v://%v%v", scheme, host, path) 22 | } 23 | -------------------------------------------------------------------------------- /scm/transport/oauth2/source_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package oauth2 6 | 7 | import ( 8 | "context" 9 | "testing" 10 | 11 | "github.com/jenkins-x/go-scm/scm" 12 | ) 13 | 14 | func TestContextTokenSource(t *testing.T) { 15 | source := ContextTokenSource() 16 | want := new(scm.Token) 17 | 18 | ctx := context.Background() 19 | ctx = context.WithValue(ctx, scm.TokenKey{}, want) 20 | got, err := source.Token(ctx) 21 | if err != nil { 22 | t.Error(err) 23 | return 24 | } 25 | if got != want { 26 | t.Errorf("Expect token retrieved from Context") 27 | } 28 | } 29 | 30 | func TestContextTokenSource_Nil(t *testing.T) { 31 | source := ContextTokenSource() 32 | 33 | ctx := context.Background() 34 | token, err := source.Token(ctx) 35 | if err != nil { 36 | t.Error(err) 37 | return 38 | } 39 | if token != nil { 40 | t.Errorf("Expect nil token from Context") 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /scm/transport/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package transport 6 | 7 | import "net/http" 8 | 9 | // cloneRequest returns a clone of the provided 10 | // http.Request. The clone is a shallow copy of the struct 11 | // and its Header map. 12 | func cloneRequest(r *http.Request) *http.Request { 13 | // shallow copy of the struct 14 | r2 := new(http.Request) 15 | *r2 = *r 16 | // deep copy of the Header 17 | r2.Header = make(http.Header, len(r.Header)) 18 | for k, s := range r.Header { 19 | r2.Header[k] = append([]string(nil), s...) 20 | } 21 | return r2 22 | } 23 | -------------------------------------------------------------------------------- /scm/transport/util_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Drone.IO Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package transport 6 | 7 | import ( 8 | "bytes" 9 | "net/http" 10 | "testing" 11 | 12 | "github.com/google/go-cmp/cmp" 13 | ) 14 | 15 | func TestCopyRequest(t *testing.T) { 16 | b := new(bytes.Buffer) 17 | r1, _ := http.NewRequest("GET", "http://example.com", b) 18 | r1.Header.Set("Accept", "application/json") 19 | r1.Header.Set("Etag", "1") 20 | r2 := cloneRequest(r1) 21 | if r1 == r2 { 22 | t.Errorf("Expect http.Request cloned") 23 | } 24 | if diff := cmp.Diff(r1.Header, r2.Header); diff != "" { 25 | t.Errorf("Expect http.Header cloned") 26 | t.Log(diff) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /updatebot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | jx step create pr go --name github.com/jenkins-x/go-scm --version ${VERSION} --build "make mod" --repo https://github.com/jenkins-x/lighthouse.git 3 | --------------------------------------------------------------------------------