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

ci: check for minor chart upgrades #3651

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
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
13 changes: 9 additions & 4 deletions ci/check_dependencies/helm_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
CREATED_IDX = 1

# We ignore Prometheus here, as we're locked to whatever version is CRD-compatible with OpenShift
DEPENDENCIES_TO_IGNORE=("kube-prometheus-stack", "falco")
DEPENDENCIES_TO_IGNORE=("kube-prometheus-stack")
DEPENDENCIES_ONLY_MINOR_UPGRADES=("falco", "metrics-server")

def get_info() -> list[str]:
output_lines = []
Expand Down Expand Up @@ -43,9 +44,13 @@ def get_info() -> list[str]:
pd_entries["created date"] = pd.to_datetime(
pd_entries["created"], format=time_formate_with_zone
)

pd_sorted_entries = pd_entries.sort_values("created date", ascending=False)
latest_release = pd_sorted_entries.loc[0].values
if dep["name"] in DEPENDENCIES_ONLY_MINOR_UPGRADES:
major_version, *_ = current_version.split(".")
compatible_entries = pd_entries[pd_entries["version"].str.startswith(major_version)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have unit tests for the tool :D
I have no idea how pd_entries structure looks like 😓

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can start by adding comments.

else:
compatible_entries = pd_entries
pd_sorted_entries = compatible_entries.sort_values("created date", ascending=False)
latest_release = pd_sorted_entries.iloc[0].values
current_release = (
pd_sorted_entries.loc[pd_sorted_entries["version"] == current_version]
.values.flatten()
Expand Down
Loading