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 support for OpenVox beaker jobs #165

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bastelfreak
Copy link
Member

No description provided.

@bastelfreak bastelfreak self-assigned this Jan 24, 2025
@bastelfreak
Copy link
Member Author

I know that this isn't ready yet. The focus is on creating beaker jobs for puppet and openvox packages. unit tests will continue with the puppet gem.

@bastelfreak bastelfreak force-pushed the openvox2 branch 2 times, most recently from f0bf384 to 151acff Compare January 24, 2025 21:00
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I'm not sure this is what I'd do. In the the what I'd like is a single variable (both for unit and acceptance, so really 2 vars) that generates the entire matrix. That can be both puppet and openvox. We exposed 1 variable that gha uses now. Compatible solution is to just expand that result, even if the name includes puppet. Incompatible is to have genetic names like puppet_metadata_unit_matrix or similar. Prefix it with the gem name and a suffix for the purpose.

Looking further ahead we probably also want to do similar things with unit tests to test with agent gems

@bastelfreak
Copy link
Member Author

want to do similar things with unit tests to test with agent gems

Yes. But since we don't have the gem published at the moment, it didn't have a high priority for me.

Compatible solution is to just expand that result, even if the name includes puppet

That's my idea. I want to expand it, if openvox is listed in the requirements. In that way it isn't a breaking change. And if individual modules don't want to/cannot support Perforce packages anymore, we drop the puppet key from the requirements. And if there's a situation where we don't want to use the Perforce packages in any module, we could just reduce the result again.

@ekohl
Copy link
Member

ekohl commented Jan 24, 2025

Right, so let's start 2 variable that are generic: puppet_metadata_unix_matrix and puppet_metadata_acceptance_matrix. Those generate a GHA compatible matrix based on metadata. How we exactly define is is an implementation detail. Then in gha-puppet we start using the new matrices.

On the implementation details, for acceptance I'd say it osrequirementversions. So centos 9 * {puppet,openvox} * 8 for example. It may be more complex, but that's up to this gem to decide. Similar for unit tests

lib/puppet_metadata/github_actions.rb Outdated Show resolved Hide resolved
@@ -49,15 +62,19 @@ def puppet_unit_test_matrix
end.compact
end

def beaker_os_releases(at = nil)
majors = puppet_major_versions
def beaker_os_releases(at = nil, collection)
Copy link
Member

Choose a reason for hiding this comment

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

The name collection isn't something I entirely agree with. Previously we have Puppet PC1 as a collection, later puppet5, puppet6, etc. So IMHO collection isn't quite accurate.

Question is, what is accurate. In metadata.json it's listed under requirements so I'd play with something like for_requirement because I don't know a good word for the thing that satisfies the requirement.

Copy link
Member

Choose a reason for hiding this comment

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

Thinking more about it now: requirement_name could work as well

Comment on lines 156 to 158
# Current latest major is 7. It is highly recommended that modules
# actually specify exact bounds, but this prevents an infinite loop.
end_major = (requirement.end == SemanticPuppet::Version::MAX) ? 7 : requirement.end.major
Copy link
Member

Choose a reason for hiding this comment

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

This looks out of date, which is a problem with hardcoding magic numbers ...

@@ -17,7 +17,7 @@ def initialize(metadata, options)
def outputs(at = nil)
{
puppet_unit_test_matrix: puppet_unit_test_matrix,
puppet_beaker_test_matrix: puppet_beaker_test_matrix(at),
puppet_beaker_test_matrix: puppet_beaker_test_matrix(at) + openvox_beaker_test_matrix(at),
Copy link
Member

Choose a reason for hiding this comment

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

I like keeping a single method. puppet_beaker_test_matrix is also the output key, so let's change the methods so they return the correct result.

Suggested change
puppet_beaker_test_matrix: puppet_beaker_test_matrix(at) + openvox_beaker_test_matrix(at),
puppet_beaker_test_matrix: puppet_beaker_test_matrix(at),

You can argue it would be better to use ${gem}_${target}_$test_matrix to decouple from Puppet specifically. Then it'd be puppet_metadata_unit_test_matrix instead.

Comment on lines +108 to +112
beaker_test_matrix(at, 'puppet')
end

def openvox_beaker_test_matrix(at)
beaker_test_matrix(at, 'openvox')
Copy link
Member

Choose a reason for hiding this comment

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

And following up on the above discussion:

Suggested change
beaker_test_matrix(at, 'puppet')
end
def openvox_beaker_test_matrix(at)
beaker_test_matrix(at, 'openvox')
beaker_test_matrix(at, 'puppet') + beaker_test_matrix(at, 'openvox')

You can even keep them alphabetically:

Suggested change
beaker_test_matrix(at, 'puppet')
end
def openvox_beaker_test_matrix(at)
beaker_test_matrix(at, 'openvox')
beaker_test_matrix(at, 'openvox') + beaker_test_matrix(at, 'puppet')

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.

2 participants