@@ -8,3 +8,123 @@ Build tools for use by the Go API/SDK, the collector, and their associated
88contrib repositories
99
1010[ Contributing] ( CONTRIBUTING.md )
11+
12+ ## Tools
13+
14+ This repository provides tooling for OpenTelemetry Go projects. Below are
15+ overviews and examples of each provided tools:
16+
17+ ### [ ` gotmpl ` ] ( ./gotmpl/README.md )
18+
19+ ` gotmpl ` generates files from Go templates and JSON data.
20+
21+ ``` sh
22+ gotmpl --body=template.tmpl --data=' {"key":"value"}' --out=output.go
23+ ```
24+
25+ ` gotmpl ` is designed to be used with ` go generate ` to generate code or
26+ configuration files from templates.
27+
28+ ``` go
29+ // go:generate gotmpl --body=../internal/shared/env.go.tmpl "--data={ \"pkg\": \"jaeger\" }" --out=env.go
30+ ```
31+
32+ ### [ ` issuegenerator ` ] ( ./issuegenerator/README.md )
33+
34+ Generates an issue if any test fails in CI.
35+
36+ ### [ ` chloggen ` ] ( ./chloggen/README.md )
37+
38+ Generates a ` CHANGELOG ` file from individual change YAML files.
39+
40+ ``` sh
41+ # generates a new change YAML file from a template
42+ chloggen new -filename < filename>
43+ # validates all change YAML files
44+ chloggen validate
45+ # provide a preview of the generated changelog file
46+ chloggen update -dry
47+ # updates the changelog file
48+ chloggen update -version < version>
49+ ```
50+
51+ ### [ ` checkapi ` ] ( ./checkapi/README.md )
52+
53+ Analyzes a Go module's API surface and enforces restrictions.
54+
55+ ``` sh
56+ checkapi -folder . -config config.yaml
57+ ```
58+
59+ ### [ ` crosslink ` ] ( ./crosslink/README.md )
60+
61+ Manages multiple ` go.mod ` files and intra-repository dependencies.
62+
63+ ``` sh
64+ # Insert/overwrite replace statements for intra-repo dependencies
65+ crosslink --root=/path/to/repo
66+
67+ # Remove unnecessary replace statements
68+ crosslink prune
69+ crosslink --root=/path/to/repo --prune
70+
71+ # Overwrite existing replace statements
72+ crosslink --root=/path/to/repo --overwrite
73+
74+ # Generate or update go.work file
75+ crosslink work --root=/path/to/repo
76+ ```
77+
78+ ### [ ` checkfile ` ] ( ./checkfile/README.md )
79+
80+ Checks that components in OpenTelemetry core and contrib repos contain a
81+ required file.
82+
83+ ``` sh
84+ checkfile --project-path path/to/project \
85+ --component-rel-path service/defaultcomponents/defaults.go \
86+ --module-name go.opentelemetry.io/collector \
87+ --file-name README.md
88+ ```
89+
90+ ### [ ` githubgen ` ] ( ./githubgen/README.md )
91+
92+ Generates ` .github/CODEOWNERS ` and ` .github/ALLOWLIST ` files.
93+
94+ ``` sh
95+ githubgen --skipgithub --folder . --github-org " open-telemetry" \
96+ --default-codeowner open-telemetry/opentelemetry-collector-approvers \
97+ --allowlist cmd/githubgen/allowlist.txt
98+ ```
99+
100+ To authenticate for GitHub API, set a ` GITHUB_TOKEN ` environment variable.
101+
102+ ### [ ` dbotconf ` ] ( ./dbotconf/README.md )
103+
104+ ` dbotconf ` is a Go-based tool for management of [ dependabot] configuration. It
105+ provides the ` generate ` and ` verify ` commands to create and validate
106+ [ dependabot configuration files] .
107+
108+ ``` sh
109+ # Generate configuration files
110+ dbotconf generate
111+
112+ # Verify existing configuration files
113+ dbotconf verify
114+ ```
115+
116+ [ dependabot ] : https://github.com/dependabot
117+ [ dependabot configuration files ] : https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference#about-the-dependabotyml-file
118+
119+ ### [ ` multimod ` ] ( ./multimod/README.md )
120+
121+ Tooling to support versioning of multiple Go modules in a repository.
122+
123+ ``` sh
124+ # Verify module versioning configuration.
125+ ./multimod verify
126+ # Prepare a pre-release commit.
127+ ./multimod prerelease --module-set-name < name>
128+ # Tag the new release commit.
129+ ./multimod tag --commit-hash < hash>
130+ ```
0 commit comments