Skip to content

Commit db0a4e1

Browse files
committed
Merge branch '7.2' into tuple-transform-refactoring
# Conflicts: # Orm/Xtensive.Orm.Sqlite/Sql.Drivers.Sqlite/ProviderInitializer.cs # Orm/Xtensive.Orm/Orm/EntitySetBase.cs # Orm/Xtensive.Orm/Orm/Providers/SqlProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/AggregateProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/ApplyProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/BinaryProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/CalculateProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/ContainsTableProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/ExistenceProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/IncludeProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/LockProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/RawProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/SelectProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/StoreProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/TagProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/UnaryProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/VoidProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/ExecutableProvider.cs # Orm/Xtensive.Orm/Orm/Rse/Providers/Provider.cs # Orm/Xtensive.Orm/Orm/Rse/Transformation/ColumnMappingInspector.cs # Orm/Xtensive.Orm/Tuples/Transform/CombineTransform.cs # Orm/Xtensive.Orm/Tuples/Transform/CutInTransform.cs # Orm/Xtensive.Orm/Tuples/Transform/CutOutTransform.cs # Orm/Xtensive.Orm/Tuples/Transform/Internals/MapTransformTuple.cs # Orm/Xtensive.Orm/Tuples/Transform/MapTransform.cs # Orm/Xtensive.Orm/Tuples/Transform/ReadOnlyTransform.cs # Orm/Xtensive.Orm/Tuples/Transform/TupleTransformBase.cs # Orm/Xtensive.Orm/Tuples/Transform/WrappingTransformTupleBase.cs
2 parents 9d9fb2f + ea0f284 commit db0a4e1

955 files changed

Lines changed: 18314 additions & 8913 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
param(
2+
[Parameter(Mandatory)]
3+
[string] $repo,
4+
[Parameter(Mandatory)]
5+
[string] $token,
6+
[Parameter(Mandatory)]
7+
[string] $keepDays
8+
)
9+
10+
$baseUri = "https://api.github.com"
11+
$repoBaseUri = "$baseUri/repos/$repo"
12+
$actionsBaseUri = "$repoBaseUri/actions"
13+
$runsBaseUri = "$actionsBaseUri/runs"
14+
15+
$headers = @{
16+
Authorization = "Bearer $token"
17+
Accept = "application/vnd.github+json"
18+
}
19+
20+
function Get() {
21+
param(
22+
[string] $uri
23+
)
24+
return Invoke-RestMethod -Uri $uri -Headers $headers -Method Get
25+
}
26+
27+
function DeleteRuns() {
28+
param (
29+
[System.Collections.ArrayList] $runIds
30+
)
31+
32+
foreach ($id in $runIds) {
33+
Write-Host "Deleting run $id"
34+
$deleteUri = "$runsBaseUri/$id"
35+
Invoke-RestMethod -Uri $deleteUri -Headers $headers -Method Delete
36+
}
37+
}
38+
39+
#
40+
# Gets all workflow runs, finds among them the ones that meet deletion requirements
41+
# (inactive workflow, closed pull-request or older than required days)
42+
# and sorts them into several buckets - "inactive", "pull_request", "workflow_dispatch", "push"
43+
# and "schedule"
44+
#
45+
function GetWorkflowRunsForDeletion()
46+
{
47+
[OutputType([System.Collections.Generic.Dictionary[System.String, System.Collections.ArrayList]])]
48+
param (
49+
[System.Int32] $storeDays
50+
)
51+
52+
[System.Collections.Generic.HashSet[int]]$inactiveWorkflows = New-Object System.Collections.Generic.HashSet[int]
53+
54+
$allWorkflows = Invoke-RestMethod -Uri "$actionsBaseUri/workflows" -Headers $headers -Method Get
55+
56+
# number of workflows is less then number of runs
57+
# so more efficient to get them all and find inactive ones
58+
foreach ($wf in $allWorkflows.workflows) {
59+
if ($wf.state -ne "active") {
60+
$inactiveWorkflows.Add($wf.id) | Out-Null;
61+
}
62+
}
63+
64+
[System.Collections.Generic.Dictionary[System.String, System.Collections.ArrayList]]$result = New-Object System.Collections.Generic.Dictionary"[System.String, System.Collections.ArrayList]"
65+
66+
#keys of the dictionary equal to events of workflows
67+
$result["pull_request"] = New-Object System.Collections.ArrayList
68+
$result["workflow_dispatch"] = New-Object System.Collections.ArrayList
69+
$result["push"] = New-Object System.Collections.ArrayList
70+
$result["schedule"] = New-Object System.Collections.ArrayList
71+
#special bucket
72+
$result["inactive"] = New-Object System.Collections.ArrayList
73+
74+
75+
$page = 1
76+
$per_page = 100
77+
78+
do {
79+
$uri = "$runsBaseUri" + "?page=$page&per_page=$per_page"
80+
$response = Invoke-RestMethod -Uri $uri -Headers $headers -Method Get
81+
82+
if ($response.total_count -eq 0) {
83+
return $result
84+
}
85+
86+
[System.DateTime]$created = (Get-Date).AddDays(-$storeDays)
87+
88+
foreach ($run in $response.workflow_runs) {
89+
if ($result.ContainsKey($run.event) -eq $true) {
90+
# Doesn't matter how old the run is - if the workflow is inactive
91+
# put it for deletion
92+
if ($inactiveWorkflows.Contains($run.workflow_id)) {
93+
$result["inactive"].Add($run) | Out-Null
94+
}
95+
else {
96+
if ($run.event -eq "pull_request") {
97+
# for PRs we collect only closed ones
98+
if ($run.pull_requests.Count -eq 0) {
99+
$result[$run.event].Add($run) | Out-Null
100+
}
101+
}
102+
else {
103+
# for the rest, we apply date filter
104+
$created_at = [System.DateTime]::Parse($run.created_at)
105+
if ($created_at -lt $created) {
106+
$result[$run.event].Add($run) | Out-Null
107+
}
108+
}
109+
}
110+
}
111+
}
112+
113+
$page++
114+
} while ($response.workflow_runs.Count -eq $per_page)
115+
116+
return $result
117+
}
118+
119+
#
120+
# Deletes runs of inactive workflows (of pull_request, push, workflow_dispatch or schedule event)
121+
#
122+
function DeleteRunsOfInactiveWorkflows() {
123+
param (
124+
[System.Collections.Generic.Dictionary[System.String, System.Collections.ArrayList]] $groups
125+
)
126+
127+
[System.Collections.ArrayList]$runs = $groups["inactive"]
128+
129+
if ($runs.Count -eq 0) {
130+
Write-Host "No runs of inactive workflows. Skipping"
131+
return
132+
}
133+
134+
Write-Host "Deleting runs of inactive workflows"
135+
$run_ids = $runs | Select-Object -ExpandProperty id
136+
DeleteRuns $run_ids
137+
}
138+
139+
#
140+
# Deletes runs of closed pull-requests
141+
#
142+
function DeleteRunsForClosedPR() {
143+
param (
144+
[System.Collections.Generic.Dictionary[System.String, System.Collections.ArrayList]] $groups
145+
)
146+
147+
[System.Collections.ArrayList]$runs = $groups["pull_request"]
148+
149+
if ($runs.Count -eq 0) {
150+
Write-Host "No runs for closed pull requests. Skipping"
151+
return
152+
}
153+
154+
Write-Host "Deleting runs for closed pull requests"
155+
$run_ids = $runs | Select-Object -ExpandProperty id
156+
DeleteRuns $run_ids
157+
}
158+
159+
#
160+
# Deletes runs of 'workflow_dispatch' event marked for deletion
161+
#
162+
function DeleteOldDispatchedRuns() {
163+
param (
164+
[System.Collections.Generic.Dictionary[System.String, System.Collections.ArrayList]] $groups
165+
)
166+
167+
[System.Collections.ArrayList]$runs = $groups["workflow_dispatch"]
168+
169+
if ($runs.Count -eq 0) {
170+
Write-Host "No dispatched runs to delete. Skipping"
171+
return
172+
}
173+
174+
Write-Host "Deleting old runs that were dispatched"
175+
$run_ids = $runs | Select-Object -ExpandProperty id
176+
DeleteRuns $run_ids
177+
}
178+
179+
#
180+
# Deletes runs of 'push' event marked for deletion
181+
#
182+
function DeleteOldRunsOnPush() {
183+
param (
184+
[System.Collections.Generic.Dictionary[System.String, System.Collections.ArrayList]] $groups
185+
)
186+
187+
[System.Collections.ArrayList]$runs = $groups["push"]
188+
189+
if ($runs.Count -eq 0) {
190+
Write-Host "No runs triggered by push to delete. Skipping"
191+
return
192+
}
193+
194+
Write-Host "Deleting old runs triggered by push"
195+
$run_ids = $runs | Select-Object -ExpandProperty id
196+
DeleteRuns $run_ids
197+
}
198+
199+
#
200+
# Deletes runs of 'schedule' event marked for deletion
201+
#
202+
function DeleteOldScheduledRuns() {
203+
param (
204+
[System.Collections.Generic.Dictionary[System.String, System.Collections.ArrayList]] $groups
205+
)
206+
207+
[System.Collections.ArrayList]$runs = $groups["schedule"]
208+
209+
if ($runs.Count -eq 0) {
210+
Write-Host "No scheduled runs to delete. Skipping"
211+
return
212+
}
213+
214+
Write-Host "Deleting old runs triggered on schedule"
215+
$run_ids = $runs | Select-Object -ExpandProperty id
216+
DeleteRuns $run_ids
217+
}
218+
219+
Write-Host "Collecting runs for closed PRs, inactive workflow runs, and other runs older than $keepDays days"
220+
221+
$preserveDays = [System.Int32]::Parse($keepDays)
222+
223+
$runsForDeletion = GetWorkflowRunsForDeletion $preserveDays
224+
225+
if ($runsForDeletion.ToString() -eq "System.Object[]")
226+
{
227+
# just in case somebody screws up method and forgot to apply out-null to some operation
228+
# and results of method became array of objects
229+
$runsForDeletion = $runsForDeletion[$runsForDeletion.Length - 1];
230+
}
231+
232+
DeleteRunsOfInactiveWorkflows $runsForDeletion
233+
234+
DeleteRunsForClosedPR $runsForDeletion
235+
236+
DeleteOldDispatchedRuns $runsForDeletion
237+
238+
DeleteOldRunsOnPush $runsForDeletion
239+
240+
DeleteOldScheduledRuns $runsForDeletion

.github/workflows/auto-databaseless-tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ run-name: Core tests triggered by '${{ github.event_name }}'. Run No ${{ github.
44
on:
55
push:
66
branches:
7-
- '7.1'
8-
- '7.1-*'
7+
- '7.2'
8+
- '7.2-*'
99
paths:
1010
# extensions
1111
- 'Extensions/Xtensive.Orm.Logging.log4net/**'
@@ -32,7 +32,7 @@ on:
3232

3333
pull_request:
3434
branches:
35-
- '7.1'
35+
- '7.2'
3636
paths:
3737
# extensions
3838
- 'Extensions/Xtensive.Orm.Logging.log4net/**'
@@ -59,7 +59,7 @@ on:
5959

6060
pull_request_review:
6161
branches:
62-
- '7.1'
62+
- '7.2'
6363
paths:
6464
# extensions
6565
- 'Extensions/Xtensive.Orm.Logging.log4net/**'
@@ -99,7 +99,7 @@ jobs:
9999
name: Core Tests
100100
strategy:
101101
matrix:
102-
net: [ 'net5.0', 'net6.0' ]
102+
net: [ 'net6.0', 'net7.0', 'net8.0' ]
103103
# For security reasons we allow test runs either for pushes from the team or for pull-requests after their changes were seen and approved by someone
104104
#
105105
# push filter - to cover pushes from the team to main branch of major version
@@ -110,13 +110,13 @@ jobs:
110110
github.event_name == 'push'
111111
|| (github.event_name == 'pull_request_review'
112112
&& github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
113-
&& startsWith(github.event.pull_request.base.ref, '7.1')
113+
&& startsWith(github.event.pull_request.base.ref, '7.2')
114114
&& github.event.review.state == 'approved')
115115
|| (github.event_name == 'pull_request'
116116
&& github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
117-
&& !startsWith(github.head_ref, '7.1-'))
117+
&& !startsWith(github.head_ref, '7.2-'))
118118
119-
uses: DataObjects-NET/dataobjects-net/.github/workflows/reusable-storage-independant-tests.yml@7.1
119+
uses: DataObjects-NET/dataobjects-net/.github/workflows/reusable-storage-independant-tests.yml@7.2
120120
with:
121121
build_config: Release
122122
target_framework: ${{ matrix.net }}

.github/workflows/auto-firebird3-tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ run-name: Tests on Firebird 3 tests triggered by '${{ github.event_name }}'. Run
44
on:
55
push:
66
branches:
7-
- '7.1'
8-
- '7.1-*'
7+
- '7.2'
8+
- '7.2-*'
99
paths:
1010
# containers
1111
- 'Containers/firebird/do-firebird-3_0'
@@ -50,7 +50,7 @@ on:
5050

5151
pull_request:
5252
branches:
53-
- '7.1'
53+
- '7.2'
5454
paths:
5555
# containers
5656
- 'Containers/firebird/do-firebird-3_0'
@@ -95,7 +95,7 @@ on:
9595

9696
pull_request_review:
9797
branches:
98-
- '7.1'
98+
- '7.2'
9999
paths:
100100
# containers
101101
- 'Containers/firebird/do-firebird-3_0'
@@ -153,7 +153,7 @@ jobs:
153153
name: Tests on Firebird 3
154154
strategy:
155155
matrix:
156-
net: [ 'net5.0', 'net6.0' ]
156+
net: [ 'net8.0' ]
157157
# For security reasons we allow test runs either for pushes from the team or for pull-requests after their changes were seen and approved by someone
158158
#
159159
# push filter - to cover pushes from the team to main branch of major version
@@ -164,12 +164,12 @@ jobs:
164164
github.event_name == 'push'
165165
|| (github.event_name == 'pull_request_review'
166166
&& github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
167-
&& startsWith(github.event.pull_request.base.ref, '7.1')
167+
&& startsWith(github.event.pull_request.base.ref, '7.2')
168168
&& github.event.review.state == 'approved')
169169
|| (github.event_name == 'pull_request'
170170
&& github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
171-
&& !startsWith(github.head_ref, '7.1-'))
172-
uses: DataObjects-NET/dataobjects-net/.github/workflows/reusable-storage-dependant-tests.yml@7.1
171+
&& !startsWith(github.head_ref, '7.2-'))
172+
uses: DataObjects-NET/dataobjects-net/.github/workflows/reusable-storage-dependant-tests.yml@7.2
173173
with:
174174
storage: firebird30
175175
build_config: Release

0 commit comments

Comments
 (0)