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(runtime): handle case where current version is EOL #13

Merged
merged 1 commit into from
Jan 20, 2022
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
1 change: 1 addition & 0 deletions deps_report/models/runtime_informations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ class RuntimeInformations:
current_version_is_outdated: bool
current_version_eol_date: date
current_version_is_eol_soon: bool
current_version_is_eol: bool
1 change: 1 addition & 0 deletions deps_report/runtime_version_checkers/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ async def get_runtime_informations(
current_version_eol_date=eol_date,
current_version_is_eol_soon=eol_date
<= (date.today() + timedelta(days=30 * 3)),
current_version_is_eol=eol_date < date.today(),
)
5 changes: 5 additions & 0 deletions deps_report/utils/output/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def print_results_stdout(
f"Your {runtime_informations.name} version reaches EOL date on {runtime_informations.current_version_eol_date}, you should upgrade !",
fg="red",
)
elif runtime_informations.current_version_is_eol:
click.secho(
f"Your {runtime_informations.name} version reached EOL date on {runtime_informations.current_version_eol_date}, you should upgrade !",
fg="red",
)

if len(vulnerabilities_results) > 0:
click.secho(
Expand Down
2 changes: 2 additions & 0 deletions deps_report/utils/output/github_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def send_github_pr_comment_with_results(
msg += f"ℹ️ {runtime_informations.name} version {runtime_informations.current_version} is used by your project but the latest version is {runtime_informations.latest_version}.\n\n"
if runtime_informations.current_version_is_eol_soon:
msg += f"🚨<b>Your {runtime_informations.name} version reaches EOL date on {runtime_informations.current_version_eol_date}, you should upgrade !</b>\n\n"
elif runtime_informations.current_version_is_eol:
msg += f"🚨<b>Your {runtime_informations.name} version **reached** EOL date on {runtime_informations.current_version_eol_date}, you should upgrade !</b>\n\n"

if len(vulnerabilities_results) > 0:
msg += "## Vulnerable dependencies\n"
Expand Down