Documentation
¶
Index ¶
- func GetRepoToRemoteBranchToSourceRootFromFile(file string) (map[string]map[string]string, error)
- func GetRepoToRemoteBranchToSourceRootFromGitiles(ctx context.Context, gerritClient gerrit.Client, gc *bbproto.GitilesCommit) (map[string]map[string]string, error)
- func LoadManifestFromFile(file string) (*repo.Manifest, error)
- func LoadManifestFromFileRaw(file string) ([]byte, error)
- func LoadManifestFromFileWithIncludes(file string) (*repo.Manifest, error)
- func LoadManifestFromGS(ctx context.Context, gsClient gs.Client, path lgs.Path) (*repo.Manifest, error)
- func LoadManifestFromGitiles(ctx context.Context, gerritClient gerrit.Client, ...) (*repo.Manifest, error)
- func LoadManifestFromGitilesWithIncludes(ctx context.Context, gerritClient gerrit.Client, ...) (*repo.Manifest, error)
- func LoadManifestTreeFromFile(file string) (map[string]*repo.Manifest, error)
- func LoadManifestTreeFromGitiles(ctx context.Context, gerritClient gerrit.Client, ...) (map[string]*repo.Manifest, error)
- func PinManifestFromManifest(manifest, reference *repo.Manifest) error
- func UpdateManifestElements(reference *repo.Manifest, rawManifest []byte) ([]byte, error)
- func UpdateManifestElementsInFile(path string, reference *repo.Manifest) (bool, error)
- func UpdateManifestElementsStrict(reference *repo.Manifest, rawManifest []byte) ([]byte, error)
- type MissingProjectsError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRepoToRemoteBranchToSourceRootFromFile ¶
GetRepoToRemoteBranchToSourceRootFromFile constructs a Gerrit project to path mapping by reading manifests from the specified root manifest file.
func GetRepoToRemoteBranchToSourceRootFromGitiles ¶
func GetRepoToRemoteBranchToSourceRootFromGitiles(ctx context.Context, gerritClient gerrit.Client, gc *bbproto.GitilesCommit) (map[string]map[string]string, error)
GetRepoToRemoteBranchToSourceRootFromGitiles constructs a Gerrit project to path mapping by fetching manifest XML files from Gitiles.
func LoadManifestFromFile ¶
LoadManifestFromFile loads the manifest at the given file into a Manifest struct.
func LoadManifestFromFileRaw ¶
LoadManifestFromFileRaw loads the manifest at the given file and returns the file contents as a byte array.
func LoadManifestFromFileWithIncludes ¶
LoadManifestFromFileWithIncludes loads the manifest at the given files but also calls MergeManifests to resolve includes.
func LoadManifestFromGS ¶
func LoadManifestFromGS(ctx context.Context, gsClient gs.Client, path lgs.Path) (*repo.Manifest, error)
LoadManifestFromGS loads the manifest from the specified remote location using the GS api. TODO: test
func LoadManifestFromGitiles ¶
func LoadManifestFromGitiles(ctx context.Context, gerritClient gerrit.Client, host, project, branch, file string) (*repo.Manifest, error)
LoadManifestFromGitiles loads the manifest from the specified remote location using the Gitiles API.
func LoadManifestFromGitilesWithIncludes ¶
func LoadManifestFromGitilesWithIncludes(ctx context.Context, gerritClient gerrit.Client, host, project, branch, file string) (*repo.Manifest, error)
LoadManifestFromGitilesWithIncludes loads the manifest from the specified remote location using the Gitiles API and also calls MergeManifests to resolve includes.
func LoadManifestTreeFromFile ¶
LoadManifestTree loads the manifest at the given file path into a Manifest struct. It also loads all included manifests. Returns a map mapping manifest filenames to file contents.
func LoadManifestTreeFromGitiles ¶
func LoadManifestTreeFromGitiles(ctx context.Context, gerritClient gerrit.Client, host, project, branch, file string) (map[string]*repo.Manifest, error)
LoadManifestTree loads the manifest from the specified remote location into a Manifest struct. It also loads all included manifests. Returns a map mapping manifest filenames to file contents.
func PinManifestFromManifest ¶
PinManifestFromManifest pins all projects in a manifest to the revisions listed for the same projects in a reference manifest. If a project does not exist in the reference manifest, it will not be changed and an error will be returned. Path is used as the identifier for projects.
func UpdateManifestElements ¶
UpdateManifestElements updates manifest elements in place (so as to make the minimal changes possible to a manifest file) according to a reference manifest. The intended use case is to read a manifest from disk into a Manifest struct, modify the manifest in memory, and write the changes back to disk.
Currently supports Default, Remote, and Project elements (not Annotation).
The raw manifest will be updated at the element-level: if an element in the raw manifest matches an element in the reference manifest, all attributes will be set to the values in the reference element. The 'name' field is used as a unique identifier for <remote> elements and the 'path' field for <project> elements. The function will return an error if there is more than one <default> element in the raw manifest. The function will also return an error if elements in the reference manifest do not exist in the raw manifest. This function will NOT remove elements from the manifest just because they do not exist in the reference manifest.
func UpdateManifestElementsInFile ¶
UpdateManifestElementsInFile performs the same operation as UpdateManifestElements but operates on a specific manifest file, handling all input/output. Returns whether or not the file contents changed, and a potential error.
Types ¶
type MissingProjectsError ¶
func (MissingProjectsError) Error ¶
func (e MissingProjectsError) Error() string