You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Run `modules.add-all-replace` after `tidy`, not before.**`collector.generate` rewrites
89
+
> `comp/otelcol/collector-contrib/impl/go.mod` with short-form replace paths
90
+
> (`=> ../../../logs-library`) where the repo standard is the canonical form
91
+
> (`=> ../../../../comp/logs-library`). Running `add-all-replace` before `tidy` leaves the short
92
+
> form in place and `check_modules_replace` fails in CI. Verify it converged by re-running it and
93
+
> confirming no `go.mod` changes.
94
+
95
+
> **`read_old_version` trusts the OCB manifest, which can be stale.**`collector.update`
96
+
> search-replaces the version recorded in `comp/otelcol/collector-contrib/impl/manifest.yaml`.
97
+
> If someone bumped the Go deps directly without running `collector.update` (as #53984 did), the
98
+
> manifest lags and every file referencing the *actual* previous version is silently skipped.
99
+
> Always compare the manifest version against a real dependency before trusting the bump:
100
+
> `grep 'otelcol v' go.mod`.
101
+
88
102
If a **specific version** was requested, skip `inv collector.update` and do a repo-wide search-and-replace of the old version string (find it in `tasks/collector.py` — the `OCB_VERSION` / `OTEL_CONTRIB_VERSION` constants). Then run the remaining commands above.
89
103
90
104
After the commands finish, scan for any files the task missed:
@@ -106,9 +120,11 @@ This is the **most common failure**. The DD flare extension tests compare OTel r
106
120
Run the test locally to get the actual diff:
107
121
108
122
```bash
109
-
dda inv test --targets=./comp/otelcol/ddflareextension/impl/... --build-include=otlp -- -run TestGetConfDump
123
+
dda inv test --targets=./comp/otelcol/ddflareextension/impl/... --build-include=test,otlp -- -run TestGetConfDump
110
124
```
111
125
126
+
> **The `test` tag is required.**`--build-include`*replaces* the default build-tag set rather than adding to it. With only `otlp`, the files gated behind `//go:build test` (`configstore_test.go`, `extension_test.go`, `factory_test.go`) never compile, so `-run TestGetConfDump` matches nothing — the run still reports "ALL TESTS PASSED" from the handful of untagged tests. Confirm the test really ran by checking `test_output.json` for `"Test":"TestGetConfDump"`.
127
+
112
128
The failure output shows exactly which lines differ. Apply the diffs to the golden files in:
113
129
-`comp/otelcol/ddflareextension/impl/testdata/` (unit test golden files)
114
130
-`test/new-e2e/tests/otel/otel-agent/testdata/` (E2E test golden files — apply the **same changes**)
@@ -169,9 +185,40 @@ Then run `dda inv tidy` again. Use this only when upgrading the Agent code is no
169
185
170
186
```bash
171
187
dda inv linter.go --targets=./comp/otelcol/... # lint the changed OTel components
172
-
dda inv test --targets=./comp/otelcol/ddflareextension/impl/... --build-include=otlp # confirm tests pass
188
+
dda inv test --targets=./comp/otelcol/ddflareextension/impl/... --build-include=test,otlp # confirm tests pass
189
+
```
190
+
191
+
> **`--targets=./comp/otelcol/...` only covers the root module.** Several OTel packages are
192
+
> *separate Go modules* and are invisible to that invocation — it will report "0 issues" while
193
+
> they are silently unlinted. An upstream API change typically breaks exactly these. Lint each one
# Explicit local-only config: disable the remote cache while keeping the
102
+
# wrapper-injected --disk_cache. Use `--config=no-remote-cache` (or
103
+
# DD_BAZEL_REMOTE_CACHE=off) to opt out of tools/bazel auto-selection.
104
+
common:no-remote-cache --remote_cache=
105
+
101
106
# CI config ------------------------------------------------------------------------------------------------------------
102
107
common:ci --config=adms
103
108
common:ci --config=lint
104
109
common:ci --noexperimental_convenience_symlinks # not CI-suitable: "These symlinks are only for the user's convenience"
105
110
common:ci --remote_download_regex=.*/test\.xml$ # force-download test.xml even under --remote_download_outputs=toplevel, so junit collection can read it locally
bazel test --keep_going --config=no-dd-agent-go-tests
77
-
//... --
80
+
bazel test --config=gorace --config=no-dd-agent-go-tests --keep_going //... --
78
81
-//bazel/rules/dd_packaging/...
79
82
-//packages/agent/linux/...
80
83
81
-
# Per-flavor test jobs. Each runs the tests for one agent flavor, mirroring the
82
-
# dda inv test --flavor=<f> topology. --config=<flavor> sets
83
-
# --test_tag_filters=flavor_<flavor>, selecting only the matching go_test variants.
84
-
.bazel:test:flavor:
85
-
extends: [ .bazel:test, .bazel:test:reporting ]
86
-
script:
87
-
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || echo 'Failed to fetch an API key, no metrics will be emitted'; export DD_API_KEY
0 commit comments