Skip to content

Move certificate bundle to auth bundle - #22277

Open
arvind4501 wants to merge 1 commit into
SatelliteQE:masterfrom
arvind4501:auth-bundle
Open

Move certificate bundle to auth bundle#22277
arvind4501 wants to merge 1 commit into
SatelliteQE:masterfrom
arvind4501:auth-bundle

Conversation

@arvind4501

@arvind4501 arvind4501 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Problem Statement

theforeman/foremanctl#698 changes the old certificate bundle command and adds oauth/ credentials into the bundle

Solution

Change according to theforeman/foremanctl#698

Related Issues

Summary by Sourcery

Tests:

  • Adapt capsule bundle integration test from certificate-bundle to auth-bundle, including generation and renewal flows and expectations for OAuth credentials in the bundle contents.

@arvind4501
arvind4501 requested a review from a team as a code owner July 27, 2026 09:56
@sourcery-ai

sourcery-ai Bot commented Jul 27, 2026

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

Reviewer's Guide

Update the foremanctl capsule bundle test to target the new auth-bundle command instead of certificate-bundle and validate that OAuth credentials are included in the bundle tarball in addition to existing certificate checks.

File-Level Changes

Change Details Files
Switch capsule bundle test flow from certificate-bundle to auth-bundle and adjust assertions and messaging accordingly.
  • Rename the main capsule bundle test from test_positive_foremanctl_certificate_bundle to test_positive_foremanctl_auth_bundle and update its docstring, steps, and expected results to reference auth bundles instead of certificate bundles.
  • Change foremanctl invocations from foremanctl certificate-bundle ... to foremanctl auth-bundle ... for both initial bundle generation and renewal, including updating failure messages.
  • Update assertion messages and comments to consistently refer to auth bundles rather than certificate bundles.
tests/foreman/foremanctl/test_install_foremanctl.py
Extend capsule bundle content validation to cover OAuth credentials in addition to existing certificate files.
  • Update the helper foremanctl_capsule_cert_paths docstring to describe auth bundles instead of certificate bundles.
  • Change the tarball existence assertion message to reference an auth bundle tarball rather than a certificate bundle tarball.
  • Add assertions that the tarball content listing includes oauth/foreman-oauth-consumer-key and oauth/foreman-oauth-consumer-secret while retaining existing certificate file assertions.
tests/foreman/foremanctl/test_install_foremanctl.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:

  • Now that foremanctl_capsule_cert_paths also validates oauth files, consider renaming the helper (and/or its docstring/return values) to better reflect that it deals with the full auth bundle rather than only certificate paths, so future readers don’t assume it’s certificate-only.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that `foremanctl_capsule_cert_paths` also validates oauth files, consider renaming the helper (and/or its docstring/return values) to better reflect that it deals with the full auth bundle rather than only certificate paths, so future readers don’t assume it’s certificate-only.

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.

@arvind4501 arvind4501 added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Jul 27, 2026
@arvind4501
arvind4501 marked this pull request as draft July 27, 2026 09:57
@arvind4501

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
deployment_type: container
theforeman:
  foremanctl: 698

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16256
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle --external-logging
Test Result : ========== 20 deselected, 24 warnings, 1 error in 5154.33s (1:25:54) ===========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Jul 27, 2026
@arvind4501

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
deployment_type: container
theforeman:
  foremanctl: 698

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16258
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle --external-logging
Test Result : ========== 1 failed, 20 deselected, 15 warnings in 3110.34s (0:51:50) ==========

@arvind4501

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
deployment_type: container
theforeman:
  foremanctl: 698

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16262
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle --external-logging
Test Result : ========== 1 failed, 20 deselected, 11 warnings in 2354.38s (0:39:14) ==========

@Gauravtalreja1

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

@arvind4501
arvind4501 marked this pull request as ready for review July 28, 2026 08:08
@arvind4501
arvind4501 marked this pull request as draft July 28, 2026 08:08

@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:

  • Consider renaming foremanctl_capsule_cert_paths (and related variables like capsule_certs) to something like *_auth_bundle_paths to better reflect that the helper now validates OAuth files in addition to certificates.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider renaming `foremanctl_capsule_cert_paths` (and related variables like `capsule_certs`) to something like `*_auth_bundle_paths` to better reflect that the helper now validates OAuth files in addition to certificates.

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.

@arvind4501
arvind4501 marked this pull request as ready for review July 28, 2026 08:14
@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16267
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle --external-logging
Test Result : ========== 1 failed, 20 deselected, 11 warnings in 2304.02s (0:38:24) ==========

@shubhamsg199

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
theforeman:
  foremanctl: 698

@shubhamsg199

Copy link
Copy Markdown
Contributor

@arvind4501 Can you remove pytest.mark.foremanctl from the module level and rerun the PRT without deployment_type: container. In the current installer module framework we are manually installing the foremanctl on a RHEL box so it conflicts right now

@arvind4501

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
theforeman:
  foremanctl: 698

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16271
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle --external-logging
Test Result : ========== 1 failed, 20 deselected, 11 warnings in 2362.42s (0:39:22) ==========

@arvind4501

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
deployment_type: container
theforeman:
    foremanctl: 698

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16284
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle --external-logging
Test Result : ========== 20 deselected, 12 warnings, 1 error in 4570.57s (1:16:10) ===========

@pytest.mark.rhel_ver_match('9')
def test_positive_foremanctl_certificate_bundle(module_sat_ready_rhel, rhel_contenthost):
"""Verify foremanctl certificate-bundle generation and renewal for a capsule.
def test_positive_foremanctl_auth_bundle(module_sat_ready_rhel, rhel_contenthost):

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.

I would recommend using module_target_sat instead of module_sat_ready_rhel. There might be a conflict caused by using module_sat_ready_rhel, as it is created only when we don't have the setup available.

@arvind4501
arvind4501 requested a review from a team as a code owner July 30, 2026 10:22
@arvind4501

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
deployment_type: container
theforeman:
  foremanctl: 698

@arvind4501
arvind4501 force-pushed the auth-bundle branch 2 times, most recently from 20ff8d8 to 08f2ba2 Compare July 31, 2026 06:38
@arvind4501
arvind4501 removed the request for review from a team July 31, 2026 06:38
@arvind4501

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle
deployment_type: container
theforeman:
  foremanctl: 698

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16307
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/foremanctl/test_install_foremanctl.py -k test_positive_foremanctl_auth_bundle --external-logging
Test Result : ========== 20 deselected, 12 warnings, 1 error in 4620.05s (1:17:00) ===========

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-Failed Indicates that latest PRT run is failed for the PR Stream Introduced in or relating directly to Satellite Stream/Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants