Skip to content

Commit

Permalink
Use crosslink tidylist in make gotidy
Browse files Browse the repository at this point in the history
  • Loading branch information
jade-guiton-dd committed Jan 10, 2025
1 parent 2956bb9 commit 85a2eb4
Show file tree
Hide file tree
Showing 6 changed files with 329 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ jobs:
run: |
make crosslink
git diff --exit-code || (echo 'Replace statements are out of date, please run "make crosslink" and commit the changes in this PR.' && exit 1)
- name: tidylist
run: |
make tidylist
git diff --exit-code || (echo 'Tidylist is out of date, please run "make tidylist" and commit the changes in this PR.' && exit 1)
- name: Check for go mod dependency changes
run: |
make gotidy
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,17 @@ stability-tests: otelcontribcol
gogci:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="gci"

.PHONY: tidylist
tidylist: $(CROSSLINK)
$(CROSSLINK) tidylist --validate --allow-circular internal/tidylist/allow-circular.txt internal/tidylist/tidylist.txt

# internal/tidylist/tidylist.txt lists modules in topological order, to ensure `go mod tidy` converges.
.PHONY: gotidy
gotidy:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="tidy"
@for mod in $$(cat internal/tidylist/tidylist.txt); do \
echo "Tidying $$mod"; \
(cd $$mod && rm -rf go.sum && $(GOCMD) mod tidy -compat=1.22.0) || exit $?; \
done

.PHONY: remove-toolchain
remove-toolchain:
Expand Down
12 changes: 12 additions & 0 deletions internal/tidylist/allow-circular.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file lists modules that are known to have intra-repository circular dependencies.
# The `make tidylist` command will check against this list and error out if circular dependencies
# are accidentally added or removed.

# exporter/datadog <-> connector/datadog
exporter/datadogexporter
connector/datadogconnector

# receiver/otelarrow <-> internal/otelarrow <-> exporter/otelarrow
receiver/otelarrowreceiver
exporter/otelarrowexporter
internal/otelarrow
298 changes: 298 additions & 0 deletions internal/tidylist/tidylist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
cmd/githubgen
cmd/opampsupervisor
confmap/provider/s3provider
confmap/provider/secretsmanagerprovider
pkg/pdatautil
pkg/golden
pkg/pdatatest
internal/coreinternal
pkg/ottl
internal/filter
connector/countconnector
internal/common
internal/aws/ecsutil
internal/k8sconfig
internal/metadataproviders
pkg/resourcetotelemetry
internal/k8stest
processor/k8sattributesprocessor
pkg/sampling
processor/probabilisticsamplerprocessor
processor/resourcedetectionprocessor
internal/pdatautil
processor/transformprocessor
internal/docker
receiver/dockerstatsreceiver
extension/storage
pkg/stanza
receiver/filelogreceiver
pkg/experimentalmetricmetadata
receiver/hostmetricsreceiver
pkg/translator/prometheus
pkg/translator/prometheusremotewrite
exporter/prometheusremotewriteexporter
receiver/prometheusreceiver
pkg/datadog
processor/tailsamplingprocessor
exporter/datadogexporter
connector/datadogconnector
exporter/datadogexporter
connector/exceptionsconnector
connector/failoverconnector
connector/grafanacloudconnector
connector/otlpjsonconnector
connector/roundrobinconnector
connector/routingconnector
connector/servicegraphconnector
connector/spanmetricsconnector
connector/sumconnector
exporter/alertmanagerexporter
exporter/alibabacloudlogserviceexporter
internal/aws/awsutil
internal/aws/cwlogs
exporter/awscloudwatchlogsexporter
internal/aws/metrics
exporter/awsemfexporter
pkg/translator/jaeger
pkg/translator/zipkin
exporter/awskinesisexporter
exporter/awss3exporter
internal/aws/xray
exporter/awsxrayexporter
exporter/azuredataexplorerexporter
exporter/azuremonitorexporter
exporter/carbonexporter
exporter/cassandraexporter
exporter/clickhouseexporter
exporter/coralogixexporter
exporter/datasetexporter
exporter/dorisexporter
exporter/elasticsearchexporter
extension/encoding
extension/encoding/otlpencodingextension
internal/sharedcomponent
exporter/fileexporter
exporter/googlecloudexporter
exporter/googlecloudpubsubexporter
exporter/googlemanagedprometheusexporter
exporter/honeycombmarkerexporter
exporter/influxdbexporter
internal/kafka
pkg/batchpersignal
pkg/kafka/topic
exporter/kafkaexporter
internal/exp/metrics
exporter/loadbalancingexporter
exporter/logicmonitorexporter
exporter/logzioexporter
pkg/translator/loki
exporter/lokiexporter
exporter/mezmoexporter
pkg/translator/opencensus
receiver/opencensusreceiver
exporter/opencensusexporter
exporter/opensearchexporter
internal/grpcutil
receiver/otelarrowreceiver
internal/otelarrow
exporter/otelarrowexporter
receiver/otelarrowreceiver
internal/otelarrow
exporter/otelarrowexporter
receiver/otelarrowreceiver
exporter/prometheusexporter
exporter/pulsarexporter
internal/rabbitmq
exporter/rabbitmqexporter
internal/splunk
pkg/batchperresourceattr
exporter/sapmexporter
exporter/sentryexporter
pkg/translator/signalfx
exporter/signalfxexporter
exporter/splunkhecexporter
extension/sumologicextension
exporter/sumologicexporter
exporter/syslogexporter
exporter/tencentcloudlogserviceexporter
receiver/zipkinreceiver
exporter/zipkinexporter
extension/ackextension
extension/asapauthextension
internal/aws/proxy
extension/awsproxy
extension/basicauthextension
extension/bearertokenauthextension
extension/encoding/avrologencodingextension
extension/encoding/jaegerencodingextension
extension/encoding/jsonlogencodingextension
extension/encoding/textencodingextension
extension/encoding/zipkinencodingextension
extension/googleclientauthextension
extension/headerssetterextension
extension/healthcheckextension
pkg/status
extension/healthcheckv2extension
extension/httpforwarderextension
extension/jaegerremotesampling
extension/oauth2clientauthextension
extension/observer
extension/observer/cfgardenobserver
extension/observer/dockerobserver
extension/observer/ecsobserver
extension/observer/ecstaskobserver
extension/observer/hostobserver
extension/observer/k8sobserver
extension/oidcauthextension
extension/opampcustommessages
extension/opampextension
extension/pprofextension
extension/remotetapextension
extension/sigv4authextension
extension/solarwindsapmsettingsextension
extension/storage/dbstorage
extension/storage/filestorage
processor/attributesprocessor
processor/cumulativetodeltaprocessor
processor/deltatocumulativeprocessor
processor/deltatorateprocessor
processor/filterprocessor
processor/geoipprocessor
processor/groupbyattrsprocessor
processor/groupbytraceprocessor
processor/intervalprocessor
processor/logdedupprocessor
processor/metricsgenerationprocessor
processor/metricstransformprocessor
processor/redactionprocessor
processor/remotetapprocessor
processor/resourceprocessor
processor/routingprocessor
processor/spanprocessor
processor/sumologicprocessor
pkg/winperfcounters
receiver/activedirectorydsreceiver
receiver/aerospikereceiver
receiver/apachereceiver
receiver/apachesparkreceiver
receiver/awscloudwatchreceiver
internal/aws/containerinsight
internal/aws/k8s
internal/kubelet
receiver/awscontainerinsightreceiver
receiver/awsecscontainermetricsreceiver
receiver/awsfirehosereceiver
receiver/awss3receiver
receiver/awsxrayreceiver
receiver/azureblobreceiver
pkg/translator/azure
pkg/translator/azurelogs
receiver/azureeventhubreceiver
receiver/azuremonitorreceiver
receiver/bigipreceiver
receiver/carbonreceiver
receiver/chronyreceiver
receiver/cloudflarereceiver
receiver/cloudfoundryreceiver
internal/collectd
receiver/collectdreceiver
receiver/couchdbreceiver
receiver/datadogreceiver
receiver/elasticsearchreceiver
receiver/expvarreceiver
receiver/filestatsreceiver
receiver/flinkmetricsreceiver
receiver/fluentforwardreceiver
receiver/githubreceiver
receiver/googlecloudmonitoringreceiver
receiver/googlecloudpubsubreceiver
receiver/googlecloudspannerreceiver
receiver/haproxyreceiver
receiver/httpcheckreceiver
receiver/iisreceiver
receiver/influxdbreceiver
receiver/jaegerreceiver
receiver/jmxreceiver
receiver/journaldreceiver
receiver/k8sclusterreceiver
receiver/k8seventsreceiver
receiver/k8sobjectsreceiver
receiver/kafkametricsreceiver
receiver/kafkareceiver
receiver/kubeletstatsreceiver
receiver/lokireceiver
receiver/memcachedreceiver
receiver/mongodbatlasreceiver
receiver/mongodbreceiver
receiver/mysqlreceiver
receiver/namedpipereceiver
receiver/nginxreceiver
receiver/nsxtreceiver
receiver/ntpreceiver
receiver/oracledbreceiver
receiver/otlpjsonfilereceiver
receiver/podmanreceiver
receiver/postgresqlreceiver
receiver/pulsarreceiver
receiver/purefareceiver
receiver/purefbreceiver
receiver/rabbitmqreceiver
receiver/receivercreator
receiver/redisreceiver
receiver/riakreceiver
receiver/sapmreceiver
receiver/signalfxreceiver
receiver/simpleprometheusreceiver
pkg/translator/skywalking
receiver/skywalkingreceiver
receiver/snmpreceiver
receiver/snowflakereceiver
receiver/solacereceiver
receiver/splunkenterprisereceiver
receiver/splunkhecreceiver
internal/sqlquery
receiver/sqlqueryreceiver
receiver/sqlserverreceiver
receiver/sshcheckreceiver
receiver/statsdreceiver
receiver/syslogreceiver
receiver/tcplogreceiver
receiver/udplogreceiver
receiver/vcenterreceiver
receiver/wavefrontreceiver
receiver/webhookeventreceiver
receiver/windowseventlogreceiver
receiver/windowsperfcountersreceiver
receiver/zookeeperreceiver
cmd/otelcontribcol
cmd/oteltestbedcol
cmd/telemetrygen
cmd/telemetrygen/internal/e2etest
confmap/provider/aesprovider
connector/signaltometricsconnector
examples/demo/client
examples/demo/server
exporter/datadogexporter/integrationtest
testbed/mockdatasenders/mockdatadogagentexporter
testbed
exporter/elasticsearchexporter/integrationtest
exporter/kineticaexporter
extension/cgroupruntimeextension
extension/storage/redisstorageextension
.
internal/aws/xray/testdata/sampleapp
internal/aws/xray/testdata/sampleserver
internal/tools
processor/coralogixprocessor
processor/logstransformprocessor
processor/schemaprocessor
receiver/awscloudwatchmetricsreceiver
receiver/huaweicloudcesreceiver
receiver/libhoneyreceiver
receiver/netflowreceiver
receiver/osqueryreceiver
receiver/prometheusremotewritereceiver
receiver/saphanareceiver
receiver/simpleprometheusreceiver/examples/federation/prom-counter
receiver/systemdreceiver
receiver/tlscheckreceiver
4 changes: 2 additions & 2 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/jstemmer/go-junit-report v1.0.0
go.opentelemetry.io/build-tools/checkfile v0.15.0
go.opentelemetry.io/build-tools/chloggen v0.15.0
go.opentelemetry.io/build-tools/crosslink v0.15.0
go.opentelemetry.io/build-tools/crosslink v0.16.0
go.opentelemetry.io/build-tools/issuegenerator v0.15.0
go.opentelemetry.io/build-tools/multimod v0.15.0
go.opentelemetry.io/collector/cmd/builder v0.117.0
Expand Down Expand Up @@ -233,7 +233,7 @@ require (
gitlab.com/bosi/decorder v0.4.2 // indirect
go-simpler.org/musttag v0.13.0 // indirect
go-simpler.org/sloglint v0.7.2 // indirect
go.opentelemetry.io/build-tools v0.15.0 // indirect
go.opentelemetry.io/build-tools v0.16.0 // indirect
go.opentelemetry.io/collector/component v0.117.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.117.0 // indirect
go.opentelemetry.io/collector/confmap v1.23.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions internal/tools/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85a2eb4

Please sign in to comment.