-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
205 lines (180 loc) · 6.07 KB
/
Copy pathMODULE.bazel
File metadata and controls
205 lines (180 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Unless explicitly stated otherwise all files in this repository are licensed under
# the Apache 2.0 License.
#
# This product includes software developed at Datadog
# (https://www.datadoghq.com/) Copyright 2025-Present Datadog, Inc.
module(
name = "datadog-rules-test-optimization",
version = "1.2.0",
)
# Platforms is needed for cross-platform test execution detection
bazel_dep(name = "platforms", version = "1.0.0")
# Test utilities for Starlark unit tests
bazel_dep(name = "bazel_skylib", version = "1.8.2")
# Dev-only dependency for shell-based unit tests in this repository.
bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = True)
# Dev-only dependency for in-repo example builds that compile Go targets.
# Consumer-facing core usage remains rules_go-free.
bazel_dep(name = "rules_go", version = "0.60.0", dev_dependency = True)
local_path_override(
module_name = "rules_go",
path = "third_party/rgo/v0_60_0/base",
)
# Dev-only dependency for in-repo Python companion/example builds.
bazel_dep(name = "rules_python", version = "1.7.0", dev_dependency = True)
# Dev-only dependency for in-repo Java companion/example builds.
bazel_dep(name = "rules_java", version = "8.14.0", dev_dependency = True)
# Dev-only dependencies for in-repo NodeJS/.NET/Ruby companion/example builds.
bazel_dep(name = "aspect_rules_js", version = "3.0.0-rc5", dev_dependency = True)
bazel_dep(name = "rules_nodejs", version = "6.7.3", dev_dependency = True)
bazel_dep(name = "rules_dotnet", version = "0.21.5", dev_dependency = True)
bazel_dep(name = "rules_ruby", version = "0.21.1", dev_dependency = True)
# Dev-only local wiring for companion module loads from this repository root.
go_bootstrap = use_extension(
"//tools/dev:go_bootstrap.bzl",
"go_bootstrap_extension",
dev_dependency = True,
)
go_bootstrap.local_go_companion(
name = "datadog-rules-test-optimization-go",
path = "modules/go",
)
use_repo(go_bootstrap, "datadog-rules-test-optimization-go")
python_bootstrap = use_extension(
"//tools/dev:python_bootstrap.bzl",
"python_bootstrap_extension",
dev_dependency = True,
)
python_bootstrap.local_python_companion(
name = "datadog-rules-test-optimization-python",
path = "modules/python",
)
use_repo(python_bootstrap, "datadog-rules-test-optimization-python")
java_bootstrap = use_extension(
"//tools/dev:java_bootstrap.bzl",
"java_bootstrap_extension",
dev_dependency = True,
)
java_bootstrap.local_java_companion(
name = "datadog-rules-test-optimization-java",
path = "modules/java",
)
use_repo(java_bootstrap, "datadog-rules-test-optimization-java")
nodejs_bootstrap = use_extension(
"//tools/dev:nodejs_bootstrap.bzl",
"nodejs_bootstrap_extension",
dev_dependency = True,
)
nodejs_bootstrap.local_nodejs_companion(
name = "datadog-rules-test-optimization-nodejs",
path = "modules/nodejs",
)
use_repo(nodejs_bootstrap, "datadog-rules-test-optimization-nodejs")
dotnet_bootstrap = use_extension(
"//tools/dev:dotnet_bootstrap.bzl",
"dotnet_bootstrap_extension",
dev_dependency = True,
)
dotnet_bootstrap.local_dotnet_companion(
name = "datadog-rules-test-optimization-dotnet",
path = "modules/dotnet",
)
use_repo(dotnet_bootstrap, "datadog-rules-test-optimization-dotnet")
ruby_bootstrap = use_extension(
"//tools/dev:ruby_bootstrap.bzl",
"ruby_bootstrap_extension",
dev_dependency = True,
)
ruby_bootstrap.local_ruby_companion(
name = "datadog-rules-test-optimization-ruby",
path = "modules/ruby",
)
use_repo(ruby_bootstrap, "datadog-rules-test-optimization-ruby")
# Dev-only toolchain wiring so //examples/... can run from this repository root.
node = use_extension(
"@rules_nodejs//nodejs:extensions.bzl",
"node",
dev_dependency = True,
)
node.toolchain(node_version = "22.22.0")
use_repo(node, "nodejs", "nodejs_host", "nodejs_toolchains")
register_toolchains(
"@nodejs_toolchains//:all",
dev_dependency = True,
)
dotnet = use_extension(
"@rules_dotnet//dotnet:extensions.bzl",
"dotnet",
dev_dependency = True,
)
dotnet.toolchain(
name = "dotnet",
dotnet_version = "8.0.100",
)
use_repo(dotnet, "dotnet_toolchains")
register_toolchains(
"@dotnet_toolchains//:all",
dev_dependency = True,
)
ruby = use_extension(
"@rules_ruby//ruby:extensions.bzl",
"ruby",
dev_dependency = True,
)
ruby.toolchain(
name = "ruby",
version = "3.3.9",
)
use_repo(ruby, "ruby", "ruby_toolchains")
register_toolchains(
"@ruby_toolchains//:all",
dev_dependency = True,
)
# Dev-only Python toolchain and pip dependencies for //examples/... pytest targets.
python = use_extension(
"@rules_python//python/extensions:python.bzl",
"python",
dev_dependency = True,
)
python.toolchain(python_version = "3.12")
pip = use_extension(
"@rules_python//python/extensions:pip.bzl",
"pip",
dev_dependency = True,
)
pip.parse(
experimental_index_url = "https://pypi.org/simple",
hub_name = "example_pip",
python_version = "3.12",
requirements_lock = "//examples/single_service/src/python-project:requirements_lock.txt",
)
use_repo(pip, "example_pip")
# Dev-only: dd-java-agent master build for the Java example. No sha256 pin —
# the S3 object tracks the branch head.
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_file(
name = "dd_java_agent",
downloaded_file_path = "dd-java-agent.jar",
urls = ["https://s3.us-east-1.amazonaws.com/dd-trace-java-builds/master/dd-java-agent.jar"],
)
# Dev-only stub repository so //examples/... can be analyzed from this root
# workspace without fetching real Datadog data.
example_stub_repo = use_extension(
"//tools/tests:example_stub_repo.bzl",
"example_stub_repo_extension",
dev_dependency = True,
)
example_stub_repo.example_stub_repo(
name = "test_optimization_data",
service_keys = [
"go_service",
"go_service_a",
"go_service_b",
"python_service",
"java_service",
"nodejs_service",
"dotnet_service",
"ruby_service",
],
)
use_repo(example_stub_repo, "test_optimization_data")