Skip to content

Commit 8a22adb

Browse files
SNOW-1644121: Fix build warnings (#1011)
1 parent 60c2f2b commit 8a22adb

20 files changed

+129
-110
lines changed

.github/workflows/jira_close.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
with:
1414
repository: snowflakedb/gh-actions
1515
ref: jira_v1

.github/workflows/jira_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
repository: snowflakedb/gh-actions
2020
ref: jira_v1

.github/workflows/linter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
runs-on: windows-latest
2626
steps:
2727
- name: Check out Git repository
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
- name: Set up .NET
30-
uses: actions/setup-dotnet@v1
30+
uses: actions/setup-dotnet@v4
3131
with:
3232
dotnet-version: '8.0.x'
3333
dotnet-quality: 'ga'

.github/workflows/main.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
cloud_env: ['AZURE', 'GCP', 'AWS']
3636
steps:
3737
- name: Checkout code
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939
- name: Setup Dotnet
4040
uses: actions/setup-dotnet@v4
4141
with:
@@ -44,7 +44,7 @@ jobs:
4444
8.0.x
4545
dotnet-quality: 'ga'
4646
- name: Setup Python
47-
uses: actions/setup-python@v4
47+
uses: actions/setup-python@v5
4848
with:
4949
python-version: '3.x'
5050
- name: Setup dotnet-coverage
@@ -69,17 +69,18 @@ jobs:
6969
snowflake_cloud_env: ${{ matrix.cloud_env }}
7070
net_version: ${{ matrix.dotnet }}
7171
- name: Upload Code Coverage Report
72-
uses: actions/upload-artifact@v3
72+
uses: actions/upload-artifact@v4
7373
with:
74-
name: code-coverage-report
74+
name: code-coverage-report_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
7575
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
76+
7677
- name: Upload Test Performance Report
77-
uses: actions/upload-artifact@v3
78+
uses: actions/upload-artifact@v4
7879
with:
79-
name: tests-performance
80+
name: tests-performance_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
8081
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
8182
- name: Upload coverage reports to Codecov
82-
uses: codecov/codecov-action@v3
83+
uses: codecov/codecov-action@v4
8384
with:
8485
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
8586
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
@@ -95,7 +96,7 @@ jobs:
9596
dotnet: ['net6.0', 'net7.0', 'net8.0']
9697
cloud_env: ['AZURE', 'GCP', 'AWS']
9798
steps:
98-
- uses: actions/checkout@v3
99+
- uses: actions/checkout@v4
99100
- name: Setup Dotnet
100101
uses: actions/setup-dotnet@v4
101102
with:
@@ -104,7 +105,7 @@ jobs:
104105
8.0.x
105106
dotnet-quality: 'ga'
106107
- name: Setup Python
107-
uses: actions/setup-python@v4
108+
uses: actions/setup-python@v5
108109
with:
109110
python-version: '3.x'
110111
- name: Setup dotnet-coverage
@@ -128,17 +129,17 @@ jobs:
128129
snowflake_cloud_env: ${{ matrix.cloud_env }}
129130
net_version: ${{ matrix.dotnet }}
130131
- name: Upload Code Coverage Report
131-
uses: actions/upload-artifact@v3
132+
uses: actions/upload-artifact@v4
132133
with:
133-
name: code-coverage-report
134+
name: code-coverage-report_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
134135
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
135136
- name: Upload Test Performance Report
136-
uses: actions/upload-artifact@v3
137+
uses: actions/upload-artifact@v4
137138
with:
138-
name: tests-performance
139+
name: tests-performance_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
139140
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
140141
- name: Upload coverage reports to Codecov
141-
uses: codecov/codecov-action@v3
142+
uses: codecov/codecov-action@v4
142143
with:
143144
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
144145
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
@@ -163,7 +164,7 @@ jobs:
163164
8.0.x
164165
dotnet-quality: 'ga'
165166
- name: Setup Python
166-
uses: actions/setup-python@v4
167+
uses: actions/setup-python@v5
167168
with:
168169
python-version: '3.x'
169170
- name: Setup dotnet-coverage
@@ -187,17 +188,17 @@ jobs:
187188
snowflake_cloud_env: ${{ matrix.cloud_env }}
188189
net_version: ${{ matrix.dotnet }}
189190
- name: Upload Code Coverage Report
190-
uses: actions/upload-artifact@v3
191+
uses: actions/upload-artifact@v4
191192
with:
192-
name: code-coverage-report
193+
name: code-coverage-report_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
193194
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
194195
- name: Upload Test Performance Report
195-
uses: actions/upload-artifact@v3
196+
uses: actions/upload-artifact@v4
196197
with:
197-
name: tests-performance
198+
name: tests-performance_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
198199
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
199200
- name: Upload coverage reports to Codecov
200-
uses: codecov/codecov-action@v3
201+
uses: codecov/codecov-action@v4
201202
with:
202203
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
203204
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}

.github/workflows/snyk-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: checkout action
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
repository: snowflakedb/whitesource-actions
2222
token: ${{ secrets.WHITESOURCE_ACTION_TOKEN }}

.github/workflows/snyk-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
if: ${{ github.event.pull_request.user.login == 'sfc-gh-snyk-sca-sa' }}
1717
steps:
1818
- name: checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
ref: ${{ github.event.pull_request.head.ref }}
2222
fetch-depth: 0
2323

2424
- name: checkout action
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
with:
2727
repository: snowflakedb/whitesource-actions
2828
token: ${{ secrets.WHITESOURCE_ACTION_TOKEN }}

Snowflake.Data.Tests/IntegrationTests/ConnectionSinglePoolCacheAsyncIT.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ static async Task InvalidConnectionTaskAsync(string connectionString, int times)
205205
{
206206
// intentionally not using await so the connection
207207
// will be disposed with invalid underlying session
208+
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
208209
conn.OpenAsync();
210+
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
209211
};
210212
// wait 100ms each time so the invalid sessions are generated
211213
// roughly at the same speed as connections for query tasks

Snowflake.Data.Tests/IntegrationTests/SFDbAdaptorIT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SFDbAdaptorIT : SFBaseTest
1616
private SnowflakeDbCommand _command;
1717

1818
[SetUp]
19-
public void BeforeTest()
19+
public new void BeforeTest()
2020
{
2121
_adapter = new SnowflakeDbDataAdapter();
2222
_command = new SnowflakeDbCommand();

Snowflake.Data.Tests/IntegrationTests/SFDbFactoryIT.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SFDbFactoryIT : SFBaseTest
1616
DbConnection _connection;
1717

1818
[SetUp]
19-
public void BeforeTest()
19+
public new void BeforeTest()
2020
{
2121
#if NETFRAMEWORK
2222
_factory = DbProviderFactories.GetFactory("Snowflake.Data");
@@ -35,7 +35,7 @@ public void BeforeTest()
3535
}
3636

3737
[TearDown]
38-
public void AfterTest()
38+
public new void AfterTest()
3939
{
4040
_connection.Close();
4141
}

Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
3636
_forceTimeoutForNonLoginRequestsOnly && !message.RequestUri.AbsolutePath.Equals(RestPath.SF_LOGIN_PATH))
3737
{
3838
// Override the http timeout and set to 1ms to force all http request to timeout and retry
39+
// Disable warning as this is the way to be compliant with netstandard2.0
40+
// API reference: https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httprequestmessage?view=netstandard-2.0
41+
#pragma warning disable CS0618 // Type or member is obsolete
3942
message.Properties[BaseRestRequest.HTTP_REQUEST_TIMEOUT_KEY] = TimeSpan.FromTicks(0);
43+
#pragma warning restore CS0618 // Type or member is obsolete
4044
}
4145

4246
return await (base.SendAsync(message, restTimeout, externalCancellationToken).ConfigureAwait(false));

0 commit comments

Comments
 (0)