Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LANGPLAT-87] Implement automated release tagging for dd-trace-go v2 #3159

Draft
wants to merge 1 commit into
base: v2-dev
Choose a base branch
from

Conversation

kakkoyun
Copy link
Member

@kakkoyun kakkoyun commented Feb 6, 2025

What does this PR do?

This PR introduces the autoreleasetagger tool, which automates the process of tagging and versioning Go modules.
It includes the main functionality for finding modules, updating dependencies, committing changes, and creating/pushing tags.
Additionally, it adds integration tests to verify the tool's behavior and ensures compliance with Go style guidelines.

Motivation

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

  • Automate the tagging and versioning process for Go modules to reduce manual effort and errors.
  • Ensure consistent and reliable versioning across all Go modules in the repository.
  • Improve the development workflow by integrating automated tagging and versioning.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

- Added the autoreleasetagger tool to automate tagging and versioning of Go modules.
- Implemented main.go with functionality to:
  - Find and filter Go modules.
  - Update dependencies.
  - Commit changes if needed.
  - Create and push tags if needed.
- Split tag creation and pushing logic into separate functions.
- Added integration tests in main_integration_test.go to verify.

Signed-off-by: Kemal Akkoyun <[email protected]>
@kakkoyun kakkoyun requested review from a team as code owners February 6, 2025 15:47
@kakkoyun kakkoyun marked this pull request as draft February 6, 2025 15:47
@kakkoyun kakkoyun changed the base branch from main to v2-dev February 6, 2025 15:47
@kakkoyun kakkoyun requested review from mtoffl01 and removed request for a team and vitor-de-araujo February 6, 2025 15:48
@kakkoyun kakkoyun changed the title tools: Add a tool to automated release tagging for v2 [LANGPLAT-87] Implement automated release tagging for dd-trace-go v2 Feb 6, 2025
Copy link
Contributor

@mtoffl01 mtoffl01 left a comment

Choose a reason for hiding this comment

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

main_integration_test.go is really well organized and easy to follow!

@@ -0,0 +1,91 @@
# Auto Release Tagger

This tool ensures that all modules in a monorepo are tagged correctly, respecting dependency order—tagging dependencies first before their dependents.
Copy link
Contributor

Choose a reason for hiding this comment

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

I found this sentence hard to read, maybe you mean this instead?

Suggested change
This tool ensures that all modules in a monorepo are tagged correctly, respecting dependency ordertagging dependencies first before their dependents.
This tool ensures that all modules in a monorepo are tagged correctly, respecting dependency order by tagging dependencies first before their dependents.

?

@@ -0,0 +1,91 @@
# Auto Release Tagger
Copy link
Contributor

Choose a reason for hiding this comment

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

Up top can we also specify when you would use this tool? It's during the release process? And what is this new tool affording us that we did not have previously (with the old release process)?

go run ./tools/autoreleasetagger -root ../..
```

Dry run:
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to see a quick statement about when/why you would do a Dry Run instead of a regular run, so that a reader can decide the correct use case for this command.
e.g.
Dry run: Simulate the tagging process to check for potential issues

go run ./tools/autoreleasetagger -dry-run -root ../..
```

Run without pushing tags:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as Dry Run. Admittedly, commenting that because I at first had to think critically about why you might want to do those operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants