Skip to content

Commit

Permalink
Merge branch 'main' into feature/include-labels-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaffinito authored Nov 8, 2024
2 parents 139a82f + 0278836 commit fd06458
Show file tree
Hide file tree
Showing 128 changed files with 3,252 additions and 894 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/all_solutions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,32 @@ jobs:
contents: read
pull-requests: read

shellcheck:
name: Validate shell scripts
needs: check-modified-files
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: audit

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Run Shellcheck
run: |
find ${{ github.workspace }} -name "*.sh" -exec shellcheck --severity=error {} +
# This builds both FullAgent and MSIInstaller since MSIInstaller requires FullAgent artifacts.
build-fullagent-msi:
name: Build FullAgent and MSIInstaller
runs-on: windows-2022
needs: check-modified-files
needs:
- check-modified-files
- shellcheck
# don't run this job if triggered by Dependabot, will cause all other jobs to be skipped as well
# run this job if non-workflow files were modified, or if triggered by a release, a manual execution or schedule
if: github.actor != 'dependabot[bot]' && (needs.check-modified-files.outputs.non-workflow-files-changed == 'true' || github.event.release || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/multiverse_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
shell: bash

- name: Setup .NET Core 3.1.100
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
dotnet-version: '3.1.100'

Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
egress-policy: audit

- name: Setup .NET Core 3.1.100
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
dotnet-version: '3.1.100'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_linux_container_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ jobs:
INTEGRATION_TEST_SECRETS: ${{ secrets.TEST_SECRETS }}
run: |
echo $INTEGRATION_TEST_SECRETS | dotnet user-secrets set --project ${{ env.integration_tests_shared_project }}
- name: Build & Run Linux Container Integration Tests
run: dotnet test ./tests/Agent/IntegrationTests/ContainerIntegrationTests/ContainerIntegrationTests.csproj --framework net8.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Text.Json.Serialization;
using System.Text.Json.Serialization;

namespace nugetSlackNotifications
{
Expand All @@ -10,6 +10,8 @@ public class PackageInfo
public bool IgnorePatch { get; set; }
[JsonPropertyName("ignoreMinor")]
public bool IgnoreMinor { get; set; }
[JsonPropertyName("ignoreMajor")]
public bool IgnoreMajor { get; set; }
[JsonPropertyName("ignoreReason")]
public string IgnoreReason {get; set;}
}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/scripts/nugetSlackNotifications/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static async Task CheckPackage(PackageInfo package, PackageMetadataResource meta
// check publish date
if (latest.Published >= searchTime)
{
if (previous != null && (package.IgnorePatch || package.IgnoreMinor))
if (previous != null && (package.IgnorePatch || package.IgnoreMinor || package.IgnoreMajor))
{
var previousVersion = previous.Identity.Version;
var latestVersion = latest.Identity.Version;
Expand All @@ -154,6 +154,14 @@ static async Task CheckPackage(PackageInfo package, PackageMetadataResource meta
return;
}
}
if (package.IgnoreMajor)
{
if (previousVersion.Major != latestVersion.Major)
{
Log.Information($"Package {packageName} ignores Major version updates.");
return;
}
}
}

var previousVersionDescription = previous?.Identity.Version.ToNormalizedString() ?? "Unknown";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NewRelic.Agent.Api" Version="10.32.0" />
<PackageReference Include="NewRelic.Agent.Api" Version="10.33.1" />
<PackageReference Include="Octokit" Version="13.0.1" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/scripts/nugetSlackNotifications/packageInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
"ignoreReason": "frequent patch releases create too much noise"
},
{
"packageName": "log4net"
"packageName": "log4net",
"ignorePatch": true,
"ignoreMinor": true,
"ignoreMajor": true,
"ignoreReason": "Breaking major update. See https://github.com/newrelic/newrelic-dotnet-agent/issues/2764"
},
{
"packageName": "microsoft.extensions.logging"
Expand All @@ -66,7 +70,11 @@
"packageName": "microsoft.net.http"
},
{
"packageName": "mongodb.driver"
"packageName": "mongodb.driver",
"ignorePatch": true,
"ignoreMinor": true,
"ignoreMajor": true,
"ignoreReason": "Breaking since at least 2.25.0. See https://new-relic.atlassian.net/browse/NR-281915"
},
{
"packageName": "mysql.data"
Expand Down
4 changes: 2 additions & 2 deletions FullAgent.sln
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureFunction", "src\Agent\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PublicApiChangeTests", "tests\Agent\UnitTests\PublicApiChangeTests\PublicApiChangeTests.csproj", "{A8F6EFEA-1C31-4461-A7B4-25C30D954EE2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Memcached", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Memcached\Memcached.csproj", "{5D74E5C5-9BA3-423B-86F7-14C2D1A14661}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Memcached", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Memcached\Memcached.csproj", "{5D74E5C5-9BA3-423B-86F7-14C2D1A14661}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -540,8 +540,8 @@ Global
{5D74E5C5-9BA3-423B-86F7-14C2D1A14661} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FullAgent.vsmdi
Expand Down
2 changes: 1 addition & 1 deletion build/ArtifactBuilder/Artifacts/MsiInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MsiInstaller : Artifact
private readonly string[] _coreIISRegistryValues = new string[] {
"CORECLR_ENABLE_PROFILING=1",
"CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"CORECLR_NEW_RELIC_HOME=[NETAGENTCOMMONFOLDER]" };
"CORECLR_NEWRELIC_HOME=[NETAGENTCOMMONFOLDER]" };

private readonly AgentComponents _frameworkAgentComponents;
private readonly AgentComponents _coreAgentComponents;
Expand Down
2 changes: 1 addition & 1 deletion build/Linux/build/common/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# This script can be used to run a dotnet application with New Relic monitoring.

CORECLR_NEW_RELIC_HOME=${CORECLR_NEW_RELIC_HOME:-/usr/local/newrelic-dotnet-agent} CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} CORECLR_PROFILER_PATH=$CORECLR_NEW_RELIC_HOME/libNewRelicProfiler.so $@
NRHOME="${CORECLR_NEWRELIC_HOME:-${CORECLR_NEW_RELIC_HOME:-/usr/local/newrelic-dotnet-agent}}" CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} CORECLR_PROFILER_PATH="$NRHOME/libNewRelicProfiler.so" "$@"
10 changes: 6 additions & 4 deletions build/Linux/build/common/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

if [ -z "$CORECLR_NEW_RELIC_HOME" ]; then
echo "CORECLR_NEW_RELIC_HOME is undefined"
if [ -z "$CORECLR_NEWRELIC_HOME" ] && [ -z "$CORECLR_NEW_RELIC_HOME" ]; then
echo "CORECLR_NEWRELIC_HOME is undefined"
else
NRHOME=${CORECLR_NEWRELIC_HOME:-${CORECLR_NEW_RELIC_HOME}}

export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}
export CORECLR_PROFILER_PATH=$CORECLR_NEW_RELIC_HOME/libNewRelicProfiler.so
fi
export CORECLR_PROFILER_PATH=$NRHOME/libNewRelicProfiler.so
fi
4 changes: 2 additions & 2 deletions build/Linux/build/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ fi
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null

echo "export CORECLR_NEW_RELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/${PACKAGE_NAME}-path.sh
echo "export CORECLR_NEWRELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/${PACKAGE_NAME}-path.sh
source /etc/profile.d/${PACKAGE_NAME}-path.sh

chmod o+w $NEWRELIC_HOME/logs
chmod +x $NEWRELIC_HOME/*.sh 2> /dev/null

printf "Initialize the New Relic .NET Agent environment variables by running:\n"
printf "\t\033[1msource /etc/profile.d/${PACKAGE_NAME}-path.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEW_RELIC_HOME/setenv.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEWRELIC_HOME/setenv.sh\033[0m\n"
4 changes: 2 additions & 2 deletions build/Linux/build/rpm/newrelic-dotnet-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ fi
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null

echo "export CORECLR_NEW_RELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/%{name}-path.sh
echo "export CORECLR_NEWRELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/%{name}-path.sh
source /etc/profile.d/%{name}-path.sh

chmod o+w $NEWRELIC_HOME/logs
chmod +x $NEWRELIC_HOME/*.sh 2> /dev/null

printf "Initialize the New Relic .NET Agent environment variables by running:\n"
printf "\t\033[1msource /etc/profile.d/%{name}-path.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEW_RELIC_HOME/setenv.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEWRELIC_HOME/setenv.sh\033[0m\n"
Loading

0 comments on commit fd06458

Please sign in to comment.