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: check for new majors in v2 #3078

Merged
merged 32 commits into from
Feb 12, 2025

Conversation

quinna-h
Copy link
Contributor

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

What does this PR do?

Checks for new major versions on github in v2

Motivation

In the original PR, we used a hardcoded, manual integration_go.mod to detect if new major versions (corresponding to new packages) have been released. However, in v2 each package will be treated as its own contrib with its own corresponding go.mod. We want to parse these go.mod files to check the current latest major, and output if a new major is available.

  1. Check the latest major we support for a given package / module (parsing the go.mod files).

  2. Fetch / check for new major versions from github:

  • Run go list -m -json <repository>@<version> and extract Origin[url]
  • List all tags with git ls-remote --tags <repository>
  • Extract all majors, get the latest version of each major. For each latest version of each major: curl https://raw.githubusercontent.com/<module>/refs/tags/<latest_version>/go.mod
    • If the request returns 404, the module is not a go module and we can skip it
    • Otherwise, we parse the modfile and extract the mod name
  1. Compare the results from 1 (latest contrib major which we support) and 2 (latest major on github). If 2 is greater than 1 and there is a new module for the new major, output "New latest major on Github: {github_latest_major}"

Example output from workflow run: https://github.com/DataDog/dd-trace-go/actions/runs/12993810647/job/36236846230

TODO:

  • Remove extraneous logging/print output after review - for clarity while reviewing.

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 10, 2025

Datadog Report

Branch report: quinna.halim/v2-output-new-major-versions
Commit report: 4cc7e3d
Test service: dd-trace-go

✅ 0 Failed, 4088 Passed, 64 Skipped, 2m 39.44s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Jan 10, 2025

Benchmarks

Benchmark execution time: 2025-02-10 18:18:03

Comparing candidate commit 17e36d8 in PR branch quinna.halim/v2-output-new-major-versions with baseline commit 12cb2c8 in branch v2-dev.

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

@quinna-h quinna-h requested a review from rarguelloF January 10, 2025 18:36
@quinna-h quinna-h marked this pull request as ready for review January 13, 2025 18:32
@quinna-h quinna-h requested review from a team as code owners January 13, 2025 18:32
@quinna-h quinna-h marked this pull request as draft January 22, 2025 14:32
@quinna-h quinna-h marked this pull request as ready for review January 23, 2025 15:10
@quinna-h quinna-h requested a review from bouwkast January 23, 2025 15:56
Copy link
Contributor

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Nice! Overall looks good to me, just a few comments

@datadog-datadog-prod-us1
Copy link

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

Datadog Report

Branch report: quinna.halim/v2-output-new-major-versions
Commit report: 0b48751
Test service: dd-trace-go

❌ 21 Failed (1 Known Flaky), 2623 Passed, 67 Skipped, 1m 30.87s Total Time

❌ Failed Tests (21)

This report shows up to 5 failed tests.

  • TestInjectTraceContextSizeLimit - github.com/DataDog/dd-trace-go/contrib/aws/aws-sdk-go-v2/v2/eventbridge - Details

    Expand for error
     Failed
     
     === RUN   TestInjectTraceContextSizeLimit
     --- FAIL: TestInjectTraceContextSizeLimit (0.01s)
    
  • TestInjectTraceContextSizeLimit/Do_not_inject_when_payload_is_too_large - github.com/DataDog/dd-trace-go/contrib/aws/aws-sdk-go-v2/v2/eventbridge - Details

    Expand for error
     Failed
     
     === RUN   TestInjectTraceContextSizeLimit/Do_not_inject_when_payload_is_too_large
         --- FAIL: TestInjectTraceContextSizeLimit/Do_not_inject_when_payload_is_too_large (0.00s)
     panic: runtime error: invalid memory address or nil pointer dereference [recovered]
     	panic: runtime error: invalid memory address or nil pointer dereference
     [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x11e4b39]
     
     goroutine 26 [running]:
     testing.tRunner.func1.2({0x12e0920, 0x1bef410})
     ...
    
  • TestInjectTraceContext - github.com/DataDog/dd-trace-go/contrib/aws/aws-sdk-go-v2/v2/sns - Details

    Expand for error
     Failed
     
     === RUN   TestInjectTraceContext
     --- FAIL: TestInjectTraceContext (0.05s)
    
  • TestInjectTraceContext/No_injection_when_at_max_attributes - github.com/DataDog/dd-trace-go/contrib/aws/aws-sdk-go-v2/v2/sns - Details

    Expand for error
     Failed
     
     === RUN   TestInjectTraceContext/No_injection_when_at_max_attributes
         --- FAIL: TestInjectTraceContext/No_injection_when_at_max_attributes (0.01s)
     panic: runtime error: invalid memory address or nil pointer dereference [recovered]
     	panic: runtime error: invalid memory address or nil pointer dereference
     [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x11e315f]
     
     goroutine 13 [running]:
     testing.tRunner.func1.2({0x12ddc40, 0x1bea410})
     ...
    
  • TestInjectTraceContext - github.com/DataDog/dd-trace-go/contrib/aws/aws-sdk-go-v2/v2/sqs - Details

    Expand for error
     Failed
     
     === RUN   TestInjectTraceContext
     --- FAIL: TestInjectTraceContext (0.05s)
    

@quinna-h quinna-h changed the base branch from v2-dev to main January 27, 2025 16:30
@quinna-h quinna-h requested review from a team as code owners January 27, 2025 16:30
@bouwkast bouwkast force-pushed the quinna.halim/v2-output-new-major-versions branch from c85378d to a92f304 Compare February 10, 2025 13:47
@bouwkast
Copy link
Contributor

rebased and force pushed as the workflow yml was updated

@quinna-h quinna-h merged commit 791121e into v2-dev Feb 12, 2025
154 of 159 checks passed
@quinna-h quinna-h deleted the quinna.halim/v2-output-new-major-versions branch February 12, 2025 16:33
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.

4 participants