Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove strict global.json requirements #4687

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json
use-latest: true

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -60,8 +60,8 @@ jobs:
- name: dotnet restore
run: dotnet restore

- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Build
run: dotnet build --configuration Release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
3 changes: 1 addition & 2 deletions build/.vsts-PRInternalChecks-azureBuild-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:
clean: true

- task: UseDotNet@2
displayName: Use .NET sdk
inputs:
useGlobalJson: true
version: '8.0.x'

- task: DotNetCoreCLI@1
name: ''
Expand Down
3 changes: 1 addition & 2 deletions build/InternalChecksCI-azureBuild-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ jobs:
nugetConfigPath: nuget.config

- task: UseDotNet@2
displayName: Use .NET Core sdk
inputs:
useGlobalJson: true
version: '8.0.x'

- task: DotNetCoreCLI@1
name: ''
Expand Down
3 changes: 1 addition & 2 deletions build/export-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ stages:
vmImage: '$(LinuxVmImage)'
steps:
- task: UseDotNet@2
displayName: 'Use .NET sdk'
inputs:
useGlobalJson: true
version: '8.0.x'
- task: DotNetCoreCLI@2
displayName: 'dotnet build $(buildConfiguration)'
inputs:
Expand Down
3 changes: 1 addition & 2 deletions build/jobs/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ parameters:

steps:
- task: UseDotNet@2
displayName: Use .NET Core sdk
inputs:
useGlobalJson: true
version: '8.0.x'

- ${{ if eq(parameters.analyzeBinaries, 'true') }}:
- task: DownloadBuildArtifacts@0
Expand Down
3 changes: 1 addition & 2 deletions build/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ parameters:

steps:
- task: UseDotNet@2
displayName: 'Use .NET SDK'
inputs:
useGlobalJson: true
version: '8.0.x'

- ${{ if eq(parameters.targetBuildFramework, '') }}:
- task: DotNetCoreCLI@2
Expand Down
2 changes: 1 addition & 1 deletion build/jobs/e2e-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ steps:

- task: UseDotNet@2
inputs:
useGlobalJson: true
version: '8.0.x'

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: resolute-oss-tenant-info'
Expand Down
5 changes: 3 additions & 2 deletions build/jobs/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- task: UseDotNet@2
inputs:
useGlobalJson: true
version: '8.0.x'

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: ${{ parameters.keyVaultName }}'
Expand Down Expand Up @@ -92,7 +92,8 @@ jobs:

- task: UseDotNet@2
inputs:
useGlobalJson: true
packageType: 'sdk'
version: '8.0.x'

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: ${{ parameters.keyVaultName }}-sql'
Expand Down
2 changes: 1 addition & 1 deletion build/jobs/update-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ steps:

- task: UseDotNet@2
inputs:
useGlobalJson: true
version: '8.0.x'

- powershell: |
dotnet tool install --global GitVersion.Tool --version 5.12.0
Expand Down
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"sdk": {
"version": "8.0.403"
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,6 @@
<Import Project="..\..\src\Microsoft.Health.Fhir.Shared.Tests\Microsoft.Health.Fhir.Shared.Tests.projitems" Label="Shared" />
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.E2E.Common\Microsoft.Health.Fhir.Shared.Tests.E2E.Common.projitems" Label="Shared" />
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.Crucible\Microsoft.Health.Fhir.Shared.Tests.Crucible.projitems" Label="Shared" />
<Target Name="VerifyExactSdkVersion" BeforeTargets="Build">
<!--
Verify that the we are compiling with the exact version of the SDK that is specified in the global.json file.
If the version specified in the file is not installed on the system, dotnet uses the latest installed version instead.
We want to avoid that behavior because new SDK versions by default target the runtime version it is released with,
so the runtime behavior could be different depending on what SDK versions were installed on the machine that compiled
the code.
-->
<PropertyGroup>
<GlobalJsonPath>$([MSBuild]::GetPathOfFileAbove(global.json))</GlobalJsonPath>
<GlobalJsonContent>$([System.IO.File]::ReadAllText($(GlobalJsonPath)))</GlobalJsonContent>
<ParsedSdkVersion><![CDATA[$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '"version"\s*:\s*"(\d+.\d+.\d+)"').Groups[1].Value)]]></ParsedSdkVersion>
</PropertyGroup>
<Error Condition="$(NETCoreSdkVersion) != $(ParsedSdkVersion)" Text="The .NET SDK version required by $(GlobalJsonPath) is $(ParsedSdkVersion) but that version does not seem to be installed. In order to ensure consistent behavior, please install version $(ParsedSdkVersion) of the .NET SDK from https://dotnet.microsoft.com/download." />
</Target>
<Target Name="AddRuntimeConfigFileToBuiltProjectOutputGroupOutput" Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'" BeforeTargets="BuiltProjectOutputGroup">
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)" FinalOutputPath="$(ProjectRuntimeConfigFilePath)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,6 @@
<Import Project="..\..\src\Microsoft.Health.Fhir.Shared.Tests\Microsoft.Health.Fhir.Shared.Tests.projitems" Label="Shared" />
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.E2E.Common\Microsoft.Health.Fhir.Shared.Tests.E2E.Common.projitems" Label="Shared" />
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.Crucible\Microsoft.Health.Fhir.Shared.Tests.Crucible.projitems" Label="Shared" />
<Target Name="VerifyExactSdkVersion" BeforeTargets="Build">
<!--
Verify that the we are compiling with the exact version of the SDK that is specified in the global.json file.
If the version specified in the file is not installed on the system, dotnet uses the latest installed version instead.
We want to avoid that behavior because new SDK versions by default target the runtime version it is released with,
so the runtime behavior could be different depending on what SDK versions were installed on the machine that compiled
the code.
-->
<PropertyGroup>
<GlobalJsonPath>$([MSBuild]::GetPathOfFileAbove(global.json))</GlobalJsonPath>
<GlobalJsonContent>$([System.IO.File]::ReadAllText($(GlobalJsonPath)))</GlobalJsonContent>
<ParsedSdkVersion><![CDATA[$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '"version"\s*:\s*"(\d+.\d+.\d+)"').Groups[1].Value)]]></ParsedSdkVersion>
</PropertyGroup>
<Error Condition="$(NETCoreSdkVersion) != $(ParsedSdkVersion)" Text="The .NET SDK version required by $(GlobalJsonPath) is $(ParsedSdkVersion) but that version does not seem to be installed. In order to ensure consistent behavior, please install version $(ParsedSdkVersion) of the .NET SDK from https://dotnet.microsoft.com/download." />
</Target>
<Target Name="AddRuntimeConfigFileToBuiltProjectOutputGroupOutput" Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'" BeforeTargets="BuiltProjectOutputGroup">
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)" FinalOutputPath="$(ProjectRuntimeConfigFilePath)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,6 @@
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.E2E\Microsoft.Health.Fhir.Shared.Tests.E2E.projitems" Label="Shared" />
<Import Project="..\..\src\Microsoft.Health.Fhir.Shared.Tests\Microsoft.Health.Fhir.Shared.Tests.projitems" Label="Shared" />
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.E2E.Common\Microsoft.Health.Fhir.Shared.Tests.E2E.Common.projitems" Label="Shared" />
<Target Name="VerifyExactSdkVersion" BeforeTargets="Build">
<!--
Verify that the we are compiling with the exact version of the SDK that is specified in the global.json file.
If the version specified in the file is not installed on the system, dotnet uses the latest installed version instead.
We want to avoid that behavior because new SDK versions by default target the runtime version it is released with,
so the runtime behavior could be different depending on what SDK versions were installed on the machine that compiled
the code.
-->
<PropertyGroup>
<GlobalJsonPath>$([MSBuild]::GetPathOfFileAbove(global.json))</GlobalJsonPath>
<GlobalJsonContent>$([System.IO.File]::ReadAllText($(GlobalJsonPath)))</GlobalJsonContent>
<ParsedSdkVersion><![CDATA[$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '"version"\s*:\s*"(\d+.\d+.\d+)"').Groups[1].Value)]]></ParsedSdkVersion>
</PropertyGroup>
<Error Condition="$(NETCoreSdkVersion) != $(ParsedSdkVersion)" Text="The .NET SDK version required by $(GlobalJsonPath) is $(ParsedSdkVersion) but that version does not seem to be installed. In order to ensure consistent behavior, please install version $(ParsedSdkVersion) of the .NET SDK from https://dotnet.microsoft.com/download." />
</Target>
<Target Name="AddRuntimeConfigFileToBuiltProjectOutputGroupOutput" Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'" BeforeTargets="BuiltProjectOutputGroup">
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)" FinalOutputPath="$(ProjectRuntimeConfigFilePath)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,6 @@
<Import Project="..\..\src\Microsoft.Health.Fhir.Shared.Tests\Microsoft.Health.Fhir.Shared.Tests.projitems" Label="Shared" />
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.E2E.Common\Microsoft.Health.Fhir.Shared.Tests.E2E.Common.projitems" Label="Shared" />
<Import Project="..\Microsoft.Health.Fhir.Shared.Tests.Crucible\Microsoft.Health.Fhir.Shared.Tests.Crucible.projitems" Label="Shared" />
<Target Name="VerifyExactSdkVersion" BeforeTargets="Build">

<!--
Verify that the we are compiling with the exact version of the SDK that is specified in the global.json file.
If the version specified in the file is not installed on the system, dotnet uses the latest installed version instead.
We want to avoid that behavior because new SDK versions by default target the runtime version it is released with,
so the runtime behavior could be different depending on what SDK versions were installed on the machine that compiled
the code.
-->
<PropertyGroup>
<GlobalJsonPath>$([MSBuild]::GetPathOfFileAbove(global.json))</GlobalJsonPath>
<GlobalJsonContent>$([System.IO.File]::ReadAllText($(GlobalJsonPath)))</GlobalJsonContent>
<ParsedSdkVersion><![CDATA[$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '"version"\s*:\s*"(\d+.\d+.\d+)"').Groups[1].Value)]]></ParsedSdkVersion>
</PropertyGroup>
<Error Condition="$(NETCoreSdkVersion) != $(ParsedSdkVersion)" Text="The .NET SDK version required by $(GlobalJsonPath) is $(ParsedSdkVersion) but that version does not seem to be installed. In order to ensure consistent behavior, please install version $(ParsedSdkVersion) of the .NET SDK from https://dotnet.microsoft.com/download." />
</Target>
<Target Name="AddRuntimeConfigFileToBuiltProjectOutputGroupOutput" Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'" BeforeTargets="BuiltProjectOutputGroup">
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)" FinalOutputPath="$(ProjectRuntimeConfigFilePath)" />
Expand Down
Loading