Skip to content

Conversation

david22swan
Copy link
Member

@david22swan david22swan commented Jul 31, 2025

Adds a command-line option to specify whether the latest agent build should be included in the matrix. This is due to the Mac and Windows puppet_agent install tasks requiring a specific version when installing.
This updates the passed back information to the below format:

matrix={
  {"matrix":{"platforms":[
    {"label":"CentOS-7","provider":"docker","arch":"x86_64","image":"litmusimage/centos:7","runner":"ubuntu-22.04"},
    {"label":"CentOS-8","provider":"docker","arch":"x86_64","image":"litmusimage/centos:stream8","runner":"ubuntu-latest"},
    {"label":"OracleLinux-7","provider":"docker","arch":"x86_64","image":"litmusimage/oraclelinux:7","runner":"ubuntu-22.04"},
    {"label":"Scientific-7","provider":"docker","arch":"x86_64","image":"litmusimage/scientificlinux:7","runner":"ubuntu-22.04"},
    {"label":"Debian-10","provider":"docker","arch":"x86_64","image":"litmusimage/debian:10","runner":"ubuntu-22.04"},
    {"label":"Debian-11","provider":"docker","arch":"x86_64","image":"litmusimage/debian:11","runner":"ubuntu-latest"},
    {"label":"Debian-12","provider":"docker","arch":"x86_64","image":"litmusimage/debian:12","runner":"ubuntu-latest"},
    {"label":"Ubuntu-18.04","provider":"docker","arch":"x86_64","image":"litmusimage/ubuntu:18.04","runner":"ubuntu-22.04"},
    {"label":"Ubuntu-20.04","provider":"docker","arch":"x86_64","image":"litmusimage/ubuntu:20.04","runner":"ubuntu-latest"},
    {"label":"Ubuntu-22.04","provider":"docker","arch":"x86_64","image":"litmusimage/ubuntu:22.04","runner":"ubuntu-latest"},
    {"label":"Ubuntu-24.04","provider":"docker","arch":"x86_64","image":"litmusimage/ubuntu:24.04","runner":"ubuntu-latest"},
    {"label":"Rocky-8","provider":"docker","arch":"x86_64","image":"litmusimage/rockylinux:8","runner":"ubuntu-latest"},
    {"label":"AlmaLinux-8","provider":"docker","arch":"x86_64","image":"litmusimage/almalinux:8","runner":"ubuntu-latest"}
  ],
  "collection":[
    {"collection":"puppetcore8","version":"8.14.0"}
  ]
},
"spec_matrix":{
  "include":[
    {
      "puppet_version":"~> 8.0",
      "ruby_version":3.2
    }
  ]}
}

If the latest version is not requested it will instead return in the same manor as previously, ie.

  "collection":[
    "puppetcore8",
  ]

With the expectation that the user will resolve any conflicts from this on their end. This is to ensure backwards compatibility and not interfere with the work of other teams or with the specific code changes made for the pe team.

Checklist

  • 🟢 Spec tests.
  • Manually verified.

@david22swan
Copy link
Member Author

Small issue in that I'm not sure how this will work with the pe images....
Will likely need input from the pe team

@david22swan david22swan force-pushed the CAT-2344 branch 5 times, most recently from 8f3d896 to d2a1acd Compare July 31, 2025 17:20
@david22swan david22swan requested a review from coreymbe August 5, 2025 08:59
Adds a command-line option to specify whether the latest agent build should be included in the matrix.
This is due to the Mac and Windows puppet_agent install tasks requiring a specific version when installing.
Updates matrix creation logic to only include the version if requested.
Introduces a check to ensure the `latest-agent` and `pe-include`
options are not used simultaneously.
Copy link

@joshcooper joshcooper left a comment

Choose a reason for hiding this comment

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

LGTM. Were you able to run a supported module against this PR to confirm it can retrieve and install agent 8.14.0 on windows or mac?

Also to confirm, this only has a behavior change when passing the newly added argument, right? If so, then I think we can remove the backwards compatible label.

@david22swan
Copy link
Member Author

david22swan commented Aug 6, 2025

LGTM. Were you able to run a supported module against this PR to confirm it can retrieve and install agent 8.14.0 on windows or mac?

Also to confirm, this only has a behavior change when passing the newly added argument, right? If so, then I think we can remove the backwards compatible label.

Passing 8.14.0 installs it correctly yeh, just fiddling with the action runner to make it pass neatly.
And yeh., the backwards-compatible was for the first version, just forgot to remove.
Updated the code to no longer always pass back a nested collection/version, only do it when asked.
Removes the complication and the interference with --pe-include outright made them mutually exclusive for now.

@david22swan
Copy link
Member Author

@coreymbe Have removed the interaction between --latest-agent and --pe-include that I was worried about.
But you may need to update the --pe-include to pass back the latest version if you run into the same issue with installing on windows 10/mac, a specific version is needed.

@david22swan
Copy link
Member Author

Just pushed a quick README update

@david22swan david22swan marked this pull request as ready for review August 6, 2025 15:28
@david22swan david22swan requested a review from a team as a code owner August 6, 2025 15:28
@pmcmaw pmcmaw merged commit a1a5a79 into main Aug 6, 2025
2 checks passed
@pmcmaw pmcmaw deleted the CAT-2344 branch August 6, 2025 15:40
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.

3 participants