Skip to content

Commit

Permalink
post release v1.49.0: update major branch (#3580)
Browse files Browse the repository at this point in the history
* [maven-release-plugin] prepare for next development iteration

* Update cloudfoundry for 1.48.1 release

* ci: use .java-version and prepare to use VM with installed tools in BK (#3554)

* ci(bk): use specialised VMs (#3555)

* Added a note on centralized agent config support for AWS Lambda (#3498)

* Bump com.networknt:json-schema-validator from 1.1.0 to 1.3.3 (#3547)

* Bump com.networknt:json-schema-validator from 1.1.0 to 1.3.3

Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.1.0 to 1.3.3.
- [Release notes](https://github.com/networknt/json-schema-validator/releases)
- [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md)
- [Commits](networknt/json-schema-validator@1.1.0...1.3.3)

---
updated-dependencies:
- dependency-name: com.networknt:json-schema-validator
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix compilation

* Fix schema version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonas Kunz <jonas.kunz@elastic.co>

* Fix inheritance for API annotations (#3551)

* powershell no-logo (#3556)

* security: add permissions block to workflows (#3531)

* Bump io.micrometer:micrometer-core from 1.12.2 to 1.12.4 (#3559)

Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.2 to 1.12.4.
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.12.2...v1.12.4)

---
updated-dependencies:
- dependency-name: io.micrometer:micrometer-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump version.log4j from 2.12.4 to 2.23.1 (#3557)

* Bump version.log4j from 2.12.4 to 2.23.1

Bumps `version.log4j` from 2.12.4 to 2.23.1.

Updates `org.apache.logging.log4j:log4j-core` from 2.12.4 to 2.23.1

Updates `org.apache.logging.log4j:log4j-slf4j-impl` from 2.12.4 to 2.23.1

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-slf4j-impl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* restore previous log4j version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>

* Add API for instrumenting FAAS and adjust the AWS plugin (#3516)



---------

Co-authored-by: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>

* Introduce API for metrics collection that does not depend on agent-core (#3522)

* Remove logging API.

* Clean up core dependencies from POMs that do not need it.

* Add API for handling lambda instrumentation and apply to the AWS plugin.

* Move metrics API to tracer.

* Factor out JSON DSL for metrics.

* Fix import issue.

* Fix imports.

* Fix imports.

* fix formatting

---------

Co-authored-by: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>

* differentiate Lambda url from api gateway (#3417)


---------

Co-authored-by: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>

* added support to Elastic Load Balancer triggers (#3411)



---------

Co-authored-by: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com>

* feat: new release process with PRs (#3567)

* feat: new release process with PRs

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* chore: redirect to stderr for both message

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* chore: apply suggest

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* ci(chore): use env var instead of prefix v

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* ci: use maven wrapper instead of direct maven

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* feat: validate snapshot for snapshot workflow

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* docs: add new release process

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

---------

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* Bump version.aws.sdk from 2.25.0 to 2.25.21 in /apm-agent-plugins (#3574)

Bumps `version.aws.sdk` from 2.25.0 to 2.25.21.

Updates `software.amazon.awssdk:s3` from 2.25.0 to 2.25.21

Updates `software.amazon.awssdk:sqs` from 2.25.0 to 2.25.21

Updates `software.amazon.awssdk:dynamodb` from 2.25.0 to 2.25.21

---
updated-dependencies:
- dependency-name: software.amazon.awssdk:s3
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:sqs
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: software.amazon.awssdk:dynamodb
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump org.awaitility:awaitility from 4.2.0 to 4.2.1 (#3573)

Bumps [org.awaitility:awaitility](https://github.com/awaitility/awaitility) from 4.2.0 to 4.2.1.
- [Changelog](https://github.com/awaitility/awaitility/blob/master/changelog.txt)
- [Commits](awaitility/awaitility@awaitility-4.2.0...awaitility-4.2.1)

---
updated-dependencies:
- dependency-name: org.awaitility:awaitility
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add exclusion list option for calling DatabaseMetaData.getUserName (#3568)

* use a dummy user for testing

* exclusion list option for calling getUserName

* changelog and test break fixed

* pre release: elastic-apm-agent v1.49.0 (#3576)

Co-authored-by: apmmachine <apmmachine@users.noreply.github.com>

* ci(fix): use input value instead of env value for post release trigger (#3577)

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

* ci(fix): correct buildkite pipeline trigger (#3578)

Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Adrien Mannocci <adrien.mannocci@elastic.co>
Co-authored-by: apmmachine <apmmachine@users.noreply.github.com>
Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
Co-authored-by: Som <111349830+someshwaranM@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonas Kunz <jonas.kunz@elastic.co>
Co-authored-by: SylvainJuge <763082+SylvainJuge@users.noreply.github.com>
Co-authored-by: Jan Calanog <jan.calanog@elastic.co>
Co-authored-by: Rafael Winterhalter <rafael.wth@gmail.com>
Co-authored-by: Nugusbayev Kanagat <48118512+videnkz@users.noreply.github.com>
Co-authored-by: Adrien Mannocci <adrien.mannocci@elastic.co>
Co-authored-by: jackshirazi <jack.shirazi@elastic.co>
  • Loading branch information
12 people authored Apr 3, 2024
1 parent b6be414 commit fd29376
Show file tree
Hide file tree
Showing 335 changed files with 2,381 additions and 1,057 deletions.
16 changes: 14 additions & 2 deletions .buildkite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is the Buildkite pipeline for releasing the APM Agent Java.
### Pipeline Configuration

To view the pipeline and its configuration, click [here](https://buildkite.com/elastic/apm-agent-java-release) or
go to the definition in the `elastic/ci` repository.
go to the definition in `release.yml`.

### Credentials

Expand All @@ -25,7 +25,7 @@ This is the Buildkite pipeline for the APM Agent Java in charge of the snapshots
### Pipeline Configuration

To view the pipeline and its configuration, click [here](https://buildkite.com/elastic/apm-agent-java-snapshot) or
go to the definition in the `elastic/ci` repository.
go to the definition in `snapshot.yml`.

## opentelemetry-benchmark pipeline

Expand All @@ -35,3 +35,15 @@ This is the Buildkite pipeline for the Opentelemetry Benchmark.

To view the pipeline and its configuration, click [here](https://buildkite.com/elastic/apm-agent-java-opentelemetry-benchmark) or
go to the definition in `opentelemetry-benchmark.yml`.

## Buildkite VM runners

A set of Buildkite VM runners has been created for this repository. The VM runners contain
the required software:
* JDK
* GPG
* Maven dependencies

If a new version of Java is required, update the `.java-version` file with the latest major. When the changes are merged onto `main,` wait for the following day; that's when the automation will be responsible for recreating the VM with the new Java version.

If you would like to know more about how it works, please go to https://github.com/elastic/ci-agent-images/tree/main/vm-images/apm-agent-java (**NOTE**: only available for Elastic employees)
32 changes: 21 additions & 11 deletions .buildkite/hooks/prepare-common.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail

echo "--- Install JDK17 :java:"
# JDK version is defined in two different locations, here and .github/workflows/maven-goal/action.yml
JAVA_URL=https://jvm-catalog.elastic.co/jdk
JAVA_HOME=$(pwd)/.openjdk17
JAVA_PKG="$JAVA_URL/latest_openjdk_17_linux.tar.gz"
curl -L --output /tmp/jdk.tar.gz "$JAVA_PKG"
mkdir -p "$JAVA_HOME"
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1

# Configure the java version
JAVA_VERSION=$(cat .java-version | xargs | tr -dc '[:print:]')
JAVA_HOME="${HOME}/.java/openjdk${JAVA_VERSION}"
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
PATH="${JAVA_HOME}/bin:${PATH}"
export PATH

java -version || true
if [ -d "${JAVA_HOME}" ] ; then
echo "--- Skip installing JDK${JAVA_VERSION} :java:"
echo "already available in the Buildkite runner"
else
# Fallback to install at runtime
# This should not be the case normally untless the .java-version file has been changed
# and the VM Image is not yet available with the latest version.
echo "--- Install JDK${JAVA_VERSION} :java:"
JAVA_URL=https://jvm-catalog.elastic.co/jdk
JAVA_PKG="${JAVA_URL}/latest_openjdk_${JAVA_VERSION}_linux.tar.gz"
curl -L --output /tmp/jdk.tar.gz "${JAVA_PKG}"
mkdir -p "${JAVA_HOME}"
tar --extract --file /tmp/jdk.tar.gz --directory "${JAVA_HOME}" --strip-components 1
fi

# Validate java is available in the runner.
java -version
4 changes: 3 additions & 1 deletion .buildkite/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
agents:
provider: "gcp"
image: "family/apm-agent-java-ubuntu-2204"

steps:
- label: "Run the release"
Expand All @@ -11,4 +12,5 @@ steps:

notify:
- slack: "#apm-agent-java"
if: 'build.state != "passed"'
# skip slack messages if no failures and dry-run mode
if: 'build.state != "passed" && build.env("dry_run") == "false"'
4 changes: 3 additions & 1 deletion .buildkite/snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
agents:
provider: "gcp"
image: "family/apm-agent-java-ubuntu-2204"

steps:
- label: "Run the snapshot"
Expand All @@ -11,4 +12,5 @@ steps:

notify:
- slack: "#apm-agent-java"
if: 'build.state != "passed"'
# skip slack messages if no failures and dry-run mode
if: 'build.state != "passed" && build.env("dry_run") == "false"'
13 changes: 11 additions & 2 deletions .ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,14 @@ echo $PATH
java -version

set +x
echo "--- Deploy the release :package:"
./mvnw -V -s .ci/settings.xml -Pgpg clean deploy -DskipTests --batch-mode | tee release.txt
# Default in dry-run mode
GOAL="install"
DRY_RUN_MSG="(dry-run)"
# Otherwise, a RELEASE
if [[ "$dry_run" == "false" ]] ; then
GOAL="deploy"
DRY_RUN_MSG=""
fi

echo "--- Deploy the release :package: [./mvnw $GOAL)] $DRY_RUN_MSG"
./mvnw -V -s .ci/settings.xml -Pgpg clean $GOAL -DskipTests --batch-mode | tee release.txt
31 changes: 31 additions & 0 deletions .ci/release/post-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

# Bash strict mode
set -euo pipefail

# Found current script directory
RELATIVE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# Found project directory
BASE_PROJECT="$(dirname $(dirname "${RELATIVE_DIR}"))"

# Import dependencies
source "${RELATIVE_DIR}/util.sh"

# Constants
BASE_URL="https://repo1.maven.org/maven2/co/elastic/apm/elastic-apm-agent"
CF_FILE="${BASE_PROJECT}/cloudfoundry/index.yml"

# Requirements
check_version "${RELEASE_VERSION}"

echo "Set next snapshot version"
./mvnw -V versions:set -DprocessAllModules=true -DgenerateBackupPoms=false -DnextSnapshot=true

# make script idempotent if release is already in CF descriptor
set +e
grep -e "^${RELEASE_VERSION}:" ${CF_FILE}
[[ $? == 0 ]] && exit 0
set -e
echo "Update cloudfoundry version"
echo "${RELEASE_VERSION}: ${BASE_URL}/${RELEASE_VERSION}/elastic-apm-agent-${RELEASE_VERSION}.jar" >> "${CF_FILE}"
22 changes: 22 additions & 0 deletions .ci/release/pre-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# Bash strict mode
set -euo pipefail

# Found current script directory
RELATIVE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# Found project directory
BASE_PROJECT="$(dirname $(dirname "${RELATIVE_DIR}"))"

# Import dependencies
source "${RELATIVE_DIR}/util.sh"

# Requirements
check_version "${RELEASE_VERSION}"

echo "Set release version"
./mvnw -V versions:set -DprocessAllModules=true -DgenerateBackupPoms=false -DnewVersion="${RELEASE_VERSION}"

echo "Prepare changelog for release"
java "${BASE_PROJECT}/.ci/ReleaseChangelog.java" CHANGELOG.asciidoc "${RELEASE_VERSION}"
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,10 @@ git checkout --force ${checkout_options}

echo -e "\n--- move local branch ${major_branch} to match tag ${tag}"
git reset --hard ${tag}

echo -e "\n--- create new branch with updates"
git checkout -b "update-major-${v}"
git push origin "update-major-${v}"

echo -e "\n--- create PR to update major branch"
gh pr create --title="post release v${v}: update major branch" --base "${major_branch}" --head "update-major-${v}" -b "post release v${v}"
28 changes: 0 additions & 28 deletions .ci/release/update_cloudfoundry.sh

This file was deleted.

10 changes: 4 additions & 6 deletions .ci/release/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
check_version() {
v=${1:-}

if [[ "${v}" == "" ]]; then
echo "usage $0 <version>" # here $0 will be the calling script
echo "where <version> in format '1.2.3'"
if [ -z "${v}" ]; then
>&2 echo "The environment variable 'RELEASE_VERSION' isn't defined"
exit 1
fi

if [[ ! "$v" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "invalid version format '${v}'"
if [[ ! "${v}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
>&2 echo "The environment variable 'RELEASE_VERSION' should respect SemVer format"
exit 1
fi
}
Expand Down
13 changes: 0 additions & 13 deletions .ci/release/wait_maven_artifact_published.sh

This file was deleted.

15 changes: 10 additions & 5 deletions .ci/snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ echo $PATH
java -version

set +x
echo "--- Deploy the snapshot :package:"
if [[ "$dry_run" == "true" ]] ; then
echo './mvnw -V -s .ci/settings.xml -Pgpg clean deploy -DskipTests --batch-mode'
else
./mvnw -V -s .ci/settings.xml -Pgpg clean deploy -DskipTests --batch-mode | tee snapshot.txt
# Default in dry-run mode
GOAL="install"
DRY_RUN_MSG="(dry-run)"
# Otherwise, a snapshot
if [[ "$dry_run" == "false" ]] ; then
GOAL="deploy"
DRY_RUN_MSG=""
fi

echo "--- Deploy the snapshot :package: [./mvnw $GOAL)] $DRY_RUN_MSG"
./mvnw -V -s .ci/settings.xml -Pgpg clean $GOAL -DskipTests --batch-mode | tee snapshot.txt
6 changes: 5 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ Every time there is a merge to main or any branches the whole workflow will comp

### Release process

This process has been fully automated and it gets triggered manually when running the [release](https://github.com/elastic/apm-agent-java/actions/workflows/release.yml) workflow. It runs then a Buildkite pipeline in charge of generating and publishing the artifacts,
To release a new version of apm-agent-java, you must use the two GitHub Workflows.
Trigger the `Pre Release` workflow targeting the release version.
After merging the PRs created by the first workflow, you can trigger the `Release` workflow targeting the release version.
It runs then a Buildkite pipeline in charge of generating and publishing the artifacts,
for further details please go to [the buildkite folder](../../.buildkite/README.md).
Finally, merge the PRs created to bump version for the next iteration.

The tag release follows the naming convention: `v.<major>.<minor>.<patch>`, where `<major>`, `<minor>` and `<patch>`.

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/addToProject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
issues:
types:
- opened, milestoned
permissions:
contents: read

jobs:
add_to_project:
if: github.event.issue && github.event.issue.milestone
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request_target:
types: [opened]

permissions:
contents: read
issues: write
pull-requests: write

jobs:
triage:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ jobs:
distribution: 'temurin'
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/maven-goal
- uses: ./.github/workflows/maven-goal-jdk
with:
test-java-version: ${{ matrix.version }}
test-java-distribution: ${{ matrix.distribution }}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/maven-goal-jdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---

name: common build tasks
description: Install specific JDK and run a command

inputs:
test-java-version:
description: 'Testing Java version'
required: true
default: '17'
test-java-distribution:
description: 'Testing Java distribution'
required: true
default: 'temurin'
command:
description: 'Command to execute'
required: true
shell:
description: 'Default shell'
default: 'bash'
required: false

runs:
using: "composite"
steps:
- name: Set up testing JDK
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.test-java-version}}
distribution: ${{ inputs.test-java-distribution}}

- name: Set up TEST_JAVA_BINARY environment variable
shell: bash
run: |
major_version="$(echo '${{ inputs.test-java-version }}' | sed 's/\([0-9]*\).*/\1/')"
java_home_var=JAVA_HOME_${major_version}_${{ runner.arch }}
echo "TEST_JAVA_BINARY=${!java_home_var}/bin/java" >> $GITHUB_ENV
- uses: ./.github/workflows/maven-goal
with:
command: ${{ inputs.command }}
shell: ${{ inputs.shell }}
env:
TEST_JAVA_BINARY: ${{ env.TEST_JAVA_BINARY }}
22 changes: 1 addition & 21 deletions .github/workflows/maven-goal/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ name: common build tasks
description: Install specific JDK and run a command

inputs:
test-java-version:
description: 'Testing Java version'
required: true
default: '17'
test-java-distribution:
description: 'Testing Java distribution'
required: true
default: 'temurin'
command:
description: 'Command to execute'
required: true
Expand All @@ -23,23 +15,11 @@ inputs:
runs:
using: "composite"
steps:
- name: Set up testing JDK
if: ${{ inputs.test-java-version != '17' }}
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.test-java-version}}
distribution: ${{ inputs.test-java-distribution}}
- name: Set up build JDK
uses: actions/setup-java@v4
with:
java-version: 17 # NOTE: This version is also defined in .buildkite/hooks/pre-command
java-version-file: .java-version
distribution: temurin
cache: 'maven'
- name: Set up TEST_JAVA_BINARY environment variable
shell: bash
run: |
major_version="$(echo '${{ inputs.test-java-version }}' | sed 's/\([0-9]*\).*/\1/')"
java_home_var=JAVA_HOME_${major_version}_${{ runner.arch }}
echo "TEST_JAVA_BINARY=${!java_home_var}/bin/java" >> $GITHUB_ENV
- run: ${{ inputs.command }}
shell: ${{ inputs.shell }}
Loading

0 comments on commit fd29376

Please sign in to comment.