Categorygithub.com/awslabs/aws-go-multi-module-repository-tools
modulepackage
0.0.0-20230815192901-380e4844cc01
Repository: https://github.com/awslabs/aws-go-multi-module-repository-tools.git
Documentation: pkg.go.dev

# README

Repository Management Tools

This Go module is a collection of tools that have been written for managing the AWS SDK for Go V2 source repository. At the time these were written, the Go ecosystem lacked tooling for managing repositories containing multiple Go modules with at the size and scale of the AWS SDK. With over 274 Go modules in the repository the tooling found here has been made to manage the lifecycle of managing dependencies (iter-repository and external), managing the releases of new changes, tag management following Go semver requirements, and production of changelogs.

Utilities

The following is a breakdown of some the key utilities found in this module that are used to manage the SDK and handle the complex release process.

CommandsDescriptionREADME
changelogCreate and manage changelog annotations. Annotations are used to document module changes and refining of the next semver version.Link
updaterequiresManages go.mod require entries, allows for easily updating inter-repository module dependencies to their latest tag, and the ability to quickly manage external dependency requirements.N/A
updatemodulemetaGenerates a go_module_metadata.go file in each module containing useful runtime metadata like the modules tagged version.N/A
generatechangelogUses a release description and associated changelog annotations to produce CHANGELOG.md entries for the release in each repository module. In addition, a summarized release statement will be created at the root of the repository.N/A
gomodgenCopies smithy-go codegen build artifacts into the SDK repository and generates a go.mod file using the build artifacts generated.json description.N/A
annotatestablegenGenerates a release changelog annotation type for new smithy-go generated modules that are not marked as unstable.N/A
calculatereleaseDetects new and changed Go modules in the repository, associates changelog annotations, and computes the next semver version tag for each module. Produces a release manifest that is used with other utilities to orchestrate a release.Link
tagreleaseCommits pending changes to the working directory, reads the release manifest, and creates the computed tagsN/A
makerelativeUsed to generate go.mod replace statements for inter-repository module dependencies. This ensures that when developing on a given Go module it's iter-repository dependencies refer to the cloned repository.N/A
eachmoduleUtility for quickly scripting execution of commands in each module of a repository.N/A

Configuration

A number of the repository tools, specifically those involved with the dependency management and release have specific behavior that is driven by the modman.toml file found at the root of the git repository. This configuration file is a TOML configuration file.

Dependencies

The dependencies is a dictionary of key-value pairs that describe external dependencies that one or more modules within the repository may depend on. (External dependencies is defined as the set of Go modules that are not found within the project git repository.) This section is used to quickly set the version of a dependency modules in the repository should use. The updaterequires tool can be used to update all Go modules require statements for each module in the repository and update them to the indicated version if they depend on the given external module.

Example

[dependencies]
"github.com/aws/smithy-go" = "v1.4.0"

This example indicates that repository modules that depend on github.com/aws/smithy-go should depend on v1.4.0 version of the library. After updating the value in the configuration file, updaterequires can be used to update modules with this information.

Modules

modules is a dictionary where the keys are module directories relative to the repository root. Each key maps to a dictionary of key-value pairs that can configure several properties of a module that affect how or if a module is handled when performing a release.

Example

To configure the module feature/service/shinything to not be tagged by the release process:

[modules."feature/service/shinything"]
no_tag = true

For more information on how to configure how modules are released see the calculaterelease README.

Mark a module to be

NOTE: If you wish to create a configuration item for a module located at the root of the repository use . as the key name.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AppendIfNotPresent appends value to the slice x if not present.
FindRepoRoot returns the absolute path to the root directory of the repository, or error.
GetEditorTool returns the editor tool to use for interactive file edits.
GetRepoRoot uses the current working directory to find the repository root.
JoinWorkingDirectory will return an absolute file system path of the passed in dir path with the current working directory.
LoadConfig loads the tooling configuration file located in the directory path.
ReadConfig reads the tooling configuration from the given reader.
UUIDVersion4 takes an array of 16 (random) bytes and converts it to a UUIDv4 value.
WriteConfig writes the tooling configuration to the given path.

# Structs

Boots was made for walking the file tree searching for modules.
Config is a configuration file for describing how modules and dependencies are managed.
ModuleConfig is the configuration for the repository module.