diff --git a/README.md b/README.md index 4465af1..c695e19 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ The action has the following parameters: | Name | Description | Required | Default | | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------- | | languages | List of languages to be instrumented. Can be either "all" or any of "java", "js", "python", "dotnet", "ruby", "go" (multiple languages can be specified as a space-separated list). | true | | -| api_key | Datadog API key. Can be found at https://app.datadoghq.com/organization-settings/api-keys | true | | -| site | Datadog site. See https://docs.datadoghq.com/getting_started/site for more information about sites. | false | datadoghq.com | +| api_key | Datadog API key. Can be found at | true | | +| site | Datadog site. See for more information about sites. | false | datadoghq.com | | service | The name of the service or library being tested. | false | | | dotnet-tracer-version | The version of Datadog .NET tracer to use. Defaults to the latest release. | false | | | java-tracer-version | The version of Datadog Java tracer to use. Defaults to the latest release. | false | | @@ -50,6 +50,8 @@ The action has the following parameters: | go-tracer-version | The version of Orchestrion to use. Defaults to the latest release. | false | | | go-module-dir | Path to the Go module root directory to instrument. Use this when the repository contains multiple Go modules or the Go module is not in the workspace root. | false | | | java-instrumented-build-system | If provided, only the specified build systems will be instrumented (allowed values are `gradle`,`maven`,`sbt`,`ant`,`all`). `all` is a special value that instruments every Java process. If this property is not provided, all known build systems will be instrumented (Gradle, Maven, SBT, Ant). | false | | +| java-tracer-repository-url | Base URL of a Maven repository (or proxy/mirror) used to download the Java tracer JAR and its sha256. The path under the base must follow the standard Maven layout for `com.datadoghq:dd-java-agent`. Defaults to Maven Central. | false | | +| java-tracer-repository-auth-header | Optional HTTP header used to authenticate against `java-tracer-repository-url`, provided as a complete `Name: Value` string (e.g. `Authorization: Bearer `). Only used when `java-tracer-repository-url` is set. Redirects are not followed when this option is set. | false | | | cache | Enable caching of downloaded tracers. | false | true | | print-github-step-summary | Print a summary of the installed tracers to the GitHub step summary. If set to false, the summary is printed to console instead. | false | true | @@ -66,6 +68,22 @@ Any [additional configuration values](https://docs.datadoghq.com/tracing/trace_c DD_TAGS: layer:api,team:intake,key:value ``` +### Using a Maven mirror or proxy for the Java tracer + +By default the Java tracer JAR is fetched from Maven Central (`https://repo1.maven.org/maven2`). Organizations with their own mirror or proxy can point the action at it: + +```yaml +- name: Configure Datadog Test Optimization + uses: datadog/test-visibility-github-action@v2 + with: + languages: java + api_key: ${{ secrets.DD_API_KEY }} + java-tracer-repository-url: https://artifactory.example.com/maven-virtual/com/datadoghq/dd-java-agent + java-tracer-repository-auth-header: Authorization: Bearer ${{ secrets.ARTIFACTORY_TOKEN }} +``` + +The base URL must expose the standard Maven layout for `com.datadoghq:dd-java-agent` (i.e. `//dd-java-agent-.jar` and the matching `.sha256`, plus `/maven-metadata.xml` when no `java-tracer-version` is pinned). The `.sha256` files are still verified. + ### Go multi-module repositories If your repository contains multiple Go modules, or the Go module you want to instrument is not at the workspace root, set `go-module-dir` to the module root directory that contains the target `go.mod` file: diff --git a/action.yml b/action.yml index 2b416f7..f3e915d 100644 --- a/action.yml +++ b/action.yml @@ -44,6 +44,12 @@ inputs: java-instrumented-build-system: description: 'If provided, only the specified build systems will be instrumented (allowed values are `gradle` and `maven`). Otherwise every Java process will be instrumented.' required: false + java-tracer-repository-url: + description: 'Base URL of a Maven repository (or proxy/mirror) used to download the Java tracer JAR and its sha256. The path under the base must follow the standard Maven layout for `com.datadoghq:dd-java-agent`. Defaults to Maven Central.' + required: false + java-tracer-repository-auth-header: + description: 'Optional HTTP header used to authenticate against `java-tracer-repository-url`, provided as a complete `Name: Value` string (e.g. `Authorization: Bearer `). Only used when `java-tracer-repository-url` is set. Redirects are not followed when this option is set.' + required: false cache: description: 'Enable caching (optional). Defaults to true.' required: false @@ -75,8 +81,8 @@ runs: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH shell: bash env: - INSTALLATION_SCRIPT_URL: https://install.datadoghq.com/scripts/install_test_visibility_v13.sh - INSTALLATION_SCRIPT_CHECKSUM: 1271425bc94d25ff771111802f1b010104f3a9245bd491b67f1be561529f6b89 + INSTALLATION_SCRIPT_URL: https://install.datadoghq.com/scripts/install_test_visibility_v14.sh + INSTALLATION_SCRIPT_CHECKSUM: 73824cfac695ed17177b4a2fc0b9afb3b19b639d27a20166190bf8997248423b GITHUB_ACTION_PATH: ${{ github.action_path }} - name: Get Go cache directories @@ -160,6 +166,8 @@ runs: DD_SET_TRACER_VERSION_GO: ${{ inputs.go-tracer-version }} DD_CIVISIBILITY_GO_MODULE_DIR: ${{ inputs.go-module-dir }} DD_INSTRUMENTATION_BUILD_SYSTEM_JAVA: ${{ inputs.java-instrumented-build-system }} + DD_SET_TRACER_REPOSITORY_URL_JAVA: ${{ inputs.java-tracer-repository-url }} + DD_SET_AUTH_HEADER_JAVA: ${{ inputs.java-tracer-repository-auth-header }} - name: Propagate optional site input to environment variable if: "${{ inputs.site != '' }}"