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

Tiny improvement security #57171

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions docker/server/.dockerignore

This file was deleted.

15 changes: 5 additions & 10 deletions utils/security-generator/generate_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ def generate_supported_versions() -> str:
with open(VERSIONS_FILE, "r", encoding="utf-8") as fd:
versions = [line.split(maxsplit=1)[0][1:] for line in fd.readlines()]

# The versions in VERSIONS_FILE are ordered ascending, so the first one is
# the greatest one. We may have supported versions in the previous year
greatest_year = int(versions[0].split(".", maxsplit=1)[0])
unsupported_year = greatest_year - 2
supported_year = 0 # set automatically when all supported versions are filled
# 3 regular versions
regular = [] # type: List[str]
max_regular = 3
Expand All @@ -82,14 +79,12 @@ def generate_supported_versions() -> str:
lts.append(version)
to_append = f"| {version} | ✔️ |"
if to_append:
if len(regular) == max_regular and len(lts) == max_lts:
# if we reached the max number of supported versions, the rest
# are unsopported, so year.* will be used
unsupported_year = min(greatest_year - 1, year)
if len(regular) == max_regular or len(lts) == max_lts:
supported_year = year
table.append(to_append)
continue
if year <= unsupported_year:
# The whole year is unsopported
if year < supported_year:
# The whole year is unsupported
version = f"{year}.*"
if not version in unsupported:
unsupported.append(version)
Expand Down