Skip to content

Commit

Permalink
Merge branch 'master' into tonycthsu/update-2.0-with-1.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Apr 17, 2024
2 parents f9fae42 + 36e37fc commit aad14ac
Show file tree
Hide file tree
Showing 23 changed files with 657 additions and 313 deletions.
62 changes: 33 additions & 29 deletions .github/workflows/add-milestone-to-pull-requests.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
name: Add milestone to pull requests
name: Add milestone to merged pull requests
on:
pull_request_target:
pull_request:
types: [closed]
branches:
- master

jobs:
add_milestone_to_merged:
permissions:
# These two permissions are needed to modify milestone, even though only one should be enough
issues: write
pull-requests: write

if: github.event.pull_request.merged && github.event.pull_request.milestone == null

name: Add milestone to merged pull requests
add_milestone:
runs-on: ubuntu-latest

if: github.event.pull_request.merged == true && github.event.pull_request.milestone == null
steps:
- name: Checkout code
# Checks out the branch that the pull request is merged into
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Get major version from gemspec
# Parse the gemspec and return the major version
id: version
run: |
echo "::set-output name=version::$(find . -name *.gemspec | ruby -ne 'puts Gem::Specification.load($_.chomp).version.to_s.split(".").first')"
- name: Get project milestones
id: milestones
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const list = await github.rest.issues.listMilestones({
const milestones = await github.rest.issues.listMilestones({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
})
// Need to manually sort because "sort by number" isn't part of the api
// highest number first
const milestones = list.data.sort((a,b) => (b.number - a.number))
return milestones.data
return milestones.length == 0 ? null : milestones[0].number
- name: Update Pull Request
if: steps.milestones.outputs.result != null
uses: actions/github-script@v6
# Update the merged pull request with the milestone starts with the major version
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
// Confusingly, the issues api is used because pull requests are issues
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }},
milestone: ${{ steps.milestones.outputs.result }},
});
const milestones = ${{steps.milestones.outputs.result}}
const majorVersion = ${{steps.version.outputs.version}}
const milestone = milestones.find(m => m.title.startsWith(majorVersion))
if (milestone) {
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }},
milestone: milestone.number
})
}
23 changes: 0 additions & 23 deletions .github/workflows/create-next-milestone.yml

This file was deleted.

94 changes: 0 additions & 94 deletions .github/workflows/draft-release-on-release-branch-push.yaml

This file was deleted.

62 changes: 31 additions & 31 deletions .github/workflows/release-lib-injection.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# name: "Release Library Injection"
# on:
# push:
# tags:
# - 'v*.*.*'

# jobs:
# build-and-publish-release-image:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set version
# id: version
# run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
# - name: Get version
# run: echo "The selected version is ${{ steps.version.outputs.version }}"
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to Docker
# run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
# - name: Docker Build
# uses: docker/build-push-action@v3
# with:
# push: true
# tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ steps.version.outputs.version }}
# platforms: 'linux/amd64,linux/arm64/v8'
# build-args: DATADOG_RUBY_GEM_VERSION=${{ steps.version.outputs.version }}
# context: ./lib-injection
name: "Release Library Injection"
on:
push:
tags:
- 'v*.*.*'
- '!v*.*.*.*' # Exclude prerelease tags

jobs:
build-and-publish-release-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version
id: version
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Get version
run: echo "The selected version is ${{ steps.version.outputs.version }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Docker Build
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ steps.version.outputs.version }}
platforms: 'linux/amd64,linux/arm64/v8'
build-args: DDTRACE_RUBY_VERSION=${{ steps.version.outputs.version }}
context: ./lib-injection
74 changes: 37 additions & 37 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,40 +192,40 @@ deploy_to_reliability_env:
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA

# deploy_to_docker_registries:
# stage: deploy
# rules:
# - if: "$POPULATE_CACHE"
# when: never
# - if: "$CI_COMMIT_TAG =~ /^v.*/"
# when: delayed
# start_in: 1 day
# - when: manual
# allow_failure: true
# trigger:
# project: DataDog/public-images
# branch: main
# strategy: depend
# variables:
# IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
# IMG_DESTINATIONS: dd-lib-ruby-init:$CI_COMMIT_TAG
# IMG_SIGNING: "false"

# deploy_latest_tag_to_docker_registries:
# stage: deploy
# rules:
# - if: "$POPULATE_CACHE"
# when: never
# - if: "$CI_COMMIT_TAG =~ /^v.*/"
# when: delayed
# start_in: 1 day
# - when: manual
# allow_failure: true
# trigger:
# project: DataDog/public-images
# branch: main
# strategy: depend
# variables:
# IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
# IMG_DESTINATIONS: dd-lib-ruby-init:latest
# IMG_SIGNING: "false"
deploy_to_docker_registries:
stage: deploy
rules:
- if: "$POPULATE_CACHE"
when: never
- if: $CI_COMMIT_TAG =~ /^v(\d+)\.(\d+)\.(\d+)$/ # Exclude prerelease
when: delayed
start_in: 1 day
- when: manual
allow_failure: true
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_SIGNING: "false"

deploy_latest_tag_to_docker_registries:
stage: deploy
rules:
- if: "$POPULATE_CACHE"
when: never
- if: $CI_COMMIT_TAG =~ /^v(\d+)\.(\d+)\.(\d+)$/ && $CI_COMMIT_BRANCH == 'master' # Exclude prerelease and only for master branch
when: delayed
start_in: 1 day
- when: manual
allow_failure: true
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-ruby-init:latest
IMG_SIGNING: "false"
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

## [Unreleased]

## [1.22.0] - 2024-04-16

### Added

* Tracing: Add sampling rules by trace resouce and tags ([#3587][], [#3585][])
* Appsec: Add WAF vendor header support ([#3528][])

### Changed

* Upgrade `Telemetry` to V2 ([#3551][])
* Upgrade to libdatadog 7 ([#3536][])
* Profiling: Enable Garbage Collection profiling by default ([#3558][])
* Profiling: Skip heap samples with age 0 ([#3573][])
* Profiling: Support falling back into extension directory when loading profiler ([#3582][])

### Fixed

* Appsec: Fix MIME-style newlines with strict base64 encoding ([#3565][])

## [2.0.0.beta1] - 2024-03-22

Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v2.0.0.beta1
Expand Down Expand Up @@ -2784,7 +2803,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1


[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.1...master
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v1.22.0...master
[1.22.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.1...v1.22.0
[2.0.0.beta1]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.1...v2.0.0.beta1
[1.21.1]: https://github.com/DataDog/dd-trace-rb/compare/v1.21.0...v1.21.1
[1.21.0]: https://github.com/DataDog/dd-trace-rb/compare/v1.20.0...v1.21.0
Expand Down Expand Up @@ -4079,9 +4099,18 @@ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
[#3519]: https://github.com/DataDog/dd-trace-rb/issues/3519
[#3520]: https://github.com/DataDog/dd-trace-rb/issues/3520
[#3523]: https://github.com/DataDog/dd-trace-rb/issues/3523
[#3528]: https://github.com/DataDog/dd-trace-rb/issues/3528
[#3531]: https://github.com/DataDog/dd-trace-rb/issues/3531
[#3535]: https://github.com/DataDog/dd-trace-rb/issues/3535
[#3536]: https://github.com/DataDog/dd-trace-rb/issues/3536
[#3539]: https://github.com/DataDog/dd-trace-rb/issues/3539
[#3551]: https://github.com/DataDog/dd-trace-rb/issues/3551
[#3558]: https://github.com/DataDog/dd-trace-rb/issues/3558
[#3565]: https://github.com/DataDog/dd-trace-rb/issues/3565
[#3573]: https://github.com/DataDog/dd-trace-rb/issues/3573
[#3582]: https://github.com/DataDog/dd-trace-rb/issues/3582
[#3585]: https://github.com/DataDog/dd-trace-rb/issues/3585
[#3587]: https://github.com/DataDog/dd-trace-rb/issues/3587
[@AdrianLC]: https://github.com/AdrianLC
[@Azure7111]: https://github.com/Azure7111
[@BabyGroot]: https://github.com/BabyGroot
Expand Down
Loading

0 comments on commit aad14ac

Please sign in to comment.