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

Add VERSIONS-SKIP to handle projects stuck on bad latest versions #4355

Merged
merged 1 commit into from
Jan 27, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions tasks/Makefile.package
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ export AUTO_UPDATE_ENABLED ?= true
VERSION_ENV = $(PACKAGE_NAME)_VERSION
RELEASE_ENV = $(PACKAGE_NAME)_RELEASE
ifneq ($(strip $($(VERSION_ENV))),)
PACKAGE_VERSION=$(strip $($(VERSION_ENV)))
export PACKAGE_VERSION=$(strip $($(VERSION_ENV)))
# $() is hack to include leading space in variable assignment
PACKAGE_VERSION_OVERRIDE = $() (overridden by $(VERSION_ENV) environment variable)
ifneq ($(strip $($(RELEASE_ENV))),)
PACKAGE_RELEASE=$(strip $($(RELEASE_ENV)))
export PACKAGE_RELEASE=$(strip $($(RELEASE_ENV)))
PACKAGE_RELEASE_OVERRIDE = $() (overridden by $(RELEASE_ENV) environment variable)
else # If the package version is overridden, but the release is not, then set the release to 0
PACKAGE_RELEASE=0
export PACKAGE_RELEASE=0
PACKAGE_RELEASE_OVERRIDE = $() (because version overridden by $(VERSION_ENV) environment variable)
endif
endif
Expand Down Expand Up @@ -212,7 +212,9 @@ _version_by_semver: $(LOCAL_BIN)/vert
echo "ERROR: failed to obtain version matching '$${version_pin}' for $(VENDOR)/$(PACKAGE_REPO_NAME) (got: $${releases[@]:0:10}...)" >&2; \
exit 1; \
elif [ "$${local_version}" != "$${current_version}" ]; then \
if ! env PATH='$(PATH)' vert ">$${local_version}$(DEFAULT_PIN_SUFFIX)" "$${current_version}" >/dev/null; then \
if [ -f VERSIONS-SKIP ] && grep -qFx "$${current_version}" VERSIONS-SKIP; then \
echo "NOT UPGRADING $(PACKAGE_NAME) from $${local_version} to $${current_version} because $${current_version} is disallowed by VERSIONS-SKIP" >&2; \
elif ! env PATH='$(PATH)' vert ">$${local_version}$(DEFAULT_PIN_SUFFIX)" "$${current_version}" >/dev/null; then \
echo "NOT \"Upgrading\" $(PACKAGE_NAME) from $${local_version} to OLDER $${current_version}" >&2; \
exit 1; \
else \
Expand All @@ -238,8 +240,12 @@ GITHUB_LATEST_RELEASE:
echo "ERROR: failed to obtain version matching '$${version_pin}' for $(VENDOR)/$(PACKAGE_REPO_NAME) (got: $${releases[@]:0:10}...)" >&2; \
exit 1; \
elif [ "$${local_version}" != "$${current_version}" ]; then \
echo "Upgrading $(PACKAGE_NAME) from $${local_version} to $${current_version}"; \
echo "$${current_version}" > VERSION; \
if [ -f VERSIONS-SKIP ] && grep -qFx "$${current_version}" VERSIONS-SKIP; then \
echo "NOT UPGRADING $(PACKAGE_NAME) from $${local_version} to $${current_version} because $${current_version} is disallowed by VERSIONS-SKIP" >&2; \
else \
echo "Upgrading $(PACKAGE_NAME) from $${local_version} to $${current_version}"; \
echo "$${current_version}" > VERSION; \
fi; \
fi; \
else \
echo "NOT \"Upgrading\" $(PACKAGE_NAME) from $${local_version} to $${current_version} because auto-update is disabled" >&2; \
Expand Down
8 changes: 8 additions & 0 deletions vendor/rakkess/VERSIONS-SKIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file, VERSIONS-SKIP, is optional and rarely needed.
# It contains a list of versions to skip when updating
# the current version (auto-update), usually because there is
# something wrong with the release. Each version must be on a
# separate line with no leading or trailing spaces.
# Blank lines are ignored.

0.5.1
8 changes: 8 additions & 0 deletions vendor/terraform-module-versions/VERSIONS-SKIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file, VERSIONS-SKIP, is optional and rarely needed.
# It contains a list of versions to skip when updating
# the current version (auto-update), usually because there is
# something wrong with the release. Each version must be on a
# separate line with no leading or trailing spaces.
# Blank lines are ignored.

3.1.14
Loading