parser

package
v1.4.3-dev Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

README

Dependency parsing tool

This tool is here to simplify checking the vendor manifest for consistency and for which tags are being used

It queries GitHub and takes into account any specific exceptions and produces a human-readable report on what our dependencies are

Building

There's no point building this tool all the time. It will be used sporadically for auditing purposes. Simply use go build to create the binaries when needed

Running

The binaries are designed to be piped together to take each others output. This way, any intermediate json can be fed into a spreadsheet or likewise

Example usage:

cat ../../manifest | gettags --uid "bcorrie@vmware.com" --pwd "foobedoo" > 1.json
cat 1.json | groupbyrepo > 2.json
cat 2.json | report --exceptionFile=../../exceptions

cat ../../manifest | gettags --uid "bcorrie@vmware.com" --pwd "foobedoo" | groupbyrepo | report --exceptionFile=../../exceptions

Exceptions

It would be good practice for us to document cases in which a specific revision must be used, either because of a critical patch or equivalent. See exceptions file co-located with the manifest for examples.

Exceptions are outputted in the report and ensure that no-one attempts to modify a revision to a later tag without considering the exception

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFromStdin

func ReadFromStdin() ([]byte, error)

Types

type Manifest

type Manifest struct {
	Version      int
	Dependencies []ManifestEntry
}

Manifest is a golang representation of the manifest json

func ParseManifest

func ParseManifest(input []byte) (Manifest, error)

type ManifestByRepo

type ManifestByRepo struct {
	Repository   string
	Dependencies []ManifestEntry
}

ManifestByRepo is like Manifest, except that only the Dependencies for a specific repo are included

func ParseManifestByRepo

func ParseManifestByRepo(input []byte) ([]ManifestByRepo, error)

type ManifestEntry

type ManifestEntry struct {
	Importpath   string
	Repository   string
	Vcs          string
	Revision     string
	HasTags      bool
	RevisionTag  string
	SuggestedTag string
	SuggestedRev string
	Branch       string
}

ManifestEntry includes the fields from the original manifest plus some additional fields:

HasTags - does the repository have tags
RevisionTag - is there a tag corresponding to this revision
SuggestedTag - if there is no tag, the most recent tag is listed
SuggestedRev - if a tag is suggested, the revision is also suggested

type SortedManifestByRepo

type SortedManifestByRepo []ManifestByRepo

func (SortedManifestByRepo) Len

func (slice SortedManifestByRepo) Len() int

func (SortedManifestByRepo) Less

func (slice SortedManifestByRepo) Less(i, j int) bool

func (SortedManifestByRepo) Swap

func (slice SortedManifestByRepo) Swap(i, j int)

type TagData

type TagData struct {
	Name   string
	Commit TagDataCommit
}

TagData is the golang representation of the json returned from Github

type TagDataCommit

type TagDataCommit struct {
	Sha string
	Url string
}

TagDataCommit is the golang representation of the json returned from Github

type UntaggedException

type UntaggedException struct {
	Revision string
	Reason   string
}

UntaggedException is the golang representation of a documented exception to revision not being tagged

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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