Skip to content

pass --flavor satellite when deploying using foremanctl - #22356

Open
evgeni wants to merge 4 commits into
SatelliteQE:masterfrom
evgeni:satellite-flavor
Open

pass --flavor satellite when deploying using foremanctl#22356
evgeni wants to merge 4 commits into
SatelliteQE:masterfrom
evgeni:satellite-flavor

Conversation

@evgeni

@evgeni evgeni commented Aug 5, 2026

Copy link
Copy Markdown
Member

Problem Statement

Solution

Related Issues

Summary by Sourcery

New Features:

  • Add support for specifying the Satellite flavor in foremanctl-based installations.

@evgeni
evgeni requested a review from a team as a code owner August 5, 2026 13:16
@evgeni evgeni added the No-CherryPick PR doesnt need CherryPick to previous branches label Aug 5, 2026
@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Ensure Satellite installation via foremanctl always passes the --flavor satellite option so deployments use the correct flavor by default.

Sequence diagram for Satellite installation via foremanctl with flavor option

sequenceDiagram
    actor Tester
    participant robottelo_hosts as install_satellite_foremanctl
    participant foremanctl

    Tester->>robottelo_hosts: install_satellite_foremanctl
    robottelo_hosts->>robottelo_hosts: build default_parameters
    robottelo_hosts->>robottelo_hosts: add --flavor satellite
    robottelo_hosts->>foremanctl: execute foremanctl with default_parameters
    foremanctl-->>Tester: return installation result
Loading

File-Level Changes

Change Details Files
Include the Satellite flavor flag in default foremanctl install parameters so deployments consistently target the Satellite flavor.
  • Add --flavor satellite to the list of default parameters passed to foremanctl in install_satellite_foremanctl
  • Keep existing admin username and password parameters unchanged while prepending the flavor flag
robottelo/hosts.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new '--flavor satellite' entry bundles flag and value into a single string, which may not match how default_parameters is consumed elsewhere (e.g., as separate args); consider splitting into '--flavor' and 'satellite' to align with typical argument handling.
  • If different flavors might be needed in the future, consider making the flavor value configurable (e.g., via settings or a function parameter) instead of hardcoding 'satellite' here.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `'--flavor satellite'` entry bundles flag and value into a single string, which may not match how `default_parameters` is consumed elsewhere (e.g., as separate args); consider splitting into `'--flavor'` and `'satellite'` to align with typical argument handling.
- If different flavors might be needed in the future, consider making the flavor value configurable (e.g., via `settings` or a function parameter) instead of hardcoding `'satellite'` here.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@evgeni

evgeni commented Aug 5, 2026

Copy link
Copy Markdown
Member Author
  • The new '--flavor satellite' entry bundles flag and value into a single string, which may not match how default_parameters is consumed elsewhere (e.g., as separate args); consider splitting into '--flavor' and 'satellite' to align with typical argument handling.

Before this PR, the default_parameters were as follows:

        default_parameters = [
            f'--initial-admin-username {settings.server.admin_username}',
            f'--initial-admin-password {settings.server.admin_password}',
        ]

I'll leave it as an exercise to the reader to define "typical".

@evgeni

evgeni commented Aug 5, 2026

Copy link
Copy Markdown
Member Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py
deployment_type: container
theforeman:
  foremanctl: 726

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16346
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py --external-logging
Test Result : ================= 34 warnings, 21 errors in 3353.25s (0:55:53) =================

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Aug 5, 2026
@evgeni

evgeni commented Aug 5, 2026

Copy link
Copy Markdown
Member Author
foremanctl deploy: error: argument --flavor: invalid choice: 'satellite' (choose from katello)

seems its not picking up the packit build, why?

@shubhamsg199

shubhamsg199 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
foremanctl deploy: error: argument --flavor: invalid choice: 'satellite' (choose from katello)

seems its not picking up the packit build, why?

This is because of https://gitlab.cee.redhat.com/satelliteqe/satlab-tower/-/merge_requests/1554 .
upstream-pr-install cannot find the host in the inventory and the workflow passes as ansible doesn't error out.
I was testing this to fix it here and is working.
Can you add the small change from the PR and run the PRT again?

@evgeni
evgeni requested a review from a team as a code owner August 5, 2026 15:45
@evgeni

evgeni commented Aug 5, 2026

Copy link
Copy Markdown
Member Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py
deployment_type: container
theforeman:
  foremanctl: 726

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16351
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py --external-logging
Test Result : ======= 1 failed, 19 passed, 98 warnings, 1 error in 9559.35s (2:39:19) ========

@evgeni
evgeni force-pushed the satellite-flavor branch 2 times, most recently from 39c292d to 30ff674 Compare August 6, 2026 11:28
@evgeni

evgeni commented Aug 6, 2026

Copy link
Copy Markdown
Member Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py
deployment_type: container
theforeman:
  foremanctl: 726

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16354
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py --external-logging
Test Result : ============ 20 passed, 97 warnings, 2 errors in 9957.23s (2:45:57) ============

@evgeni
evgeni force-pushed the satellite-flavor branch from 30ff674 to 4381a4b Compare August 6, 2026 15:09
@evgeni

evgeni commented Aug 6, 2026

Copy link
Copy Markdown
Member Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py
deployment_type: container
theforeman:
  foremanctl: 726

@evgeni

evgeni commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

The remaining error is ERROR at teardown of test_positive_foremanctl_auth_bundle[rhel9-ipv4-default] which seems unrelated to this change here

@evgeni

evgeni commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

The remaining error is ERROR at teardown of test_positive_foremanctl_auth_bundle[rhel9-ipv4-default] which seems unrelated to this change here

But it's failing to tear down a content host, and we don't need a content host here.

#22370

@evgeni
evgeni force-pushed the satellite-flavor branch from 4381a4b to 4c7e822 Compare August 7, 2026 11:23
@evgeni

evgeni commented Aug 7, 2026

Copy link
Copy Markdown
Member Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py
deployment_type: container
theforeman:
  foremanctl: 726

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16364
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py --external-logging
Test Result : ================ 21 passed, 96 warnings in 11509.67s (3:11:49) =================

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Aug 7, 2026
@arvind4501

arvind4501 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Which SQL injection sourcery is complaining about https://github.com/SatelliteQE/robottelo/pull/22356/checks?check_run_id=92851528305 , i don't see any possibilities as such :strange

@sourcery-ai

Comment thread robottelo/hosts.py
Comment on lines +2240 to +2247
overrides_dir = '/usr/share/foremanctl/src/playbooks/_vendor_overrides/'
self.execute(f'mkdir -p {overrides_dir}/deploy/')
self.put(
'variables:\n flavor:\n choices:\n - satellite',
f'{overrides_dir}/deploy/metadata.obsah.yaml',
temp_file=True,
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be handled in packaging instead of tests?

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.

At some point it will. And then I'll remove it here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should create jira for it to track then use is_open('SAT-xxx') logic here for that so we don't need to handle that removal immediately

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

Labels

No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants