Skip to content

Commit e1d2a36

Browse files
authored
chore: add SPDX headers, DCO enforcement, and build-debug target (#501)
## Summary - Add SPDX copyright and MIT license headers to all 225 Go source files - Add DCO enforcement via lefthook commit-msg hook - Add `build-debug` Makefile target and `BUILD_FLAGS` variable for debug symbol preservation - Supports OpenSSF Best Practices Silver badge criteria (license_per_file, copyright_per_file, dco, build_preserve_debug) ## Test plan - [ ] Verify SPDX headers present in Go files - [ ] Verify `make build-debug` produces binary with debug symbols - [ ] Verify lefthook DCO hook rejects unsigned commits
2 parents f141679 + a512d10 commit e1d2a36

File tree

228 files changed

+735
-3
lines changed

Some content is hidden

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

228 files changed

+735
-3
lines changed

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ PKG_TAG = latest
1919
GOCMD = go
2020
GOBUILD = $(GOCMD) build
2121
GHRELEASE = github-release
22-
LDFLAGS = -ldflags "-X main.version=$(BRANCH) -X main.build=$(BUILD)"
22+
# BUILD_FLAGS defaults to stripping debug info for smaller binaries.
23+
# Override to preserve debug symbols: make build BUILD_FLAGS=""
24+
# Or build with: make build-debug
25+
BUILD_FLAGS ?= -s -w
26+
LDFLAGS = -ldflags "$(BUILD_FLAGS) -X main.version=$(BRANCH) -X main.build=$(BUILD)"
2327

2428
# Coverage
2529
COVERAGE_REPORT = coverage.txt
@@ -254,7 +258,8 @@ help:
254258
@echo "Ofelia Development Commands:"
255259
@echo ""
256260
@echo "🏗️ Building:"
257-
@echo " build - Build local binary"
261+
@echo " build - Build local binary (stripped, no debug symbols)"
262+
@echo " build-debug - Build local binary with debug symbols preserved"
258263
@echo " packages - Build cross-platform binaries"
259264
@echo " docker-build - Build Docker image"
260265
@echo " docker-run - Build and run Docker container"
@@ -297,7 +302,12 @@ help:
297302

298303
build:
299304
@mkdir -p $(BUILD_PATH)
300-
@go build -o $(BUILD_PATH)/$(PROJECT) ofelia.go
305+
@go build $(LDFLAGS) -o $(BUILD_PATH)/$(PROJECT) ofelia.go
306+
307+
.PHONY: build-debug
308+
build-debug: BUILD_FLAGS =
309+
build-debug: build
310+
@echo "Built with debug symbols preserved (no -s -w flags)"
301311

302312
packages:
303313
@for os in $(PKG_OS); do \

cli/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

cli/config_comprehensive_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

cli/config_decode.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

cli/config_decode_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

cli/config_dependencies_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

cli/config_execjob_init_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

cli/config_extra_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

cli/config_fuzz_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025-2026 Netresearch DTT GmbH
2+
// SPDX-License-Identifier: MIT
3+
14
package cli
25

36
import (

0 commit comments

Comments
 (0)