Skip to content

Commit

Permalink
Update update-go task to update go.work, and rework modules.go-work t…
Browse files Browse the repository at this point in the history
…o only synchronise used modules with modules.yml
  • Loading branch information
KevinFairise2 committed Dec 4, 2024
1 parent a9eac76 commit e522128
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 138 deletions.
250 changes: 125 additions & 125 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -4,129 +4,129 @@ toolchain go1.23.3

use (
.
comp/api/api/def
comp/api/authtoken
comp/core/config
comp/core/flare/builder
comp/core/flare/types
comp/core/hostname/hostnameinterface
comp/core/log/def
comp/core/log/impl
comp/core/log/impl-trace
comp/core/log/mock
comp/core/secrets
comp/core/status
comp/core/status/statusimpl
comp/core/tagger/tags
comp/core/tagger/types
comp/core/tagger/utils
comp/core/telemetry
comp/def
comp/forwarder/defaultforwarder
comp/forwarder/orchestrator/orchestratorinterface
comp/logs/agent/config
comp/netflow/payload
comp/otelcol/collector-contrib/def
comp/otelcol/collector-contrib/impl
comp/otelcol/converter/def
comp/otelcol/converter/impl
comp/otelcol/ddflareextension/def
comp/otelcol/ddflareextension/impl
comp/otelcol/logsagentpipeline
comp/otelcol/logsagentpipeline/logsagentpipelineimpl
comp/otelcol/otlp/components/exporter/datadogexporter
comp/otelcol/otlp/components/exporter/logsagentexporter
comp/otelcol/otlp/components/exporter/serializerexporter
comp/otelcol/otlp/components/metricsclient
comp/otelcol/otlp/components/processor/infraattributesprocessor
comp/otelcol/otlp/components/statsprocessor
comp/otelcol/otlp/testutil
comp/serializer/compression
comp/trace/agent/def
comp/trace/compression/def
comp/trace/compression/impl-gzip
comp/trace/compression/impl-zstd
internal/tools
internal/tools/independent-lint
internal/tools/modformatter
internal/tools/modparser
internal/tools/proto
pkg/aggregator/ckey
pkg/api
pkg/collector/check/defaults
pkg/config/env
pkg/config/mock
pkg/config/model
pkg/config/nodetreemodel
pkg/config/remote
pkg/config/setup
pkg/config/structure
pkg/config/teeconfig
pkg/config/utils
pkg/errors
pkg/gohai
pkg/linters/components/pkgconfigusage
pkg/logs/auditor
pkg/logs/client
pkg/logs/diagnostic
pkg/logs/message
pkg/logs/metrics
pkg/logs/pipeline
pkg/logs/processor
pkg/logs/sds
pkg/logs/sender
pkg/logs/sources
pkg/logs/status/statusinterface
pkg/logs/status/utils
pkg/logs/util/testutils
pkg/metrics
pkg/networkdevice/profile
pkg/obfuscate
pkg/orchestrator/model
pkg/process/util/api
pkg/proto
pkg/remoteconfig/state
pkg/security/secl
pkg/security/seclwin
pkg/serializer
pkg/status/health
pkg/tagger/types
pkg/tagset
pkg/telemetry
pkg/trace
pkg/trace/stats/oteltest
pkg/util/backoff
pkg/util/buf
pkg/util/cache
pkg/util/cgroups
pkg/util/common
pkg/util/containers/image
pkg/util/defaultpaths
pkg/util/executable
pkg/util/filesystem
pkg/util/flavor
pkg/util/fxutil
pkg/util/grpc
pkg/util/hostname/validate
pkg/util/http
pkg/util/json
pkg/util/log
pkg/util/log/setup
pkg/util/optional
pkg/util/pointer
pkg/util/scrubber
pkg/util/sort
pkg/util/startstop
pkg/util/statstracker
pkg/util/system
pkg/util/system/socket
pkg/util/testutil
pkg/util/utilizationtracker
pkg/util/uuid
pkg/util/winutil
pkg/version
test/fakeintake
test/new-e2e
test/otel
tools/retry_file_dump
./comp/api/api/def
./comp/api/authtoken
./comp/core/config
./comp/core/flare/builder
./comp/core/flare/types
./comp/core/hostname/hostnameinterface
./comp/core/log/def
./comp/core/log/impl
./comp/core/log/impl-trace
./comp/core/log/mock
./comp/core/secrets
./comp/core/status
./comp/core/status/statusimpl
./comp/core/tagger/tags
./comp/core/tagger/types
./comp/core/tagger/utils
./comp/core/telemetry
./comp/def
./comp/forwarder/defaultforwarder
./comp/forwarder/orchestrator/orchestratorinterface
./comp/logs/agent/config
./comp/netflow/payload
./comp/otelcol/collector-contrib/def
./comp/otelcol/collector-contrib/impl
./comp/otelcol/converter/def
./comp/otelcol/converter/impl
./comp/otelcol/ddflareextension/def
./comp/otelcol/ddflareextension/impl
./comp/otelcol/logsagentpipeline
./comp/otelcol/logsagentpipeline/logsagentpipelineimpl
./comp/otelcol/otlp/components/exporter/datadogexporter
./comp/otelcol/otlp/components/exporter/logsagentexporter
./comp/otelcol/otlp/components/exporter/serializerexporter
./comp/otelcol/otlp/components/metricsclient
./comp/otelcol/otlp/components/processor/infraattributesprocessor
./comp/otelcol/otlp/components/statsprocessor
./comp/otelcol/otlp/testutil
./comp/serializer/compression
./comp/trace/agent/def
./comp/trace/compression/def
./comp/trace/compression/impl-gzip
./comp/trace/compression/impl-zstd
./internal/tools
./internal/tools/independent-lint
./internal/tools/modformatter
./internal/tools/modparser
./internal/tools/proto
./pkg/aggregator/ckey
./pkg/api
./pkg/collector/check/defaults
./pkg/config/env
./pkg/config/mock
./pkg/config/model
./pkg/config/nodetreemodel
./pkg/config/remote
./pkg/config/setup
./pkg/config/structure
./pkg/config/teeconfig
./pkg/config/utils
./pkg/errors
./pkg/gohai
./pkg/linters/components/pkgconfigusage
./pkg/logs/auditor
./pkg/logs/client
./pkg/logs/diagnostic
./pkg/logs/message
./pkg/logs/metrics
./pkg/logs/pipeline
./pkg/logs/processor
./pkg/logs/sds
./pkg/logs/sender
./pkg/logs/sources
./pkg/logs/status/statusinterface
./pkg/logs/status/utils
./pkg/logs/util/testutils
./pkg/metrics
./pkg/networkdevice/profile
./pkg/obfuscate
./pkg/orchestrator/model
./pkg/process/util/api
./pkg/proto
./pkg/remoteconfig/state
./pkg/security/secl
./pkg/security/seclwin
./pkg/serializer
./pkg/status/health
./pkg/tagger/types
./pkg/tagset
./pkg/telemetry
./pkg/trace
./pkg/trace/stats/oteltest
./pkg/util/backoff
./pkg/util/buf
./pkg/util/cache
./pkg/util/cgroups
./pkg/util/common
./pkg/util/containers/image
./pkg/util/defaultpaths
./pkg/util/executable
./pkg/util/filesystem
./pkg/util/flavor
./pkg/util/fxutil
./pkg/util/grpc
./pkg/util/hostname/validate
./pkg/util/http
./pkg/util/json
./pkg/util/log
./pkg/util/log/setup
./pkg/util/optional
./pkg/util/pointer
./pkg/util/scrubber
./pkg/util/sort
./pkg/util/startstop
./pkg/util/statstracker
./pkg/util/system
./pkg/util/system/socket
./pkg/util/testutil
./pkg/util/utilizationtracker
./pkg/util/uuid
./pkg/util/winutil
./pkg/version
./test/fakeintake
./test/new-e2e
./test/otel
./tools/retry_file_dump
)
17 changes: 4 additions & 13 deletions tasks/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,13 @@ def generate_dummy_package(ctx, folder):


@task
def go_work(_: Context):
def go_work(ctx: Context):
"""
Re-create the go.work file using the module list contained in get_default_modules()
and the go version contained in the file .go-version.
Update the go work to use all the modules defined in modules.yml
"""

# read go version from the .go-version file, removing the bugfix part of the version

with open(".go-version") as f:
go_version = f.read().strip()

with open("go.work", "w") as f:
f.write(f"go {go_version}\n\nuse (\n")
for mod in get_default_modules().values():
f.write(f"\t{mod.path}\n")
f.write(")\n")
for mod in get_default_modules().values():
ctx.run("go work use " + mod.path)


@task
Expand Down
2 changes: 2 additions & 0 deletions tasks/update_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
("./pkg/logs/launchers/windowsevent/README.md", "install go ", "+,", False),
("./.wwhrd.yml", "raw.githubusercontent.com/golang/go/go", "/LICENSE", True),
("./docs/public/setup.md", "version `", "` or later", True),
("./go.work", "go ", "", False),
("./go.work", "toolchain go", "", True),
]

PATTERN_MAJOR_MINOR = r'1\.\d+'
Expand Down

0 comments on commit e522128

Please sign in to comment.