Skip to content

Improve README with comprehensive project documentation#1168

Open
chris1984 wants to merge 1 commit intotheforeman:developfrom
chris1984:better-readme
Open

Improve README with comprehensive project documentation#1168
chris1984 wants to merge 1 commit intotheforeman:developfrom
chris1984:better-readme

Conversation

@chris1984
Copy link
Member

@chris1984 chris1984 commented Mar 5, 2026

Add proper project description, requirements, operating modes, development setup, testing instructions, and contributing guidelines.

Summary by Sourcery

Update the README with comprehensive user and contributor documentation for the ForemanRhCloud plugin, including usage, development, and architecture references.

Documentation:

  • Document plugin purpose, key capabilities, and operating modes for ForemanRhCloud.
  • Add detailed usage instructions for inventory upload, Insights recommendations, and inventory status sync via UI and CLI.
  • Describe required dependencies and supported Foreman, Katello, and related plugin versions.
  • Document cloud endpoint URLs and environment variable overrides used by the plugin.
  • Add development, testing, linting, and local server setup instructions, plus a pointer to architecture documentation.
  • Expand contributing guidelines with a clearer workflow for submitting changes.

Chores:

  • Update copyright years and clean up minor formatting in the license notice.

Add proper project description, requirements, operating modes,
development setup, testing instructions, and contributing guidelines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 5, 2026

Reviewer's Guide

README.md is overhauled into a full project guide, adding detailed feature description, operating modes, usage examples, cloud endpoint documentation, development and testing workflows, and contributing instructions, while cleaning up outdated sections and fixing minor formatting and copyright details.

Flow diagram for development and testing workflow from README

flowchart TD
  A[Start working on foreman_rh_cloud] --> B[Clone Foreman repository]
  B --> C[Clone foreman_rh_cloud plugin]
  C --> D[Install Ruby dependencies in Foreman root using bundle install]
  D --> E[Install JavaScript dependencies in plugin directory using npm install]

  E --> F[Run Ruby plugin test suite from Foreman root using bundle exec rake test:foreman_rh_cloud]
  F --> G[Optionally run a single Ruby test file with bundle exec rake test TEST=path]

  E --> H[Run JavaScript tests in plugin directory using npm test]
  H --> I[Optionally use npm run test:watch]
  H --> J[Optionally use npm run test:current]

  F --> K[Run Ruby linter in Foreman root using bundle exec rubocop --parallel]
  H --> L[Run JavaScript linter in plugin directory using npm run lint]

  K --> M[Optionally start development server from Foreman root using bundle exec foreman start]
  L --> M

  M --> N[Open UI and exercise Inventory Upload, Insights Recommendations, and Inventory Status Sync]
Loading

Flow diagram for contributing process from README

flowchart TD
  A[Decide to contribute to foreman_rh_cloud] --> B[Fork the repository]
  B --> C[Create a feature branch]
  C --> D[Make code or documentation changes]
  D --> E[Run Ruby and JavaScript tests]
  E --> F[Run Ruby and JavaScript linters]
  F --> G[Ensure all checks pass]
  G --> H[Submit a Pull Request]
Loading

File-Level Changes

Change Details Files
Rewrite README into a comprehensive user and contributor guide for the ForemanRhCloud plugin.
  • Add high-level project description and list of plugin capabilities including inventory upload, Insights recommendations, remediations, Cloud Connector, and client tools forwarding
  • Document requirements such as required Foreman plugins and supported Ruby versions
  • Clarify installation by linking directly to the Foreman wiki plugin installation guide
  • Describe operating modes (Regular cloud mode vs. IoP on-premise mode) and how mode selection affects behavior, including a helper method to inspect the current mode
  • Add detailed usage instructions for inventory upload, Insights recommendations sync, and inventory status sync via both UI flows and CLI rake tasks
  • Normalize and extend cloud endpoint documentation, including default URLs and environment variable overrides in a markdown table
  • Introduce development section with setup steps, explicit separation between Foreman root vs plugin directory usage, and JS dependency installation
  • Add testing section covering Ruby and JavaScript test commands and how to run targeted tests
  • Add linting and development server instructions to support local development workflows
  • Replace inline design notes with a pointer to ARCHITECTURE.md for deeper technical documentation
  • Expand contributing guidelines into a short checklist including running tests and linters before PR submission
  • Update copyright years and clean up minor formatting, capitalization, and spacing in license boilerplate
README.md

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

@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 found 1 issue, and left some high level feedback:

  • In the Cloud Endpoints table, consider aligning the descriptions with the previous design section by either including or explicitly omitting query parameters so it’s clear whether the base URL or a fully parameterized endpoint is expected.
  • The README now mixes generic /path/to/foreman instructions with concrete system locations used earlier (/usr/sbin/foreman-rake); it may help readers if you briefly note when distro-specific paths (e.g., Satellite packages) differ from development setups and how to adapt the commands.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the Cloud Endpoints table, consider aligning the descriptions with the previous design section by either including or explicitly omitting query parameters so it’s clear whether the base URL or a fully parameterized endpoint is expected.
- The README now mixes generic `/path/to/foreman` instructions with concrete system locations used earlier (`/usr/sbin/foreman-rake`); it may help readers if you briefly note when distro-specific paths (e.g., Satellite packages) differ from development setups and how to adapt the commands.

## Individual Comments

### Comment 1
<location path="README.md" line_range="35-37" />
<code_context>
+
+The default mode. Communicates directly with Red Hat cloud services to upload inventory, download recommendations, and forward client requests.
+
+### IoP Mode (On-Premise)
+
+When an Insights on Premise (IoP) Smart Proxy is configured, all cloud communication is routed through the local proxy instead. HTTP proxy settings are disabled, and scheduled sync tasks are skipped.
+
+Check the current mode: `ForemanRhCloud.with_iop_smart_proxy?`
</code_context>
<issue_to_address>
**suggestion (typo):** Use the standard term "on-premises" instead of "on-premise/on Premise" for accuracy and consistency.

For example, update the heading to `IoP Mode (On-Premises)` and the sentence to `When an Insights on-premises (IoP) Smart Proxy is configured, ...` for consistent terminology.

```suggestion
### IoP Mode (On-Premises)

When an Insights on-premises (IoP) Smart Proxy is configured, all cloud communication is routed through the local proxy instead. HTTP proxy settings are disabled, and scheduled sync tasks are skipped.
```
</issue_to_address>

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 on lines +35 to +37
### IoP Mode (On-Premise)

When an Insights on Premise (IoP) Smart Proxy is configured, all cloud communication is routed through the local proxy instead. HTTP proxy settings are disabled, and scheduled sync tasks are skipped.
Copy link

Choose a reason for hiding this comment

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

suggestion (typo): Use the standard term "on-premises" instead of "on-premise/on Premise" for accuracy and consistency.

For example, update the heading to IoP Mode (On-Premises) and the sentence to When an Insights on-premises (IoP) Smart Proxy is configured, ... for consistent terminology.

Suggested change
### IoP Mode (On-Premise)
When an Insights on Premise (IoP) Smart Proxy is configured, all cloud communication is routed through the local proxy instead. HTTP proxy settings are disabled, and scheduled sync tasks are skipped.
### IoP Mode (On-Premises)
When an Insights on-premises (IoP) Smart Proxy is configured, all cloud communication is routed through the local proxy instead. HTTP proxy settings are disabled, and scheduled sync tasks are skipped.

- **Insights Recommendations** — Sync security, performance, and stability recommendations from Red Hat Insights
- **Remediations** — Apply Insights remediation playbooks via Remote Execution (Ansible)
- **Cloud Connector** — Enable cloud-initiated remediations through `rhcd`
- **Client Tools Forwarding** — Proxy `insights-client` requests from managed hosts that lack direct internet access
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's for any hosts registered to Foreman, not just those that lack internet access.

Suggested change
- **Client Tools Forwarding** — Proxy `insights-client` requests from managed hosts that lack direct internet access
- **Client Tools Forwarding** — Proxy `insights-client` requests from managed hosts

Comment on lines +18 to +20
- [Katello](https://github.com/Katello/katello) >= 4.18
- [foreman_ansible](https://github.com/theforeman/foreman_ansible) >= 15.0.0
- [foreman-tasks](https://github.com/theforeman/foreman-tasks) >= 10.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would leave the version numbers out here - just another thing to keep up to date.

Comment on lines +35 to +37
### IoP Mode (On-Premise)

When an Insights on Premise (IoP) Smart Proxy is configured, all cloud communication is routed through the local proxy instead. HTTP proxy settings are disabled, and scheduled sync tasks are skipped.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could highlight here that IoP is a technical abbreviation, but it doesn't officially stand for anything.


### Inventory Upload

**UI:** Insights → Inventory Upload → select the organization → Generate and upload report
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
**UI:** Insights → Inventory Upload → select the organization → Generate and upload report
**UI (cloud):** Insights → Inventory Upload → select the organization → Generate and upload report
**UI (IoP):** Administer → Inventory Upload → select the organization → Generate and upload report

foreman-rake rh_cloud_inventory:report:generate_upload

# Generate and upload report for specific organization
organization_id=1 foreman-rake rh_cloud_inventory:report:generate_upload
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will not work with env var in front

organization_id=1 foreman-rake rh_cloud_inventory:report:generate_upload

# Generate report without uploading
organization_id=1 target=/var/lib/foreman/red_hat_inventory/generated_reports/ \
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

foreman-rake rh_cloud_inventory:report:generate

# Upload a previously generated report
organization_id=1 target=/var/lib/foreman/red_hat_inventory/generated_reports/ \
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

## Project overview
See our [wiki](https://deepwiki.com/theforeman/foreman_rh_cloud)
# Specific organization
organization_id=1 foreman-rake rh_cloud_inventory:sync
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

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