Skip to content

Commit

Permalink
fix: version comparison was completely broken
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-fs committed Jul 25, 2024
1 parent 1ce2625 commit a9479e6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ def update_remote_sources(distgit_path: Path = distgit_path_arg):
console.print(f"\\[{source['name']}] Nothing to update")
else:
console.print(f"\\[{source['name']}] updating ref to '{commit_sha}'")
original_commit_sha = source["remote_source"]["ref"]
source["remote_source"]["ref"] = commit_sha
_side_effects(source, committish)
_side_effects(source, committish, original_commit_sha)
perform_update = True

if perform_update:
Expand Down Expand Up @@ -171,7 +172,9 @@ def _get_commit_sha(user, repository, committish):
raise typer.Abort()


def _side_effects(source: dict, committish: str | None = None):
def _side_effects(
source: dict, committish: str | None = None, original_commit_sha: str = None
):
"""
Side effects for quipucords-server and qpc.
Expand All @@ -188,13 +191,12 @@ def _side_effects(source: dict, committish: str | None = None):
elif source["name"] == QUIPUCORDS_SERVER:
new_commit = source["remote_source"]["ref"]
_update_dockerfile_quipucords(new_commit, committish)
_update_rust_deps_if_required(source, new_commit)
_update_rust_deps_if_required(source, new_commit, original_commit_sha)


def _update_rust_deps_if_required(source, new_commit):
def _update_rust_deps_if_required(source, new_commit, old_commit):
console.print("Checking if rust :crab: dependencies are updated.")
quipucords_repo = _get_repo_from_source(source)
old_commit = source["remote_source"]["ref"]
old_versions = _get_rust_deps_versions(quipucords_repo, old_commit)
new_versions = _get_rust_deps_versions(quipucords_repo, new_commit)
if old_versions != new_versions:
Expand Down

0 comments on commit a9479e6

Please sign in to comment.