Skip to content

Commit 3fb26cd

Browse files
committed
♻️refactor: rework patches and breaking change handling
Previous implementation relie on a state `old-outscale.yaml` for doing type backporting which result in inconsistant implementation in SDKs and the unability to re-run easeliy the workflow. This now implementation relis on a stateless aproche and a more modulare implementaions of hacks. In a ideal world, patches should be declared in the builder on each SDK and this repositorie whould only be a workflow dispatcher and a toolbox. However, for backward compabilility of present workflow, all patches ,`build.sh` and build artifacts (outscale.yaml, outscale-*.yaml) are still commited to this repositorie for now. A Workflow have also been added to avoid future bracking chages as well
1 parent d70d2bd commit 3fb26cd

File tree

8 files changed

+3804
-2616
lines changed

8 files changed

+3804
-2616
lines changed

.github/workflows/check.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: osc-api-deploy check PR
2+
on:
3+
pull_request:
4+
paths:
5+
- outscale.yaml
6+
- outscale-go.yaml
7+
- outscale-c.yaml
8+
- outscale-java.yaml
9+
10+
jobs:
11+
breaking-change-check:
12+
runs-on: ubuntu-24.04
13+
strategy:
14+
matrix:
15+
spec:
16+
- outscale.yaml
17+
- outscale-go.yaml
18+
- outscale-c.yaml
19+
- outscale-java.yaml
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
sparse-checkout: ${{ matrix.spec }}
24+
path: ./base
25+
ref: ${{ github.base_ref }}
26+
- uses: actions/checkout@v4
27+
with:
28+
sparse-checkout: ${{ matrix.spec }}
29+
path: ./revision
30+
- name: Checking breaking changes on ${{ matrix.spec }}
31+
uses: oasdiff/oasdiff-action/breaking@main
32+
with:
33+
base: ./base/${{ matrix.spec }}
34+
revision: ./revision/${{ matrix.spec }}
35+
fail-on: ERR

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ cleanup() {
1919
}
2020
trap cleanup EXIT
2121

22-
$root/hacks/patch.rb --nooneof --input "${oapi_yaml}" > "$root/outscale.yaml"
23-
$root/hacks/patch.rb --nooneof --nodatetime --input "${oapi_yaml}" > "$root/outscale-go.yaml"
22+
$root/hacks/patch.rb --nooneof --patch "${root}/hacks/outscale.patch.yaml" --input "${oapi_yaml}" > "$root/outscale.yaml"
23+
$root/hacks/patch.rb --nooneof --nodatetime --patch "${root}/hacks/outscale-go.patch.yaml" --input "${oapi_yaml}" > "$root/outscale-go.yaml"
2424
$root/hacks/patch.rb --noproperties-array --input "${oapi_yaml}" > "$root/outscale-c.yaml"

hacks/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ FROM ruby:3.3-slim
22

33
WORKDIR /usr/src/app
44

5-
COPY ./patch.rb .
5+
COPY . .
66

77
CMD [ "./patch.rb" ]

hacks/outscale-go.patch.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
components:
3+
schemas:
4+
FiltersNetPeering:
5+
properties:
6+
ExpirationDates:
7+
items:
8+
format: date-time

hacks/outscale.patch.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
components:
3+
schemas:
4+
AccessKey:
5+
properties:
6+
CreationDate:
7+
format: datetime
8+
ExpirationDate:
9+
format: datetime
10+
LastModificationDate:
11+
format: datetime
12+
AccessKeySecretKey:
13+
properties:
14+
CreationDate:
15+
format: datetime
16+
ExpirationDate:
17+
format: datetime
18+
LastModificationDate:
19+
format: datetime
20+
CreateAccessKeyRequest:
21+
properties:
22+
ExpirationDate:
23+
format: datetime
24+
UpdateAccessKeyRequest:
25+
properties:
26+
ExpirationDate:
27+
format: datetime
28+
ConsumptionEntry:
29+
properties:
30+
FromDate:
31+
format: datetime
32+
ToDate:
33+
format: datetime
34+
ReadConsumptionAccountRequest:
35+
properties:
36+
FromDate:
37+
format: datetime
38+
ToDate:
39+
format: datetime
40+
Snapshot:
41+
properties:
42+
CreationDate:
43+
format: datetime
44+
Vm:
45+
properties:
46+
CreationDate:
47+
format: datetime
48+
VmGroup:
49+
properties:
50+
CreationDate:
51+
format: datetime
52+
Volume:
53+
properties:
54+
CreationDate:
55+
format: datetime
56+
VgwTelemetry:
57+
properties:
58+
LastStateChangeDate:
59+
format: datetime
60+
BsuCreated:
61+
properties:
62+
LinkDate:
63+
format: date
64+
FiltersApiLog:
65+
properties:
66+
QueryDateAfter:
67+
format: date
68+
QueryDateBefore:
69+
format: date
70+
Image:
71+
properties:
72+
CreationDate:
73+
format: date
74+
Log:
75+
properties:
76+
QueryDate:
77+
format: date
78+

0 commit comments

Comments
 (0)