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

internal: add supported versions for v2 #3070

Draft
wants to merge 7 commits into
base: v2-dev
Choose a base branch
from

Conversation

quinna-h
Copy link
Contributor

@quinna-h quinna-h commented Jan 8, 2025

What does this PR do?

  • Runs the script .github/workflows/apps/output_supported_versions.go
    • This finds the minimum version from contrib/<package_name>/go.mod, and the maximum from go list -m -versions <repository>
    • Outputs to the table supported_versions.md which states the package, minimum and maximum versions tested/supported, and whether it is auto-instrumented using this definition: https://github.com/DataDog/orchestrion#supported-libraries
  • Adds the Supported Versions workflow which runs only after Smoke Tests successfully passes on main
    • This is since Smoke Tests tests that ddtrace works with the latest versions of the packages. So if Smoke Tests passed, we can safely assume that latest works.

Motivation

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!

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 8, 2025

Datadog Report

Branch report: quinna.halim/v2-add-supported-versions
Commit report: a0228b3
Test service: dd-trace-go

✅ 0 Failed, 4076 Passed, 64 Skipped, 2m 49.19s Total Time

# note: This will only run when there *are* changes to integration versions
- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@v6

Choose a reason for hiding this comment

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

🟠 Code Vulnerability

Workflow depends on a GitHub actions pinned by tag (...read more)

View in Datadog  Leave us feedback  Documentation

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4

Choose a reason for hiding this comment

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

🟠 Code Vulnerability

Workflow depends on a GitHub actions pinned by tag (...read more)

View in Datadog  Leave us feedback  Documentation

@@ -0,0 +1,44 @@
name: Supported Versions
on:
workflow_run:

Choose a reason for hiding this comment

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

🟠 Code Vulnerability

Dangerous GitHub actions trigger (...read more)

View in Datadog  Leave us feedback  Documentation

@quinna-h quinna-h requested a review from rarguelloF January 8, 2025 20:59
@pr-commenter
Copy link

pr-commenter bot commented Jan 8, 2025

Benchmarks

Benchmark execution time: 2025-01-10 19:09:39

Comparing candidate commit 1daec69 in PR branch quinna.halim/v2-add-supported-versions with baseline commit 89bfc59 in branch v2-dev.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 1 unstable metrics.

@quinna-h quinna-h changed the title WIP: add supported versions for v2 internal: add supported versions for v2 Jan 9, 2025
Copy link
Contributor

@rarguelloF rarguelloF left a comment

Choose a reason for hiding this comment

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

Good work! this is looking pretty good :D
Left some minor comments / potential improvements

Comment on lines +156 to +158
var mu sync.Mutex

updatedModules := make([]ModuleVersion, 0, len(modules))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
var mu sync.Mutex
updatedModules := make([]ModuleVersion, 0, len(modules))
updatedModules := make([]ModuleVersion, len(modules))

nit: you can avoid the mutex by assigning the slice by index instead of using append

updatedModules[i] = ...

@@ -844,3 +846,7 @@ func isAWSMessagingSendOp(awsService, awsOperation string) bool {
}
return false
}

func GetPackages() map[Package]PackageInfo {
return packages
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm the point of making this variable unexported was so it cannot be modified from outside of this package. If we want to keep it being this way, this function should return a deep copy of this map.

cc @darccio any thoughts?

Comment on lines +86 to +93
// Path to contrib/{packageName}
contribPath := filepath.Join("contrib", packageName)
goModPath := filepath.Join(contribPath, "go.mod")

// Check if go.mod exists in directory
if _, err := os.Stat(goModPath); os.IsNotExist(err) {
return ModuleVersion{}, fmt.Errorf("go.mod not found in %s", contribPath)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this means you are no longer using the integration_go.mod file right? in that case then we can just remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, putting this in a separate PR: #3078, which will modify the 'check for new major version packages' workflow (which was what we needed integration_go.mod for in the first place)

.github/workflows/apps/output_supported_versions.go Outdated Show resolved Hide resolved
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