Skip to content

Commit 19df108

Browse files
authored
chore(beyla.ebpf): Improve instructions for agentic beyla upgrades (#5975)
### Pull Request Details The workflow that creates automatic upgrades for `beyla.ebpf` component work properly but it missed some steps. This PR fixes some of the issues. ### PR Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [ ] Documentation added - [ ] Tests updated - [ ] Config converters updated
1 parent 0495682 commit 19df108

1 file changed

Lines changed: 32 additions & 52 deletions

File tree

.github/workflows/agent_bump_beyla.yml

Lines changed: 32 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,15 @@ jobs:
109109
- `collector/builder-config.yaml`
110110
- `dependency-replacements.yaml`
111111
- `collector/go.mod`
112+
- `extension/alloyengine/go.mod`
112113
- `go.mod`
113114
- `docs/sources/_index.md.t`
114115
- `internal/component/beyla/ebpf/args.go`
115116
- `internal/component/beyla/ebpf/beyla_linux.go`
116117
- `internal/component/beyla/ebpf/beyla_linux_test.go`
117118
- `docs/sources/reference/components/beyla/beyla.ebpf.md`
118119
119-
`go.sum` and `collector/go.sum` may change only if required by module updates.
120+
`go.sum`, `collector/go.sum`, and `extension/alloyengine/go.sum` may change only if required by module updates.
120121
121122
## Required contents of `.github/agent-output/plan.md`
122123
@@ -128,6 +129,8 @@ jobs:
128129
- Risks or likely failure points
129130
130131
Include the exact Beyla module version and OBI pseudo-version you resolved, identify the new fields or behavior Alloy needs for parity, and list the exact commands the implementation job should run to verify the change.
132+
If the implementation is likely to introduce any new helper, converter, or validator functions, call out the unit tests that must be added for them.
133+
If Beyla's OpenTelemetry dependency versions diverge from Alloy's current versions, call that out as expected drift and do not propose resolving it in this task.
131134
132135
- name: Upload plan artifact
133136
if: always()
@@ -212,15 +215,6 @@ jobs:
212215
git config user.name "${APP_LOGIN}"
213216
git config user.email "${APP_ID}+${APP_LOGIN}@users.noreply.github.com"
214217
215-
- name: Prepare implementation outputs
216-
run: |
217-
mkdir -p .github/agent-output
218-
cat > .github/agent-output/implement-status.md <<'EOF'
219-
# Beyla update implementation status
220-
221-
State: not started
222-
EOF
223-
224218
- name: Run Claude Code implement job
225219
uses: anthropics/claude-code-action@cd77b50d2b0808657f8e6774085c8bf54484351c # v1.0.72
226220
env:
@@ -241,7 +235,6 @@ jobs:
241235
**Branch from**: `${{ inputs.source_ref }}`
242236
**Repository**: `grafana/alloy`
243237
**Plan file**: `.github/agent-input/plan.md`
244-
**Status file**: `.github/agent-output/implement-status.md`
245238
246239
Your job is to implement the Beyla update described in `.github/agent-input/plan.md`, verify it locally, and open a **draft PR** only after tests pass.
247240
@@ -254,60 +247,60 @@ jobs:
254247
If there are no changes to make, do not open a PR.
255248
If verification fails, do not open a PR.
256249
257-
## Status tracking
258-
259-
Keep `.github/agent-output/implement-status.md` updated throughout the run so a human can continue from it if this job fails.
260-
261-
Update that file:
262-
- before making changes, with the plan you are executing
263-
- after each major edit batch
264-
- after each verification cycle
265-
- whenever a command fails, including the exact command and a short failure summary
266-
- at the end, with the final outcome
267-
268-
The status file should stay concise, but it must include what you tried, what failed, and what remains to do.
269-
270250
## Files to update
271251
272252
Update only what is required in these files:
273253
- `collector/builder-config.yaml`
274254
- `dependency-replacements.yaml`
275255
- `collector/go.mod`
256+
- `extension/alloyengine/go.mod`
276257
- `go.mod`
277258
- `docs/sources/_index.md.t`
278259
- `internal/component/beyla/ebpf/args.go`
279260
- `internal/component/beyla/ebpf/beyla_linux.go`
280261
- `internal/component/beyla/ebpf/beyla_linux_test.go`
281262
- `docs/sources/reference/components/beyla/beyla.ebpf.md`
282263
283-
You may also update `go.sum` or `collector/go.sum` if the module changes require it. Do not touch unrelated files.
264+
You may also update `go.sum`, `collector/go.sum`, or `extension/alloyengine/go.sum` if the module changes require it. Do not touch unrelated files.
265+
Do not create, stage, or commit `.github/agent-output/implement-status.md` or any similar tracking file.
266+
Prefer updating source-of-truth files and then using the repo Make targets to regenerate derived module files. Do not hand-edit `collector/go.mod` when `make generate-otel-collector-distro` can regenerate it.
284267
285268
## Implementation requirements
286269
287270
1. Bump the OBI replacement version derived from Beyla's pinned `.obi-src` SHA in:
288271
- `collector/builder-config.yaml`
289272
- `dependency-replacements.yaml`
290-
- `collector/go.mod`
291273
292274
2. Bump the Beyla version in:
275+
- `extension/alloyengine/go.mod`
293276
- `go.mod`
294277
- `docs/sources/_index.md.t`
295278
296-
3. After bumping module versions, run:
297-
- `go mod tidy`
298-
- `(cd collector && go mod tidy)`
279+
3. After updating the source-of-truth files, run:
280+
- `make generate-module-dependencies`
281+
- `make generate-otel-collector-distro`
282+
283+
4. Review and keep the generated module changes produced by those Make targets as needed, including:
284+
- `collector/go.mod`
285+
- `collector/go.sum`
286+
- `go.mod`
287+
- `go.sum`
288+
- `extension/alloyengine/go.mod`
289+
- `extension/alloyengine/go.sum`
299290
300-
4. Compare the current Alloy Beyla integration against the target Beyla release and add any newly added fields needed for parity in:
291+
5. Compare the current Alloy Beyla integration against the target Beyla release and add any newly added fields needed for parity in:
301292
- `internal/component/beyla/ebpf/args.go`
302293
- `internal/component/beyla/ebpf/beyla_linux.go`
303294
- `internal/component/beyla/ebpf/beyla_linux_test.go`
304295
- `docs/sources/reference/components/beyla/beyla.ebpf.md`
305296
306-
5. When determining newly added fields, inspect the relevant Beyla changes instead of guessing. Update only fields and behavior that are newly required for this release.
297+
6. When determining newly added fields, inspect the relevant Beyla changes instead of guessing. Update only fields and behavior that are newly required for this release.
307298
308-
6. In `beyla_linux.go`, add matching convert and validate logic for the new fields, preserving existing defaults and zero-value behavior.
299+
7. In `beyla_linux.go`, add matching convert and validate logic for the new fields, preserving existing defaults and zero-value behavior.
309300
310-
7. In `beyla_linux_test.go`, add focused tests for the new fields and any new validation behavior.
301+
8. In `beyla_linux_test.go`, add focused tests for the new fields and any new validation behavior.
302+
9. Every newly added function must have focused unit test coverage. If you add a helper, converter, or validator function, add or extend tests that exercise that function directly instead of relying only on broader end-to-end behavior.
303+
10. If Beyla's OpenTelemetry dependency versions differ from Alloy's current versions after the bump, leave that divergence in place and mention it in the PR body instead of trying to reconcile it here.
311304
312305
## Style constraints
313306
@@ -317,10 +310,13 @@ jobs:
317310
- Preserve field ordering and naming patterns where possible.
318311
- Keep docs concise and consistent with existing wording and table format.
319312
- Do not add compatibility shims unless they are strictly required by the target Beyla release.
313+
- Do not introduce a new function without also introducing the unit test coverage for it.
314+
- `make alloy` is fine as a build check, but it does not replace `make generate-module-dependencies` or `make generate-otel-collector-distro` for dependency and collector regeneration.
320315
321316
## Verification
322317
323318
Run the following after editing:
319+
- `SKIP_UI_BUILD=1 make alloy`
324320
- `go test ./internal/component/beyla/ebpf/...`
325321
326322
Fix any failures caused by your changes before continuing.
@@ -330,15 +326,16 @@ jobs:
330326
- Create a branch named `agent/bump-beyla-${{ inputs.beyla_release_tag }}`
331327
- **Do not stage or commit files under `.github/agent-output/`.**
332328
Before committing, run `git reset HEAD .github/agent-output` (if staged) and add `.github/agent-output/` to `.git/info/exclude`.
333-
- Commit with message `chore(beyla): Bump to ${{ inputs.beyla_release_tag }}`
329+
- Commit with message `feat(beyla.ebpf): Bump to ${{ inputs.beyla_release_tag }}`
334330
- Push the branch to `origin`
335331
- Open a **draft PR** against `${{ inputs.source_ref }}`
336-
- Use a conventional PR title, for example `chore(beyla): Bump to ${{ inputs.beyla_release_tag }}`
332+
- Use a conventional PR title, for example `feat(beyla.ebpf): Bump to ${{ inputs.beyla_release_tag }}`
337333
338334
Use a concise PR body that summarizes:
339335
- the Beyla version bump
340336
- the OBI replacement bump
341337
- any newly mapped Beyla fields
338+
- any expected OpenTelemetry version divergence that is intentionally left for a follow-up task
342339
343340
## Dependency review notice
344341
@@ -356,20 +353,3 @@ jobs:
356353
List the affected modules and their version changes in that section.
357354
358355
Do not force-push. Do not open a non-draft PR.
359-
360-
- name: Upload implementation status artifact
361-
if: always()
362-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
363-
with:
364-
name: beyla-update-implementation-status
365-
path: .github/agent-output/implement-status.md
366-
if-no-files-found: warn
367-
368-
- name: Add implementation status to job summary
369-
if: always()
370-
run: |
371-
{
372-
echo "## Beyla update implementation status"
373-
echo
374-
cat .github/agent-output/implement-status.md
375-
} >> "${GITHUB_STEP_SUMMARY}"

0 commit comments

Comments
 (0)