Skip to content

ci: detect the latest Fedora stable version#4285

Open
praiskup wants to merge 1 commit into
fedora-copr:mainfrom
praiskup:praiskup-move-tests-to-f44
Open

ci: detect the latest Fedora stable version#4285
praiskup wants to merge 1 commit into
fedora-copr:mainfrom
praiskup:praiskup-move-tests-to-f44

Conversation

@praiskup
Copy link
Copy Markdown
Member

Packit automatically selects the latest Fedora version (currently F44), and our testsuite needs to automatically move to that version, too.

@praiskup
Copy link
Copy Markdown
Member Author

/packit test

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces hardcoded Fedora versions with dynamic resolution using resolve-fedora-aliases in the test configuration and adds the python3-fedora-distro-aliases package to the client installation tasks. Feedback was provided to include validation for the resolved Fedora version to ensure it is a numeric value before performing arithmetic operations, which prevents potential script failures if the resolution command returns an unexpected result.

Comment on lines +34 to +35
FEDORA_VERSION=$(resolve-fedora-aliases fedora-latest-stable -o version)
PREV_FEDORA_VERSION=$(( FEDORA_VERSION - 1 ))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

To make the script more robust, it's good practice to validate the output of resolve-fedora-aliases. This ensures that FEDORA_VERSION is a number before you perform arithmetic operations on it, preventing potential script failures if the command fails or returns an unexpected value.

Suggested change
FEDORA_VERSION=$(resolve-fedora-aliases fedora-latest-stable -o version)
PREV_FEDORA_VERSION=$(( FEDORA_VERSION - 1 ))
FEDORA_VERSION=$(resolve-fedora-aliases fedora-latest-stable -o version)
if ! [[ "$FEDORA_VERSION" =~ ^[0-9]+$ ]]; then
echo "Error: Failed to resolve Fedora version to a number: '$FEDORA_VERSION'" >&2
exit 1
fi
PREV_FEDORA_VERSION=$(( FEDORA_VERSION - 1 ))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't care; but if a human reviewer prefers, I will do.

@praiskup
Copy link
Copy Markdown
Member Author

Ok, we seem to have some serious trouble with tests on F44. I'm going to prepare a separate PR that would enforce F43 use.

praiskup added a commit that referenced this pull request Apr 28, 2026
This is to work-around problems spotted by #4285 (Fedora 44 tests would
need some fixes).
Packit automatically selects the latest Fedora version (currently F44),
and our testsuite needs to automatically move to that version, too.
@nikromen nikromen force-pushed the praiskup-move-tests-to-f44 branch from 9b17447 to 97068ed Compare April 28, 2026 11:40
@nikromen
Copy link
Copy Markdown
Member

/packit test

@praiskup
Copy link
Copy Markdown
Member Author

Why is Packit, all of a sudden, triggering tests against F43? (This morning it was F44).

@nikromen
Copy link
Copy Markdown
Member

nikromen commented Apr 28, 2026

you did it on purpose, that the f44 tests are broken right now, no? https://github.com/fedora-copr/copr/pull/4286/changes

@nikromen
Copy link
Copy Markdown
Member

and we have everything deployed on f43 at this time, so that is correct change in my eyes

@praiskup
Copy link
Copy Markdown
Member Author

I want to switch the testsuite onto F44, by resolve-fedora-aliases fedora-latest-stable -o version.

I believed this could work, but it was not - hence the temporary workaround is #4286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants