Skip to content

Commit

Permalink
Remove unsupported LangVersion from dotnet example (#2003)
Browse files Browse the repository at this point in the history
dotnet builds started failing, due to the upgrade of the github runners
to ubuntu 24.04.
The `RoleCS` test was failing with issues in selecting `LanguageVersion`
11.

I've removed that version identifier from the `csproj` of the failing
test to align with the other CS tests and changed it to not use features
from language version 11.

### Why did this work before?
Previously this worked, because the test implicitly used v8 of the
dotnet runtime instead of the requested v6 (configured in ci-mgmt
pulumi/ci-mgmt#1307).

The `setup-dotnet` action implicitly installs the latest LTS before
installing other versions.
We're requesting 6.0.x and on Ubuntu 22.04 this was already
pre-installed, so this happened:
- Install latest LTS (v8)
- Install v6.0.x -> Already present -> Noop

Because of that v8 was on the path first and used for tests.

Now on Ubuntu 24.04 v8 is pre-installed, so this happens:
- Install latest LTS (v8) -> Already present -> Noop
- Install v6.0.x

Now we're actually using the requested v6, but the `RoleCs` test is not
compatible with that.
  • Loading branch information
flostadler authored Jan 21, 2025
1 parent 344bbf6 commit 9d8e627
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
20 changes: 9 additions & 11 deletions examples/role-cs/MyStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@ public MyStack()
{
var testRole = new Role("role-test", new RoleArgs
{
AssumeRolePolicyDocument = """
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
AssumeRolePolicyDocument = @"{
""Version"": ""2012-10-17"",
""Statement"": [{
""Sid"": """",
""Effect"": ""Allow"",
""Principal"": {
""Service"": ""ec2.amazonaws.com""
},
"Action": "sts:AssumeRole"
""Action"": ""sts:AssumeRole""
}]
}
""",
}",
Policies = new[]
{
new IamInputs.RolePolicyArgs
Expand Down
1 change: 0 additions & 1 deletion examples/role-cs/role-cs.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>11</LangVersion>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
Expand Down

0 comments on commit 9d8e627

Please sign in to comment.