diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d830458da194..cf6d1d2d4302 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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 diff --git a/Makefile b/Makefile index 176ba2b07f85..3a2ddfdc1645 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/internal/tidylist/allow-circular.txt b/internal/tidylist/allow-circular.txt new file mode 100644 index 000000000000..26b23b684f53 --- /dev/null +++ b/internal/tidylist/allow-circular.txt @@ -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 diff --git a/internal/tidylist/tidylist.txt b/internal/tidylist/tidylist.txt new file mode 100644 index 000000000000..98f2ac54be41 --- /dev/null +++ b/internal/tidylist/tidylist.txt @@ -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 \ No newline at end of file diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 9bdc7b0dfe35..19632b70f6a8 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -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 @@ -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 diff --git a/internal/tools/go.sum b/internal/tools/go.sum index a744c63f9fde..11dbc7064d38 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -564,14 +564,14 @@ go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= -go.opentelemetry.io/build-tools v0.15.0 h1:SJFD+MSKKrSIP0oujmmY/zRi8TgVFzUc1080nIBmRzA= -go.opentelemetry.io/build-tools v0.15.0/go.mod h1:xyjzzjE7WEtBPVqZ0BwC8RxbGGW3DkD33YFgVLkvOUs= +go.opentelemetry.io/build-tools v0.16.0 h1:KxKRH+jOSNbRDRESkibfpaKmaVb1GsXhf0pQfPZE5zI= +go.opentelemetry.io/build-tools v0.16.0/go.mod h1:ZhuNyO/aAkGEFTfNhH7Nhv7fIWpxIOp8t7XshpPWiOU= go.opentelemetry.io/build-tools/checkfile v0.15.0 h1:C4qF0t+CMgkNdj125SKwpjjX6RG+NW75KdF9KigbaXk= go.opentelemetry.io/build-tools/checkfile v0.15.0/go.mod h1:UbB2iej3/BOBeK+796FGUSP1Yu6ppq2SoklGBspQp/E= go.opentelemetry.io/build-tools/chloggen v0.15.0 h1:G5UeYUgP6x4QXie0yNs/6TjK9nCuuVXgXeDWE9/cxQQ= go.opentelemetry.io/build-tools/chloggen v0.15.0/go.mod h1:oovDPiOQS4iruTVH469/68hEYjWC48c8u+qJpWJc8Eg= -go.opentelemetry.io/build-tools/crosslink v0.15.0 h1:cGwaVTtYi4wUQrQss8i9qmSoE9x7JXj9ou3JNMIe0nw= -go.opentelemetry.io/build-tools/crosslink v0.15.0/go.mod h1:BB5bv1xmtugy4lL9IWE9zNbpwtRwoFRdM8JmusHs3xw= +go.opentelemetry.io/build-tools/crosslink v0.16.0 h1:7Y5QPt5TR3qpiW5bwIOnsCJdt1yjZSFDPKtjt2g2zHw= +go.opentelemetry.io/build-tools/crosslink v0.16.0/go.mod h1:xogE6iWmt53bsDazb81dQrZw9TQ30+9hc4D8QfVG9aA= go.opentelemetry.io/build-tools/issuegenerator v0.15.0 h1:M2cnoXKf0yRmZ7SO2mOYYpiKtOWZyFZnnAHzQhgFeIw= go.opentelemetry.io/build-tools/issuegenerator v0.15.0/go.mod h1:GW53mhELVGByYf/Z6K3I4Ll37osqGY7w/r9mmu9VG1g= go.opentelemetry.io/build-tools/multimod v0.15.0 h1:mF4+7rf0uW06VhentAI9puZZoTKa9I9s7IXGgLSTD+E=