whereiscl

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package whereiscl provides features that are needed for the whereiscl tool. The changeinfo.go file includes functions for getting the CL status on Gerrit. The giStatus.go file includes functions for telling whether a CL passed Global Integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLStatus

type CLStatus string

CLStatus represents the status of a CL in Gerrit.

const (
	CLStatusNew       CLStatus = "NEW"
	CLStatusMerged    CLStatus = "MERGED"
	CLStatusAbandoned CLStatus = "ABANDONED"
)

type ChangeInfo

type ChangeInfo struct {
	Project         string   `json:"project"`
	Status          CLStatus `json:"status"`
	CurrentRevision string   `json:"current_revision"`
	Number          int      `json:"_number"`
}

ChangeInfo is a JSON struct for ChangeInfo responses from Gerrit. https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-info. Only fields of interest are listed here.

func GetChangeInfo

func GetChangeInfo(qi *QueryInfo) (*ChangeInfo, error)

GetChangeInfo retrieves a ChangeInfo from Gerrit about a given query.

type GIStatus

type GIStatus string

GIStatus represents the status of a CL in Global Integration.

func GetGIStatus

func GetGIStatus(ci *ChangeInfo) (GIStatus, error)

GetGIStatus returns whether a given ChangeInfo passed Global Integration.

type QueryInfo

type QueryInfo struct{ APIEndpoint, Query string }

QueryInfo stores information for querying the Gerrit server.

func ParseGitRevision

func ParseGitRevision(str string) (*QueryInfo, error)

ParseGitRevision parses the given git revision and returns QueryInfo. `str` is any string that can be parsed by `git rev-parse`.

func ParseReviewURL

func ParseReviewURL(str string) (*QueryInfo, error)

ParseReviewURL parses the given string and returns QueryInfo.

Directories

Path Synopsis
whereiscl is a command-line utility that answers "Where is my CL?".
whereiscl is a command-line utility that answers "Where is my CL?".
Package netutil provides network-related helper functions.
Package netutil provides network-related helper functions.
Package testhelper provides helper utilities for tests.
Package testhelper provides helper utilities for tests.

Jump to

Keyboard shortcuts

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