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

common: implement an explicit preference order in sambacc installation #195

Merged

Conversation

obnoxxx
Copy link
Collaborator

@obnoxxx obnoxxx commented Jan 9, 2025

this explicitly implements a preference order for sambacc
custom installation sources like so:

local repo ->  -> rpm ->  wheel   -> copr.

It makes the output a bit more verbose while at it.
overall, the behavior of the sambacc installation is made a bit more consistent and predictable

@obnoxxx
Copy link
Collaborator Author

obnoxxx commented Jan 9, 2025

@phlogistonjohn : the requests you had on a previous version of this patch in #193 have all been addressed

Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

I think this has (unintentionally) inverted the priority of the various installation sources. Previously, if it found a wheel and then an rpm it would "prefer" the RPM. Now, AFAICT it will find a wheel and stop looking for anything else, implicitly preferring the wheel.

I strongly recommend undoing the restructuring of the if blocks so that every if block still gets visited and the various log lines can be emitted. Then after the sequence of if-blocks you can log the state of action to indicate what the 'preferred' action is going to be.

@obnoxxx obnoxxx force-pushed the sambacc-install-preference-order branch from 5c192bd to a5795e4 Compare January 9, 2025 18:07
@obnoxxx
Copy link
Collaborator Author

obnoxxx commented Jan 9, 2025

@phlogistonjohn wrote:

I think this has (unintentionally) inverted the priority of the various installation sources. Previously, if it found a wheel and then an rpm it would "prefer" the RPM. Now, AFAICT it will find a wheel and stop looking for anything else, implicitly preferring the wheel.

Indeed, this analysis is correct and it was not intentional.

I strongly recommend undoing the restructuring of the if blocks so that every if block still gets visited and the various log lines can be emitted. Then after the sequence of if-blocks you can log the state of action to indicate what the 'preferred' action is going to be.

I have changed it this way now, making the original preference order explicit instead of reverting it.

@obnoxxx obnoxxx force-pushed the sambacc-install-preference-order branch from a5795e4 to 0c030f9 Compare January 9, 2025 18:10
@obnoxxx obnoxxx requested a review from phlogistonjohn January 9, 2025 18:10
@obnoxxx obnoxxx force-pushed the sambacc-install-preference-order branch 2 times, most recently from 0fe7938 to 223712d Compare January 9, 2025 18:30
images/common/install-sambacc-common.sh Outdated Show resolved Hide resolved
images/common/install-sambacc-common.sh Outdated Show resolved Hide resolved
images/common/install-sambacc-common.sh Outdated Show resolved Hide resolved
images/common/install-sambacc-common.sh Outdated Show resolved Hide resolved
@obnoxxx obnoxxx force-pushed the sambacc-install-preference-order branch 2 times, most recently from ab072d6 to 9ae5ef3 Compare January 10, 2025 10:22
@obnoxxx obnoxxx force-pushed the sambacc-install-preference-order branch from 9ae5ef3 to e732a27 Compare January 10, 2025 15:49
 this explicitly implements a preference order for sambacc
    custom installation sources like so:

   local repo -> rpm ->  wheeel -> copr.

 It makes the output a bit more verbose while at it.

Signed-off-by: Michael Adam <[email protected]>
@obnoxxx obnoxxx force-pushed the sambacc-install-preference-order branch from e732a27 to 3a2e16b Compare January 10, 2025 16:00
Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

@mergify mergify bot merged commit bd28817 into samba-in-kubernetes:master Jan 10, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants