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

feat: add 'deprecated' field for depreacted section generation in image docs #286

Merged
merged 27 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
48fee2f
Do not build/release/test/scan tracks with expired end-of-life values…
linostar Sep 30, 2024
c39b5de
fix import
linostar Nov 13, 2024
30a259d
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 13, 2024
f75a0f0
cherry-pick changes to generate_oci_doc_yaml
linostar Nov 14, 2024
b4423a5
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 14, 2024
4d1fae1
fix a typo in comparison
linostar Nov 14, 2024
5229a71
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 14, 2024
f6df920
fix overwriting eol when it is already set
linostar Nov 14, 2024
a101cb5
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 14, 2024
cc3c163
update EOLs from upload dict in image.yaml
linostar Nov 15, 2024
29c4dd3
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 15, 2024
1ae8a44
merge and solve conflicts
linostar Nov 15, 2024
bc3e9f0
Merge branch 'main' into ROCKS-1224/feat/support-deprecated-channels
linostar Nov 15, 2024
1594b0a
fix after merge
linostar Nov 15, 2024
502ebd5
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 15, 2024
ce1a986
fix for untracked releases
linostar Nov 15, 2024
d3d856f
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 15, 2024
16f3fae
mock-rock: remove 1.0.0 tag and change 1.0 EOL to an expired one
linostar Nov 15, 2024
a88f5d7
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 15, 2024
7f2cbb4
fix dict key name
linostar Nov 15, 2024
97b999c
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 15, 2024
516757d
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 15, 2024
dfe6a51
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 19, 2024
13c82e9
Merge branch 'main' into ROCKS-1224/feat/support-deprecated-channels
zhijie-yang Nov 19, 2024
46a1691
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 19, 2024
ba19129
Apply Clay's suggestion
linostar Nov 20, 2024
62c44dc
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Nov 20, 2024
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
19 changes: 10 additions & 9 deletions oci/mock-rock/_releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"edge": {
"target": "775"
},
"end-of-life": "2030-05-01T00:00:00Z"
"end-of-life": "2024-05-01T00:00:00Z"
},
"test": {
"beta": {
Expand All @@ -35,34 +35,35 @@
"1.1-22.04": {
"end-of-life": "2030-05-01T00:00:00Z",
"candidate": {
"target": "776"
"target": "788"
},
"beta": {
"target": "776"
"target": "788"
},
"edge": {
"target": "776"
"target": "788"
}
},
"1-22.04": {
"end-of-life": "2030-05-01T00:00:00Z",
"candidate": {
"target": "776"
"target": "788"
},
"beta": {
"target": "776"
"target": "788"
},
"edge": {
"target": "776"
"target": "788"
}
},
"1.2-22.04": {
"end-of-life": "2030-05-01T00:00:00Z",
"beta": {
"target": "777"
"target": "789"
},
"edge": {
"target": "1.2-22.04_beta"
}
}
},
"1.0.0-22.04": {}
}
8 changes: 1 addition & 7 deletions oci/mock-rock/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ upload:
commit: 17916dd5de270e61a6a3fd3f4661a6413a50fd6f
directory: mock_rock/1.0
release:
1.0.0-22.04:
end-of-life: "2024-05-01T00:00:00Z"
risks:
- candidate
- edge
- beta
1.0-22.04:
end-of-life: "2030-05-01T00:00:00Z"
end-of-life: "2024-05-01T00:00:00Z"
risks:
- candidate
- edge
Expand Down
6 changes: 6 additions & 0 deletions src/docs/generate_oci_doc_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
import tempfile
from typing import Any, Dict, List
from datetime import datetime, timezone
from dateutil import parser

import boto3
Expand Down Expand Up @@ -268,6 +269,11 @@ def build_releases_data(
eol = parser.parse(all_tracks[track_base])
release_data["support"] = {"until": eol.strftime("%m/%Y")}

if eol < datetime.now(timezone.utc):
release_data["deprecated"] = {
"date": eol.strftime("%m/%Y")
}

releases.append(release_data)

return releases
Expand Down
10 changes: 10 additions & 0 deletions src/image/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@
print(f"Channel {tag} points to {value}")
tag_mapping_from_trigger[tag] = value

# update EOL dates from upload dictionary
for upload in image_trigger["upload"] or []:
for track, upload_release_dict in (upload["release"] or {}).items():
if track not in all_releases:
print(f"Track {track} will be created for the 1st time")
all_releases[track] = {}

if isinstance(upload_release_dict, dict) and "end-of-life" in upload_release_dict:
all_releases[track]["end-of-life"] = upload_release_dict["end-of-life"]

print(
"Going to update channels according to the following:\n"
f"{json.dumps(tag_mapping_from_trigger, indent=2)}"
Expand Down