-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sanitize-environment
- Loading branch information
Showing
57 changed files
with
1,869 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Workflow: Dependency Graph Submission and Vulnerability Reporting | ||
# | ||
# Trigger: This workflow runs on every merge to the main branch. | ||
# | ||
# Purpose: It generates and submits a dependency graph to the GitHub Dependency Submission API. The graph is used to | ||
# trigger Dependabot Alerts for vulnerable dependencies, and to populate the Dependency Graph insights view in GitHub. | ||
# | ||
# Excludes: | ||
# - Test-only dependencies | ||
|
||
name: Dependency Submission | ||
|
||
on: | ||
push: | ||
branches: [ 'main' ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
dependency-submission: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 | ||
with: | ||
ref: 'main' | ||
|
||
- name: Set gradle.properties Workaround | ||
shell: bash | ||
run: | | ||
echo "jdk8=/tmp" >> gradle.properties | ||
echo "jdk11=/tmp" >> gradle.properties | ||
echo "jdk17=/tmp" >> gradle.properties | ||
echo "jdk21=/tmp" >> gradle.properties | ||
- name: Setup Java | ||
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # pin@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Generate and submit dependency graph | ||
uses: gradle/actions/dependency-submission@d156388eb19639ec20ade50009f3d199ce1e2808 # pin@v4 | ||
with: | ||
dependency-graph-exclude-configurations: '.*[Tt]est(Compile|Runtime)Classpath' | ||
dependency-graph-include-configurations: '.*(includeInJar|shadowIntoJar).*' | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gralde.com/help/legal-terms-of-use" | ||
build-scan-terms-of-use-agree: "yes" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
agent-bridge/src/main/java/com/newrelic/agent/bridge/CloudApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* | ||
* * Copyright 2024 New Relic Corporation. All rights reserved. | ||
* * SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package com.newrelic.agent.bridge; | ||
|
||
import com.newrelic.api.agent.Cloud; | ||
import com.newrelic.api.agent.CloudAccountInfo; | ||
|
||
/** | ||
* Internal Cloud API. This extends the public Cloud API and adds methods | ||
* for retrieving the data set by the public API methods. | ||
*/ | ||
public interface CloudApi extends Cloud { | ||
|
||
/** | ||
* Return the general account information of the provided type. | ||
* This data is either set by {@link Cloud#setAccountInfo(CloudAccountInfo, String)} | ||
* or the agent config. | ||
*/ | ||
String getAccountInfo(CloudAccountInfo cloudAccountInfo); | ||
|
||
/** | ||
* Retrieves the account information for a cloud service SDK client. | ||
* If no data was recorded for the SDK client, the general account information will be returned. | ||
*/ | ||
String getAccountInfo(Object sdkClient, CloudAccountInfo cloudAccountInfo); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
agent-bridge/src/main/java/com/newrelic/agent/bridge/NoOpCloud.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* | ||
* * Copyright 2024 New Relic Corporation. All rights reserved. | ||
* * SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package com.newrelic.agent.bridge; | ||
|
||
import com.newrelic.api.agent.CloudAccountInfo; | ||
|
||
public class NoOpCloud implements CloudApi { | ||
|
||
public static final CloudApi INSTANCE = new NoOpCloud(); | ||
|
||
private NoOpCloud() { | ||
// only instance should be the INSTANCE | ||
} | ||
|
||
@Override | ||
public void setAccountInfo(CloudAccountInfo cloudAccountInfo, String value) { | ||
} | ||
|
||
@Override | ||
public void setAccountInfo(Object sdkClient, CloudAccountInfo cloudAccountInfo, String value) { | ||
} | ||
|
||
@Override | ||
public String getAccountInfo(CloudAccountInfo cloudAccountInfo) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getAccountInfo(Object sdkClient, CloudAccountInfo cloudAccountInfo) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.