backporter

package
v0.0.0-...-865bd4e Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// BugIDQuery stores the query for bug ID
	BugIDQuery = "ID"
)

Variables

This section is empty.

Functions

func CompareTargetReleases

func CompareTargetReleases(a, b string) (int, error)

CompareTargetReleases compares two target release strings (e.g. "4.10.0" or "4.8.z") and returns then semantic versioning order. ".z" is not actually a valid .<patch> in semantic versioning, so we can rely completely on semver Compare.

func CreateCloneHandler

func CreateCloneHandler(client bugzilla.Client, sortedTargetReleases []string, m *metrics.Metrics) http.HandlerFunc

CreateCloneHandler will create a clone of the specified ID and return success/error

func GetBugHandler

func GetBugHandler(client bugzilla.Client, m *metrics.Metrics) http.HandlerFunc

GetBugHandler returns a function with bug details in JSON format

func GetClonesHandler

func GetClonesHandler(client bugzilla.Client, allTargetVersions []string, m *metrics.Metrics) http.HandlerFunc

GetClonesHandler returns an HTML page with detais about the bug and its clones

func GetHelpHandler

func GetHelpHandler(m *metrics.Metrics) http.HandlerFunc

GetHelpHandler returns the help page

func GetLandingHandler

func GetLandingHandler(metrics *metrics.Metrics) http.HandlerFunc

GetLandingHandler will return a simple bug search page

func NewCachingTransport

func NewCachingTransport() http.RoundTripper

NewCachingTransport is a constructor for cachingTransport If an entry is present in the cache, it is immediately returned while also generating an async HTTP call to the bugzilla server to get the latest value which is stored in the cache. Therefore this cache does *NOT* reduce the HTTP traffic, and is only used to speed up the response.

func SortTargetReleases

func SortTargetReleases(versions []string, ascending bool) error

SortTargetReleases sorts a slice of entries like "4.1.z" and "4.10.0" in increasing order.

Types

type ClonesTemplateData

type ClonesTemplateData struct {
	Bug             *bugzilla.Bug          // bug details
	Clones          []*bugzilla.Bug        // List of clones for the bug
	Parent          *bugzilla.Bug          // Root bug if it is a a bug, otherwise holds itself
	PRs             []bugzilla.ExternalBug // Details of linked PR
	CloneTargets    []string
	NewCloneIDs     []string
	MissingReleases []string
	DependenceTree  *dependenceNode
}

ClonesTemplateData holds the UI data for the clones page

type HandlerFuncWithErrorReturn

type HandlerFuncWithErrorReturn func(http.ResponseWriter, *http.Request) error

HandlerFuncWithErrorReturn allows returning errors to be logged

Jump to

Keyboard shortcuts

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