Skip to content

Commit 8a7394e

Browse files
committed
refactor: move checkcover to internal/cmd and gitignore binary
Addresses PR feedback from @dmathieu: - Move checkcover from cmd/ to internal/cmd/ (not needed as public tool) - Remove committed binary from git tracking - Add binary to .gitignore to prevent future commits Changes: - Moved cmd/checkcover -> internal/cmd/checkcover - Updated module path in go.mod - Updated CI workflow to reference new path - Updated documentation references - Added checkcover binaries to .gitignore - All tests passing
1 parent 7dc11a6 commit 8a7394e

File tree

13 files changed

+24
-18
lines changed

13 files changed

+24
-18
lines changed

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ jobs:
227227
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
228228
- name: Validate coverage requirements
229229
run: |
230-
cd cmd/checkcover
231-
go run . -c ../../coverage.txt -r ../.. -v
230+
cd internal/cmd/checkcover
231+
go run . -c ../../../coverage.txt -r ../../.. -v
232232
233233
cross-build-collector:
234234
needs: [setup-environment]

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ bin/
22
dist/
33
/local
44

5+
# Compiled binaries
6+
cmd/checkcover/checkcover
7+
internal/cmd/checkcover/checkcover
8+
59
# GoLand IDEA
610
/.idea/
711
*.iml

PR_SUMMARY.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ Created a new CLI tool that:
3232

3333
Files:
3434

35-
- `cmd/checkcover/main.go` - CLI entry point
36-
- `cmd/checkcover/validator.go` - Core logic
37-
- `cmd/checkcover/validator_test.go` - Tests
38-
- `cmd/checkcover/README.md` - Documentation
39-
- `cmd/checkcover/go.mod` - Dependencies
40-
- `cmd/checkcover/Makefile` - Build config
35+
- `internal/cmd/checkcover/main.go` - CLI entry point
36+
- `internal/cmd/checkcover/validator.go` - Core logic
37+
- `internal/cmd/checkcover/validator_test.go` - Tests
38+
- `internal/cmd/checkcover/README.md` - Documentation
39+
- `internal/cmd/checkcover/go.mod` - Dependencies
40+
- `internal/cmd/checkcover/Makefile` - Build config
4141

4242
### 4. CI Integration
4343

@@ -83,8 +83,8 @@ status:
8383
```bash
8484
# Locally
8585
make gotest-with-cover
86-
cd cmd/checkcover
87-
go run . -c ../../coverage.txt -r ../.. -v
86+
cd internal/cmd/checkcover
87+
go run . -c ../../../coverage.txt -r ../../.. -v
8888

8989
# In CI (automatic)
9090
# Runs as part of test-coverage job
@@ -163,7 +163,7 @@ None. This is purely additive:
163163

164164
## Notes for Reviewers
165165

166-
1. **checkcover tool**: Main implementation in `cmd/checkcover/`
166+
1. **checkcover tool**: Main implementation in `internal/cmd/checkcover/`
167167
2. **Metadata changes**: Simple addition of one field with validation
168168
3. **CI changes**: Single step added to existing workflow
169169
4. **Documentation**: Comprehensive guide for component authors

cmd/checkcover/checkcover

-10.1 MB
Binary file not shown.

docs/coverage-requirements.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ You can check your component's coverage requirements and actual coverage:
102102
make gotest-with-cover
103103
104104
# Run the coverage validator
105-
cd cmd/checkcover
106-
go run . -c ../../coverage.txt -r ../.. -v
105+
cd internal/cmd/checkcover
106+
go run . -c ../../../coverage.txt -r ../../.. -v
107107
```
108108

109109
### In CI
@@ -159,7 +159,7 @@ status:
159159
If you encounter issues with coverage validation:
160160

161161
1. Check the [Component Stability](../../docs/component-stability.md) document
162-
2. Review the [checkcover README](../../cmd/checkcover/README.md)
162+
2. Review the [checkcover README](../../internal/cmd/checkcover/README.md)
163163
3. Ask in the #otel-collector Slack channel
164164
4. Open an issue on GitHub with the label `coverage`
165165

File renamed without changes.
File renamed without changes.

cmd/checkcover/go.mod renamed to internal/cmd/checkcover/go.mod

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module go.opentelemetry.io/collector/cmd/checkcover
1+
module go.opentelemetry.io/collector/internal/cmd/checkcover
22

33
go 1.24.0
44

@@ -27,8 +27,10 @@ require (
2727
go.uber.org/zap v1.27.0 // indirect
2828
)
2929

30-
replace go.opentelemetry.io/collector/component => ../../component
30+
replace go.opentelemetry.io/collector/component => ../../../component
3131

32-
replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry
32+
replace go.opentelemetry.io/collector/config/configtelemetry => ../../../config/configtelemetry
3333

34-
replace go.opentelemetry.io/collector/pdata => ../../pdata
34+
replace go.opentelemetry.io/collector/pdata => ../../../pdata
35+
36+
replace go.opentelemetry.io/collector/featuregate => ../../../featuregate
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)