Added --allow-expired flag to list and download expired packages#172
Merged
larsewi merged 1 commit intocfengine:masterfrom Feb 19, 2026
Merged
Added --allow-expired flag to list and download expired packages#172larsewi merged 1 commit intocfengine:masterfrom
larsewi merged 1 commit intocfengine:masterfrom
Conversation
f389c81 to
a3c870c
Compare
larsewi
requested changes
Feb 17, 2026
Contributor
larsewi
left a comment
There was a problem hiding this comment.
GJ 🚀 Only some nit picks
cf_remote/commands.py
Outdated
| remote_download=False, | ||
| trust_keys=None, | ||
| insecure=False | ||
| insecure=False, |
Contributor
There was a problem hiding this comment.
This change seems to be unrelated to this commit. Either remove it or put it in a separate commit.
cf_remote/commands.py
Outdated
| if version and version not in release_versions: | ||
| expired_versions = [rel.version for rel in releases.expired_releases] | ||
|
|
||
| using_expired_version = version and version in expired_versions |
Contributor
There was a problem hiding this comment.
Consider using parenthesis to make intent explicit / more clear to the reader
Suggested change
| using_expired_version = version and version in expired_versions | |
| using_expired_version = version and (version in expired_versions) |
cf_remote/commands.py
Outdated
|
|
||
| using_expired_version = version and version in expired_versions | ||
|
|
||
| if version and version in expired_versions and not allow_expired: |
Contributor
There was a problem hiding this comment.
Here you can use variable from above
Suggested change
| if version and version in expired_versions and not allow_expired: | |
| if using_expired_version and not allow_expired: |
cf_remote/commands.py
Outdated
|
|
||
| if version and version in expired_versions and not allow_expired: | ||
| raise CFRUserError("Use flag --allow-expired to list expired version") | ||
| elif version and version not in release_versions and not using_expired_version: |
Contributor
There was a problem hiding this comment.
Suggested change
| elif version and version not in release_versions and not using_expired_version: | |
| elif version and (version not in release_versions) and not using_expired_version: |
cf_remote/commands.py
Outdated
| print("Using {}:".format(release)) | ||
| if using_expired_version: | ||
| log.warning( | ||
| f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk." |
Contributor
There was a problem hiding this comment.
f-strings are not supported in Python 3.5, which we have to support for a few more years.
Suggested change
| f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk." | |
| "You are using an expired CFEngine version {} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk.".format(version) |
The tests should have failed. I created a follow-up ticket to investigate this CFE-4636
cf_remote/commands.py
Outdated
| print(artifact.url) | ||
| if using_expired_version: | ||
| log.warning( | ||
| f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk." |
Contributor
There was a problem hiding this comment.
Suggested change
| f"You are using an expired CFEngine version {version} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk." | |
| "You are using an expired CFEngine version {} which is no longer supported and may contain known vulnerabilities. Proceed at your own risk.".format(version) |
…ackages Ticket: CFE-4609 Changelog: title Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
a3c870c to
f8162f4
Compare
larsewi
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: CFE-4609
Changelog: title