Skip to content

Commit 7431eaa

Browse files
committed
Modernize: Go modules + libbeat v7.17.29, and full SDLC/CI hygiene (#2)
* Migrate from glide/GOPATH vendoring to Go modules Replace the abandoned glide + libbeat-Makefile vendoring with a standard Go module targeting Go 1.26 and Elastic libbeat v7.17.29 (the last maintained v7 line, keeping the libbeat/... import paths). Dependency notes: - Mirror elastic/beats' own replace directives into go.mod; Go modules do not apply a dependency's replaces transitively, so consumers of libbeat must copy them (Shopify/sarama, fsnotify, gopacket, etc.). - Pin txn2/rxtx to v1.3.2 (the exact prod revision) to preserve the rtq.MessageBatch wire format. Pin its 2018-era transitive deps coreos/bbolt and satori/go.uuid to the commits prod ran, since the newer tags renamed the bbolt package and changed uuid.NewV4's signature, breaking rtq's source under modern MVS. libbeat v7.17 API drift: - beat.ClientConfig.ACKCount removed; use acker.RawCounting. - cmd.GenRootCmd removed; use GenRootCmdWithSettings + instance.Settings. - logp.Error removed; route the unmarshal error to the zap logger. Housekeeping in the same pass: - io/ioutil -> io, fix the lost context cancel in shutdown. - Guard main_test.go flag lookups against nil (test flags register lazily on modern Go, which panicked at init()). Build, vet, and tests pass; binary reports libbeat 7.17.29. * Add modern SDLC and project hygiene Bring rtbeat in line with the txn2/kubefwd and mcp-data-platform conventions, replacing the abandoned beats/Travis tooling. CI/CD (GitHub Actions, all action refs SHA-pinned): - ci.yml: lint (golangci-lint v2.12.1), test matrix (ubuntu+macos, -race + coverage to Codecov), build + goreleaser check. - release.yml: GoReleaser v2 on tag push — Cosign keyless signing, SBOMs, multi-arch Docker, SLSA provenance. - codeql.yml, scorecard.yml, docs.yml (MkDocs to GitHub Pages), dependabot.yml. Tooling/config: - .golangci.yml (v2) with a clean lint baseline; fixed the findings in beater/rtbeat.go (errcheck, gocritic, ineffassign, revive, staticcheck). - Makefile: `make verify` mirrors CI (go-version + tidy-check + lint + test + validate-actions); auto-installs the pinned linter to .tools/. - scripts/validate-action-shas.sh enforces SHA-pinned actions. - .goreleaser.yml rewritten to v2 (static CGO-free builds, version stamped into libbeat/version); modern multi-arch Dockerfile replaces the per-arch dockerfiles/. - codecov.yml, .gitignore updates; stop tracking the libbeat runtime data/meta.json. Docs & community: - SECURITY.md, CODE_OF_CONDUCT.md, CONTRIBUTING.md, CHANGELOG.md, CLAUDE.md, CODEOWNERS, issue/PR templates. - MkDocs site (mkdocs.yml + docs/) and a modernized README. Retired: .travis.yml, the libbeat-generated Makefile, glide-era and per-arch Docker tooling. make verify passes; mkdocs build --strict passes. * Harden deps from adversarial review Two fixes surfaced by an adversarial review of the modernization: - go.mod: mirror the full 15-directive replace block from elastic/beats/v7@v7.17.29 (previously only 7). We import few libbeat packages today, but keeping the complete upstream set means a future dependency bump that pulls in more of beats won't break against a fork-expecting package (e.g. docker/docker => docker/engine). - .goreleaser.yml: document that `brews:` is valid on the CI-pinned goreleaser line (~> v2.13) but deprecated as of v2.16, so the key must be migrated before bumping the goreleaser-action pin. make verify passes; binary still reports libbeat 7.17.29.
1 parent c80bc1c commit 7431eaa

24,128 files changed

Lines changed: 3266 additions & 6810543 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Default owners for everything in the repo
2+
* @cjimti
3+
4+
# Beat implementation
5+
/beater/ @cjimti
6+
/cmd/ @cjimti
7+
/config/ @cjimti
8+
9+
# Documentation
10+
/docs/ @cjimti
11+
*.md @cjimti
12+
13+
# CI/CD and release configuration
14+
/.github/ @cjimti
15+
.goreleaser.yml @cjimti
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior in rtbeat
3+
labels: ["bug", "triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to report a bug! Please fill out the information below to help us diagnose and fix the issue.
9+
10+
- type: input
11+
id: version
12+
attributes:
13+
label: rtbeat version
14+
description: Output of `rtbeat version`
15+
placeholder: "rtbeat version 7.17.29 (amd64), libbeat 7.17.29"
16+
validations:
17+
required: true
18+
19+
- type: input
20+
id: elastic-version
21+
attributes:
22+
label: Elastic Stack version
23+
description: Version of Elasticsearch / Kibana / Logstash that rtbeat outputs to
24+
placeholder: "Elasticsearch 7.17.29, Kibana 7.17.29"
25+
validations:
26+
required: true
27+
28+
- type: dropdown
29+
id: os
30+
attributes:
31+
label: Operating System
32+
options:
33+
- macOS (Apple Silicon)
34+
- macOS (Intel)
35+
- Linux (Ubuntu/Debian)
36+
- Linux (RHEL/CentOS/Fedora)
37+
- Linux (Other)
38+
- Windows
39+
- Docker container
40+
validations:
41+
required: true
42+
43+
- type: dropdown
44+
id: deployment
45+
attributes:
46+
label: How is rtbeat deployed?
47+
options:
48+
- Standalone binary
49+
- Docker container
50+
- Kubernetes
51+
- Built from source
52+
- Other
53+
validations:
54+
required: true
55+
56+
- type: textarea
57+
id: description
58+
attributes:
59+
label: Bug Description
60+
description: What happened? What did you expect to happen?
61+
placeholder: |
62+
Expected behavior:
63+
...
64+
65+
Actual behavior:
66+
...
67+
validations:
68+
required: true
69+
70+
- type: textarea
71+
id: steps
72+
attributes:
73+
label: Steps to Reproduce
74+
description: Minimal steps to reproduce the bug
75+
placeholder: |
76+
1. Start rtbeat with `./rtbeat -c rtbeat.yml -e`
77+
2. POST a rxtx MessageBatch to http://localhost:8081/in
78+
3. ...
79+
validations:
80+
required: true
81+
82+
- type: textarea
83+
id: logs
84+
attributes:
85+
label: Verbose Logs
86+
description: Output from running rtbeat with debug logging enabled (optional but very helpful)
87+
render: shell
88+
placeholder: |
89+
Paste output from: ./rtbeat -c rtbeat.yml -e -d "*"
90+
91+
- type: textarea
92+
id: config
93+
attributes:
94+
label: Configuration
95+
description: Relevant portions of your rtbeat.yml (redact any credentials, hosts, or secrets)
96+
render: yaml
97+
placeholder: |
98+
rtbeat:
99+
port: "8081"
100+
timeout: 5
101+
102+
output.elasticsearch:
103+
hosts: ["localhost:9200"]
104+
105+
- type: checkboxes
106+
id: checklist
107+
attributes:
108+
label: Checklist
109+
options:
110+
- label: I have searched existing issues to ensure this bug hasn't already been reported
111+
required: true
112+
- label: I have removed any credentials or secrets from the config and logs above
113+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions & Discussions
4+
url: https://github.com/txn2/rtbeat/discussions
5+
about: Please ask questions and share ideas in GitHub Discussions instead of opening issues
6+
- name: Documentation
7+
url: https://github.com/txn2/rtbeat/blob/master/README.md
8+
about: Check the README for setup, configuration, and usage details
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
labels: ["enhancement"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
**Important:** While we appreciate feature suggestions, feature development is currently limited to maintainers and trusted contributors.
9+
10+
We welcome community contributions for:
11+
- Bug fixes
12+
- Tests
13+
- Documentation improvements
14+
- Stability and compatibility enhancements
15+
16+
- type: textarea
17+
id: problem
18+
attributes:
19+
label: Problem Statement
20+
description: What problem does this feature solve? Is this related to a frustration with rtbeat?
21+
placeholder: |
22+
I'm always frustrated when...
23+
24+
OR
25+
26+
Currently there's no way to...
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: solution
32+
attributes:
33+
label: Proposed Solution
34+
description: How would you like this to work? Describe the feature in detail.
35+
placeholder: |
36+
It would be great if rtbeat could...
37+
38+
Example: add a new field to the published event, or a new config option in rtbeat.yml
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: alternatives
44+
attributes:
45+
label: Alternatives Considered
46+
description: What other solutions or workarounds have you considered?
47+
placeholder: |
48+
I've tried using X, but it doesn't work because...
49+
50+
- type: dropdown
51+
id: impact
52+
attributes:
53+
label: Impact
54+
description: How important is this feature to your workflow?
55+
options:
56+
- Nice to have
57+
- Would significantly improve my workflow
58+
- Blocking my use of rtbeat
59+
validations:
60+
required: true
61+
62+
- type: textarea
63+
id: context
64+
attributes:
65+
label: Additional Context
66+
description: Any other context, screenshots, or examples that would help explain the feature

.github/dependabot.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 2
2+
updates:
3+
# Go modules
4+
- package-ecosystem: "gomod"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
commit-message:
9+
prefix: "deps"
10+
labels:
11+
- "dependencies"
12+
- "go"
13+
# libbeat drags a large, tightly-coupled dependency tree. Pin the
14+
# beats line manually; let dependabot surface everything else.
15+
ignore:
16+
- dependency-name: "github.com/elastic/beats/v7"
17+
18+
# GitHub Actions
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
commit-message:
24+
prefix: "ci"
25+
labels:
26+
- "dependencies"
27+
- "github-actions"
28+
ignore:
29+
# SLSA generator v2.1.x has a privacy-check false positive that halts
30+
# provenance generation on public repos. Pinned to v2.0.0 in release.yml.
31+
- dependency-name: "slsa-framework/slsa-github-generator"
32+
versions: ["2.1.x"]
33+
34+
# Docker
35+
- package-ecosystem: "docker"
36+
directory: "/"
37+
schedule:
38+
interval: "weekly"
39+
commit-message:
40+
prefix: "docker"
41+
labels:
42+
- "dependencies"
43+
- "docker"

.github/pull_request_template.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Description
2+
3+
<!-- Brief description of changes. What does this PR do and why? -->
4+
5+
## Type of Change
6+
7+
<!-- Check all that apply -->
8+
9+
- [ ] Bug fix (non-breaking change that fixes an issue)
10+
- [ ] Test improvement (new or updated tests)
11+
- [ ] Documentation update
12+
- [ ] Stability/performance improvement
13+
- [ ] Build/CI improvement
14+
15+
> **Note:** New features are developed by maintainers only.
16+
17+
## Related Issues
18+
19+
<!-- Link to issues this PR addresses. Use "Fixes #123" for automatic closing -->
20+
21+
Fixes #
22+
23+
## Testing
24+
25+
<!-- How was this tested? -->
26+
27+
- [ ] Ran `go test ./...` locally
28+
- [ ] Ran `make verify`
29+
- [ ] Tested manually against an Elasticsearch/Elastic Stack output (if applicable)
30+
- [ ] Added new tests for changes (if applicable)
31+
32+
## Checklist
33+
34+
- [ ] My code follows the project's style guidelines (`go fmt`, `go vet`)
35+
- [ ] I have updated documentation if needed
36+
- [ ] This PR is focused and does not include unrelated changes
37+
38+
## Screenshots/Logs (if applicable)
39+
40+
<!-- For output formatting, error handling, or behavioral changes -->

0 commit comments

Comments
 (0)