Skip to content

Commit

Permalink
Merge pull request #13 from MeilleursAgents/feat/runtime_eol
Browse files Browse the repository at this point in the history
feat(runtime): handle case where current version is EOL
  • Loading branch information
Corentin Garcia committed Jan 20, 2022
2 parents 97d0519 + 5089890 commit 6300a6c
Show file tree
Hide file tree
Showing 6 changed files with 488 additions and 422 deletions.
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

0 comments on commit 6300a6c

Please sign in to comment.