Skip to content

Hostname ipa#30

Merged
jakub-vavra-cz merged 2 commits into
RedHat-SP-Security:masterfrom
jakub-vavra-cz:hostname_ipa
May 14, 2026
Merged

Hostname ipa#30
jakub-vavra-cz merged 2 commits into
RedHat-SP-Security:masterfrom
jakub-vavra-cz:hostname_ipa

Conversation

@jakub-vavra-cz
Copy link
Copy Markdown
Collaborator

@jakub-vavra-cz jakub-vavra-cz commented May 14, 2026

Update test_basic__hostname_hostname
Changes in the test framework for dyndns result in client hostname being changed according to enrolled backend.
We need to detect hostname instead of expecting client.test.
Added python-specific .gitignore file.
Fixed ci to work better in fork itself.

Summary by Sourcery

Align hostname-based tests and CI configuration with the new dynamic hostname handling and fork-friendly setup.

Bug Fixes:

  • Adapt hostname hostname test to use dynamic hostname detection via client hostname utilities instead of hard-coded hostnames.

CI:

  • Update CI workflows to check out the current repository instead of a fixed upstream repository, improving fork compatibility.

Tests:

  • Adjust hostname matching logic in test_basic__hostname_hostname to derive allowed and alternate hostnames from the client’s resolved FQDN and shortname utilities.

Chores:

  • Add a Python-oriented .gitignore file to exclude common Python build and cache artifacts from version control.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 14, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts hostname-based tests to use the new hostnameutils abstraction and to derive the alternate hostname dynamically, simplifies GitHub Actions checkout for forks, and introduces a Python-oriented .gitignore file.

File-Level Changes

Change Details Files
Update hostname tests to rely on hostnameutils instead of client.host.hostname and to derive alternate hostnames robustly from the FQDN.
  • Use client.hostnameutils.shortname for shortname-based expectations instead of splitting client.host.hostname.
  • Use client.hostnameutils.fqdn for FQDN-based expectations and compute other_host by reusing the domain portion when present.
  • Update wildcard hostname cases to build patterns from hostnameutils.shortname and hostnameutils.fqdn rather than string slicing on client.host.hostname.
pytest/tests/test_basic.py
Simplify GitHub Actions repository checkout so CI can run correctly in forks.
  • Remove explicit repository override from the main CI workflow checkout step so it checks out the fork/PR repository by default.
  • Remove explicit repository override from the static code analysis workflow checkout step for the same reason.
.github/workflows/ci.yml
.github/workflows/static-code-analysis.yml
Add a Python-focused .gitignore to keep common local and build artifacts out of version control.
  • Introduce a new .gitignore file tailored for Python development artifacts (e.g., bytecode, virtualenvs, build outputs).
.gitignore

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

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


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.

Comment thread pytest/tests/test_basic.py Outdated
The explicit repo/branch prevented proper execution of ci in forks.
Changes in the test framework for dyndns result in client hostname
being chaged according to enrolled backend.
We need to detect hostname instead of expecting client.test.
Added python-specific .gitignore file.
Copy link
Copy Markdown
Collaborator

@shridhargadekar shridhargadekar left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@shridhargadekar shridhargadekar self-assigned this May 14, 2026
@jakub-vavra-cz jakub-vavra-cz merged commit 666dd8a into RedHat-SP-Security:master May 14, 2026
3 of 4 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.

2 participants