Skip to content

[LANGPLAT-437] Improve CI and dogfooding practices for dd-trace-go#3727

Merged
kakkoyun merged 11 commits into
DataDog:mainfrom
kakkoyun:kakkoyun/add-checklocks
Jul 17, 2025
Merged

[LANGPLAT-437] Improve CI and dogfooding practices for dd-trace-go#3727
kakkoyun merged 11 commits into
DataDog:mainfrom
kakkoyun:kakkoyun/add-checklocks

Conversation

@kakkoyun

@kakkoyun kakkoyun commented Jul 4, 2025

Copy link
Copy Markdown
Member

What does this PR do?

This PR introduces comprehensive development tooling and CI improvements to enhance code quality, consistency, and developer experience across the dd-trace-go repository.

Key changes include:

  • New CI Workflows: Added static-checks and generate workflows for comprehensive code validation
  • Development Scripts: Added lint.sh, format.sh, checklocks.sh, and enhanced existing scripts
  • Tooling Updates: Added golangci-lint v2.2.1 and shfmt to project dependencies
  • Documentation: Comprehensive updates to CONTRIBUTING.md with detailed development guides
  • CI Streamlining: Removed duplicate jobs and improved workflow efficiency

Motivation

https://datadoghq.atlassian.net/browse/LANGPLAT-437

The current development workflow lacks consistent tooling and comprehensive static analysis, leading to:

  • Inconsistent code formatting across the codebase
  • Manual linting processes that are error-prone
  • Lack of lock analysis for potential deadlocks
  • Fragmented CI workflows with duplicate jobs
  • Insufficient documentation for contributors

This PR addresses these issues by providing:

  • Unified development scripts for consistent local and CI environments
  • Comprehensive static analysis including deadlock detection
  • Improved CI efficiency with dedicated workflows
  • Better documentation to help contributors understand the development process

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage. (N/A - tooling changes)
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag. (N/A - tooling changes)
  • There is a benchmark for any new code, or changes to existing code. (N/A - tooling changes)
  • If this interacts with the agent in a new way, a system test has been added. (N/A - no agent interaction)
  • New code is free of linting errors. You can check this by running `golangci-lint run` locally. (All changes pass linting)
  • Add an appropriate team label so this PR gets put in the right place for the release notes. (Will add `build` label)
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. (Added golangci-lint and shfmt to _tools/go.mod)

@kakkoyun
kakkoyun requested review from a team as code owners July 4, 2025 14:42
@kakkoyun kakkoyun changed the title build: add comprehensive development tooling and CI improvements build/ci: Add comprehensive development tooling and CI improvements Jul 4, 2025
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch 2 times, most recently from 7ec201a to 27fb69a Compare July 4, 2025 14:57
@kakkoyun kakkoyun changed the title build/ci: Add comprehensive development tooling and CI improvements [LANGPLAT-437] Improve CI and dogfooding practices for dd-trace-go Jul 4, 2025
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch from d99138f to fc54d77 Compare July 4, 2025 15:20
@kakkoyun
kakkoyun marked this pull request as draft July 4, 2025 15:22
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch from fc54d77 to ba2e5eb Compare July 4, 2025 15:28
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch 3 times, most recently from c8f8d7b to bb4860f Compare July 16, 2025 09:27
@kakkoyun
kakkoyun marked this pull request as ready for review July 16, 2025 09:29
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch from bb4860f to f9b32bb Compare July 16, 2025 09:38
kakkoyun added 8 commits July 16, 2025 11:39
Add comprehensive development scripts:
- lint.sh: Run all linters (goimports, golangci-lint, checklocks)
- format.sh: Format Go and shell files
- checklocks.sh: Lock analysis for deadlock detection
- fix-modules.sh: Module consistency management (replaces fix_modules.sh)

Enhance existing scripts:
- test.sh: Improved output formatting and error handling
- ci-test-contrib.sh: Better CI integration

These scripts provide consistent tooling for local development
and CI environments.

Signed-off-by: Kemal Akkoyun <[email protected]>
Add comprehensive static-checks workflow including:
- Copyright header verification
- Code generation validation
- Module consistency checks
- Comprehensive linting with golangci-lint
- Lock analysis with checklocks

Add dedicated generate workflow for code generation tasks.

Streamline unit-integration-tests workflow by removing
duplicate jobs that are now handled by static-checks.

Fix script path references in smoke-tests workflow
(fix_modules.sh -> fix-modules.sh).

Signed-off-by: Kemal Akkoyun <[email protected]>
Add golangci-lint/v2 and shfmt to project tools for:
- Comprehensive Go linting across the codebase
- Shell script formatting and validation

Update go.mod and go.sum with new dependencies.
Update go.work.sum with workspace changes.

Signed-off-by: Kemal Akkoyun <[email protected]>
CONTRIBUTING.md:
- Add comprehensive CI workflow documentation
- Document new development scripts (lint.sh, format.sh, etc.)
- Add troubleshooting guides for CI failures
- Improve formatting and structure
- Update linting instructions with new tools

README.md:
- Fix formatting inconsistencies
- Improve bullet point alignment
- Clean up whitespace and formatting

Signed-off-by: Kemal Akkoyun <[email protected]>
Update golangci-lint version in pre-commit config to v2.2.1
and add sync reminder comment.

Add tmp directory to .gitignore for temporary development files.

Signed-off-by: Kemal Akkoyun <[email protected]>
Fix line continuation formatting in dsn.go and remove
unnecessary blank identifier in fixmodules/main.go.

These are automated formatting changes from gofmt/goimports.

Signed-off-by: Kemal Akkoyun <[email protected]>
Signed-off-by: Kemal Akkoyun <[email protected]>
Signed-off-by: Kemal Akkoyun <[email protected]>
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch from f9b32bb to 1508d80 Compare July 16, 2025 09:40
Signed-off-by: Kemal Akkoyun <[email protected]>
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch from ccf7bac to b86eb16 Compare July 16, 2025 09:50
@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch from feced67 to b3602a8 Compare July 16, 2025 09:59

@darccio darccio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kakkoyun
kakkoyun force-pushed the kakkoyun/add-checklocks branch from deecbaa to aa5854a Compare July 16, 2025 12:12
@kakkoyun

Copy link
Copy Markdown
Member Author

lint and copyright required tests are moved thus they are not passing right now. I will change the required steps after merge.

@kakkoyun
kakkoyun enabled auto-merge (squash) July 17, 2025 10:29
@kakkoyun

Copy link
Copy Markdown
Member Author

/merge --cancel

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Jul 17, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-07-17 10:30:11 UTC ℹ️ Start processing command /merge --cancel

@rarguelloF rarguelloF left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🚀

@kakkoyun

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Jul 17, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-07-17 10:38:52 UTC ℹ️ Start processing command /merge


2025-07-17 10:39:01 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-07-17 10:50:40 UTC ⚠️ MergeQueue: This merge request was unqueued

[email protected] unqueued this merge request

@kakkoyun

Copy link
Copy Markdown
Member Author

/remove

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Jul 17, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-07-17 10:50:33 UTC ℹ️ Start processing command /remove


2025-07-17 10:50:37 UTC ℹ️ Devflow: /remove

@kakkoyun
kakkoyun merged commit ac97b54 into DataDog:main Jul 17, 2025
131 of 132 checks passed
@kakkoyun
kakkoyun deleted the kakkoyun/add-checklocks branch July 17, 2025 10:50
eliottness added a commit that referenced this pull request Jul 23, 2025
Signed-off-by: Eliott Bouhana <[email protected]>
@eliottness eliottness mentioned this pull request Jul 24, 2025
7 tasks
eliottness added a commit that referenced this pull request Jul 24, 2025
eliottness added a commit that referenced this pull request Jul 24, 2025
eliottness added a commit that referenced this pull request Jul 24, 2025
Signed-off-by: Eliott Bouhana <[email protected]>
eliottness added a commit that referenced this pull request Jul 25, 2025
kakkoyun added a commit that referenced this pull request Aug 1, 2025
Add the reverted chages back from "Improve CI and dogfooding practices
for dd-trace-go #3727"

And also;
  - Add embedmd to development tools for automatic documentation embedding
  - Add 'make docs' command to update README files with current help outputs
  - Add CI check to ensure documentation stays up-to-date
  - Generate clean, idempotent help outputs for consistent documentation

Signed-off-by: Kemal Akkoyun <[email protected]>
@kakkoyun kakkoyun mentioned this pull request Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants