Commit Graph

34 Commits

Author SHA1 Message Date
Antoine Toulme 829157cef7
[chore] add checkapi to tools (#12954)
Adds checkapi to the tools and a make target to run it.

Fixes #12360

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-05-05 15:52:16 +00:00
Kennedy Ekanem 0f5d764c25
[chore] Added a workflow to lint YAML files using actionlint (#12721)
#### Description

This pull request builds on the work done in #11493 
This PR introduces Actionlint as part of the project to enable linting
of GitHub Workflow files. The changes ensure that Actionlint is
installed locally within the project and is automatically run during
pull requests to enforce consistency and best practices for workflow
files.

- Added a `actionlint` target to the Makefile for running Actionlint on
workflow files.
- Added actionlint configuration to `.github/actionlint.yaml`
- update `internal/tools/go.mod` and `internal/tools/go.sum`
- Ignored some shellcheck errors (with comments) since shellcheck isn't
always right.
#### Link to tracking issue
https://github.com/open-telemetry/opentelemetry-collector/issues/9676

#### Fixes
- Addresses potential linting errors in workflow files after changes are
made.

#### Testing
- The workflow has been tested to ensure the changes resolve identified
issues and maintain functionality.
- Verified that `make actionlint` runs correctly using the local binary.
- Confirmed that the GitHub Actions workflow triggers automatically when
relevant files are changed in a pull request.
- Tested for proper error handling and feedback during linting failures.

#### Documentation
No new documentation added, as this change is self-explanatory within
the context of CI.

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
2025-04-09 09:54:45 +00:00
Matthieu MOREL 7d854d5e10
[chore]: update golangci-lint to v2 (#12774)
#### Description

Update golangci-lint to v2 and associated configurations

Closes #12731

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-02 14:34:59 +00:00
Moritz Wiesinger 43087bdd92
[chore] add githubgen to enhance codeowners and issue templates (#11756)
### This PR
- adds the githubgen tool as a dependency in internal/tools
- uses githubgen to generate codeowners and issue template files
- updates lots of metadata files by
- taking the existing codeowners file and feeding the info from there
back into the component metadata.yaml files or creating new
metadata.yaml files where none existed yet
- adds distributions.yaml as a basis the mostly already existing
`distributions:` keys in metadata.yaml files (needed for githubgen to
work correctly)
- adds relevant make commands to make the githubgen tool usage mostly
transparent to users

This change is a prerequisite to be able to ping codeowners reliably
with automated tooling as a next step.


Part of #11562

---------

Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
2025-02-06 10:31:36 +00:00
Ankit Patel 1b4e1ee29f
[chore] Use gotestsum wrapper for go tests (#11946)
**Description:**

Use
[gotestyourself/gotestsum](https://github.com/gotestyourself/gotestsum?rgh-link-date=2024-02-09T12%3A20%3A03Z)
for running tests.
This is following contrib's lead - they implemented this in this
[PR](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/31163).

Gotestsum is a lot more readable and user friendly than go test - the
output format is nicer and the test output is more parseable. We could
also use [rerun on
failed](https://github.com/gotestyourself/gotestsum#re-running-failed-tests)
or some of their other features!

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-12-18 17:27:31 +00:00
Matthieu MOREL 683e86aedb
[chore]: enable gofumpt globally (#11874)
#### Description

[gofumpt](https://golangci-lint.run/usage/linters/#gofumpt) is a
stricter format than gofmt, while being backwards compatible.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-12-13 21:44:24 +00:00
Matthieu MOREL d17559b6e8
[chore]: remove testifylint from Makefile (#11236)
#### Description

All Testifylint rules are now fixed and ensured to be applied with
golangci-lint.
This removes the helper configuration in Makefile and tools module.
2024-09-20 13:32:49 -07:00
Matthieu MOREL 6925a306fa
[chore]: enable len and empty rules from testifylint (#11021)
#### Description

Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[len](https://github.com/Antonboom/testifylint?tab=readme-ov-file#len)
and
[empty](https://github.com/Antonboom/testifylint?tab=readme-ov-file#empty)
rules from [testifylint](https://github.com/Antonboom/testifylint)

It also adds testifylint as tool to use with a make command

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-09 09:57:58 -07:00
Dmitrii Anoshin 20710ff2ae
Remove the obsolete +build directive (#9304)
`// +build` was replaced with `//go:build` directive in Go 1.17. The
`+build` can be removed since we support only 1.20 and 1.21
2024-01-17 09:56:14 -08:00
Dmitrii Anoshin 995d533ae2
[chore] Remove yq package from internal/tools (#9085)
This should've been included in
https://github.com/open-telemetry/opentelemetry-collector/pull/9073
2023-12-12 08:35:54 -08:00
Alex Boten a9ce74ba59
[chore] add semconvkit to reduce toil (#9057)
This code, copied from the opentelemetry-go repo, allows to generate
schema.go automatically as well, reducing effort needed to generate
semantic convention packages in the future

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-12-08 13:59:17 -08:00
Alex Boten a82663e41b
remove generated jsonschema code (#8620)
This code will live in the opentelemetry-go-contrib repo in the future.

This depends on
https://github.com/open-telemetry/opentelemetry-go-contrib/pull/4376

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-11-16 11:01:08 -08:00
Mackenzie 78b1833853
[chore] Replace checkdoc by checkfile (#8144)
**Description:**
Follow up to:
https://github.com/open-telemetry/opentelemetry-go-build-tools/pull/348

**Link to tracking Issue:**
(https://github.com/open-telemetry/opentelemetry-go-build-tools/issues/349)
2023-08-03 10:30:41 -07:00
Alex Boten 33d86327ce
add auto-generated configuration code (#7679)
This is generated from the opentelemetry-configuration repository using
gojsonschema. Updated makefile to support this w/ `make genjsonschema`

Follow up to
https://github.com/open-telemetry/opentelemetry-collector/pull/7678

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-06-22 12:51:26 -07:00
Alex Boten 0b88ff9686
[chore] remove unnecessary additional tools (#7852)
This is replicating the setup in the contrib repo that doesn't use
go-acc & gcovmerge for coverage. It uses tools built into go 1.20
instead

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-06-21 14:33:15 -07:00
Alex Boten 4d38f10036
[chore] install tool envsubst (#7860)
This is needed to run the builder tests.

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-06-09 10:59:21 -07:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <aboten@lightstep.com>

* make goporto

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-18 13:11:17 -07:00
Dmitrii Anoshin 9f776d0dbc
[chore] Add an automation to skip release if there no changes (#7559)
Update the release process to skip releasing the stable set of modules if there are no changes since the last version
2023-05-05 15:18:25 -07:00
Piotr Lucinski b302ace4ae
[chore] Add govulncheck scan (as a new job in build-and-test workflow) (#7526) 2023-05-04 22:16:22 -07:00
Alex Boten 955d47751b
[chore] remove ghr (#7038)
This repo does not use ghr.

Signed-off-by: Alex Boten <aboten@lightstep.com>

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-01-26 15:52:40 -08:00
Alex Boten f24a6ac30f
[chore] add chloggen for changelog (#6062)
This change updates the changelog process in this repo to match the process in the contrib repo.
2022-10-13 08:38:17 -07:00
bryan-aguilar e0eea95c1a
Add crosslink tool (#6237)
* Add crosslink info to contributing.md

* Add crosslink

* Remove install-tools requirement

* Add crosslink to check gha

* Add prune flag to crosslink
2022-10-05 09:32:37 -07:00
Bogdan Drutu 7e4a7e359f
Use go:embed instead of generate using esc (#4356)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-03 12:51:26 -07:00
alrex 4480a74ac8
add multimod tool and makefile targets to repo (#4229)
* add multimod tool and makefile targets to repo

* cleanup go.mod
2021-10-20 12:12:11 -07:00
José Carlos Chávez 9d3a8a4608
Adds vanity import check (#4180)
* chore: adds porto and fixes vanity imports.

* chore: fixes target overriding.

* chore: fixes install of porto.

* chore: includes porto as a tool.

* chore: upgrades porto to check internals.

* chore: rebase and update vanity import.

* chore: removes unnecessary space.

* chore: rollsback vanity import in generated files.
2021-10-12 13:47:36 -07:00
Bogdan Drutu 71eaf3a596
Re-enable codecov for test coverage (#4125)
Codecov was disabled here due to security concerns: https://github.com/open-telemetry/opentelemetry-collector/pull/3014/files

This new PR no longer downloads the codecov script from a remote location so is no longer susceptible to the same problem.
2021-09-27 14:53:02 -04:00
Bogdan Drutu 6db25f570e
Cleanup github actions unittests (#4124)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-09-27 09:24:07 -07:00
Anthony Mirabella 058edeabd4
Use `checkdoc` from go-build-tools, remove `issuegenerator` (#3900)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-08-26 14:59:03 -07:00
Eyal Maderer 2116719e97
Upgrade to Go 1.17 (#3887) 2021-08-25 13:49:09 -07:00
Anthony Mirabella b336d3df8b
translator/conventions: replace with conventions generated from spec v1.5.0 (#3494)
* translator/conventions: replace with conventions generated from spec v1.4.0

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* integrate semantic convention generation in Makefile

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* update semconvgen dependency

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Move semantic convention generator template to an internal location

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* conventions: update to v1.5.0, move to versioned import path

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Restore accidentally deleted line

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-08-04 12:18:49 -07:00
Anthony Mirabella dea2f6e19f
Enable generation and comparison of public API snapshots (#3081)
* Add `apidiff` to internal/tools

* Add Makefile target for building apidiff snapshots

* Add Makefile target for comparing API snapshots

* Update apidiff comparison to only output when changes are detected

* Fix missing newline at end of Makefile

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Tidy mods in internal/tools

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-05-11 14:11:49 -07:00
Bogdan Drutu fb36c26c63
Avoid running staticchek twice, once in golangci and one directly (#2578)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-03-02 14:20:51 -08:00
Bogdan Drutu a263ced270
Remove gosec from tools, we use the one from golangci (#2337)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-07 12:15:27 -05:00
Bogdan Drutu d885cb20e1
Move tools to internal, create module to avoid dependency problems (#2131)
* Move tools to internal, create module to avoid dependency problems

This way we avoid dependency conflicts between tools and main codebase.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Add dependabot entry for the new module

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Fix build

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Add makefile in internal/tools

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Re-enable coverage

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-19 09:12:14 -08:00