git

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Github                        = scmTypeName("github")
	Gitlab                        = scmTypeName("gitlab")
	BitbucketServer               = scmTypeName("bitbucket")
	DefaultContContributorsMonths = 1

	GithubTokenEnvVar     = "JFROG_CLI_GITHUB_TOKEN"    // #nosec G101
	GitlabTokenEnvVar     = "JFROG_CLI_GITLAB_TOKEN"    // #nosec G101
	BitbucketTokenEnvVar  = "JFROG_CLI_BITBUCKET_TOKEN" // #nosec G101
	GenericGitTokenEnvVar = "JF_GIT_TOKEN"              // #nosec G101
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicContributor

type BasicContributor struct {
	Email string `json:"email"`
	Repo  string `json:"repo,omitempty"`
}

type BasicGitServerParams added in v1.6.0

type BasicGitServerParams struct {
	// SCM type.
	ScmType vcsutils.VcsProvider `yaml:"scm-type"`
	// SCM API URL. For example: 'https://api.github.com'.
	ScmApiUrl string `yaml:"scm-api-url"`
	// SCM API token.
	Token string `yaml:"token"`
	// The format of the owner key depends on the Git provider:
	// - On GitHub and GitLab, the owner is typically an individual or an organization.
	// - On Bitbucket, the owner can also be a project. In the case of a private instance,
	//   the individual or organization name should be prefixed with '~'.
	Owner string `yaml:"owner"`
	// List of specific repositories names to analyze, If not provided all repositories in the project will be analyzed.
	Repositories []string `yaml:"repositories,omitempty"`
}

BasicGitServerParams basic parameters needed for calling git providers APIs.

type Contributor

type Contributor struct {
	Email          string         `json:"email"`
	Name           string         `json:"name"`
	RepoLastCommit RepoLastCommit `json:"last_commit"`
}

type ContributorDetailedSummary

type ContributorDetailedSummary struct {
	RepoPath   string     `json:"repo_path"`
	LastCommit LastCommit `json:"last_commit"`
}

type CountContributorsCommand

type CountContributorsCommand struct {
	CountContributorsParams
	// Progress bar.
	Progress ioUtils.ProgressMgr
}

func NewCountContributorsCommand

func NewCountContributorsCommand(params *CountContributorsParams) (*CountContributorsCommand, error)

func (*CountContributorsCommand) CommandName

func (cc *CountContributorsCommand) CommandName() string

The command name for the usage report.

func (*CountContributorsCommand) Run

func (cc *CountContributorsCommand) Run() error

func (*CountContributorsCommand) ServerDetails

func (cc *CountContributorsCommand) ServerDetails() (*config.ServerDetails, error)

Returns the Server details. The usage report is sent to this server.

func (*CountContributorsCommand) SetProgress added in v1.6.0

func (cc *CountContributorsCommand) SetProgress(progress ioUtils.ProgressMgr)

type CountContributorsParams

type CountContributorsParams struct {
	BasicGitServerParams
	// Path to a file contains multiple git providers to analyze.
	InputFile string
	// Number of months to analyze.
	MonthsNum int
	// Detailed summery flag.
	DetailedSummery bool
	// Progress bar.
	Progress ioUtils.ProgressMgr
}

type GitServersList added in v1.6.0

type GitServersList struct {
	ServersList []BasicGitServerParams `yaml:"git-servers-list"`
}

type LastCommit

type LastCommit struct {
	Date string `json:"date"`
	Hash string `json:"hash"`
}

type RepoLastCommit

type RepoLastCommit struct {
	Repo string `json:"repo,omitempty"`
	LastCommit
}

type Report

type Report struct {
	TotalUniqueContributors  int                                     `json:"total_unique_contributors"`
	TotalCommits             int                                     `json:"total_commits"`
	ScannedRepos             []string                                `json:"scanned_repos"`
	SkippedRepos             []string                                `json:"skipped_repos,omitempty"`
	ReportDate               string                                  `json:"report_date"`
	NumberOfMonths           string                                  `json:"number_of_months"`
	UniqueContributorsList   []Contributor                           `json:"unique_contributors_list"`
	DetailedContributorsList map[string][]ContributorDetailedSummary `json:"detailed_contributors_list,omitempty"`
	DetailedReposList        map[string][]RepositoryDetailedSummary  `json:"detailed_repos_list,omitempty"`
}

type RepositoryDetailedSummary

type RepositoryDetailedSummary struct {
	Email      string     `json:"email"`
	LastCommit LastCommit `json:"last_commit"`
}

type ScmType

type ScmType struct {
	ScmTypeMap map[string]vcsutils.VcsProvider
}

ScmType represents the valid values that can be provided to the 'scmTypeName' flag.

func NewScmType

func NewScmType() *ScmType

func (*ScmType) GetOptionalScmTypeTokenEnvVars

func (vs *ScmType) GetOptionalScmTypeTokenEnvVars() string

func (*ScmType) GetValidScmTypeString

func (vs *ScmType) GetValidScmTypeString() string

type VcsCountContributors added in v1.6.0

type VcsCountContributors struct {
	// contains filtered or unexported fields
}

VcsCountContributors combine all the count contributors functionality for one specific VCS.

func (*VcsCountContributors) GetCommitsWithQueryOptions added in v1.6.0

func (cc *VcsCountContributors) GetCommitsWithQueryOptions(repo string, options vcsclient.GitCommitsQueryOptions) ([]vcsclient.CommitInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL