Skip to content

docs: fix and refactor README#2197

Open
Dugowitch wants to merge 1 commit into
RedHatInsights:masterfrom
Dugowitch:readme
Open

docs: fix and refactor README#2197
Dugowitch wants to merge 1 commit into
RedHatInsights:masterfrom
Dugowitch:readme

Conversation

@Dugowitch
Copy link
Copy Markdown
Contributor

@Dugowitch Dugowitch commented May 15, 2026

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Update and expand README guidance for developing, testing, and profiling the patchman-engine service.

Documentation:

  • Refine README wording and table of contents, and clarify development environment prerequisites.
  • Document workflows for running services locally, with monitoring, and with individual components on the host OS.
  • Clarify and consolidate test and debugging instructions, including running subsets of tests and VS Code integration.
  • Document database and Kafka control procedures within the development environment.
  • Improve OpenAPI, VMaaS, monitoring, SonarQube, Grafana, and profiling documentation for local and admin use.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 15, 2026

Reviewer's Guide

Refactors and expands the README to better describe local development, testing, Kafka control, OpenAPI generation, VMaaS usage, monitoring, SonarQube analysis, Grafana configuration, and pprof profiling, while fixing wording, headings, and consistency issues.

File-Level Changes

Change Details Files
Restructure development environment documentation, including local running, monitoring profile, and running components on the host OS.
  • Rename and reorganize the table of contents entries under Development environment, including Running locally and Testing and debugging
  • Clarify podman-compose usage for starting/stopping containers and monitoring profile
  • Document how to stop a single component and run it directly via scripts with environment loaded from conf/local.env
README.md
Clarify and consolidate testing, debugging, and VS Code test workflow instructions.
  • Describe the purpose and coverage of the test suite, including mocked services and static analysis
  • Standardize the command to run the full test suite with docker-compose.test.yml and podman-compose
  • Explain how to run a subset of tests via go_test.sh and how to run a single test locally after building images
  • Document VS Code Go extension pre-requisites and copying settings.example.json for test configuration
README.md
Improve database access and Kafka control documentation for local environments.
  • Explain how to access the dev/test database via podman exec into the db container
  • Describe how to run a local psql client using environment variables and dev/scripts/psql.sh
  • Move and update Kafka control section to use podman-compose exec, documenting topic inspection, consuming, and producing debug messages
README.md
Refine OpenAPI documentation generation steps and private API usage.
  • Clarify that OpenAPI docs are served at the local /openapi/index.html endpoint
  • Make installation of swaggo/swag explicit as a first-time prerequisite
  • Keep generate_docs.sh as the main entrypoint for regenerating OpenAPI sources
  • Improve wording for control by private API usage in vmaas_sync container with explicit commands
README.md
Update VMaaS, monitoring, SonarQube, Grafana, and profiling documentation for clarity and consistency.
  • Clarify that VMaaS is mocked as part of the platform mock for local development
  • Tighten wording for monitoring, metrics, and CloudWatch logging
  • Refine SonarQube analysis and Grafana config map update instructions with more precise wording and file names
  • Restructure profiling section into Local development and Admin API, update env var names, switch from docker-compose to podman-compose, and list pprof ports per component
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

Comment thread README.md

### Running locally
Uses `podman-compose` to deploy the individual project components and supporting containers, which simulate the CMSfR platform and database:
Use `podman-compose` to deploy the individual project components and supporting containers that simulate the CMSfR platform and database:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BTW, what is CMSfR?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.06%. Comparing base (ee9c711) to head (a53acf2).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2197   +/-   ##
=======================================
  Coverage   59.06%   59.06%           
=======================================
  Files         136      136           
  Lines        8761     8761           
=======================================
  Hits         5175     5175           
  Misses       3040     3040           
  Partials      546      546           
Flag Coverage Δ
unittests 59.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dugowitch Dugowitch marked this pull request as ready for review May 18, 2026 09:31
@Dugowitch Dugowitch requested a review from a team as a code owner May 18, 2026 09:31
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 found 3 issues, and left some high level feedback:

  • In the OpenAPI docs section, consider replacing go get -u github.com/swaggo/swag/cmd/swag with a go install command including a version (per current Go tooling best practices) to avoid installing an unpinned, possibly incompatible version.
  • There are still references to docker-compose and docker-compose.yml (e.g., in the Monitoring section); since the rest of the README standardizes on podman-compose, consider either updating these references or explicitly calling out both options for consistency.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the OpenAPI docs section, consider replacing `go get -u github.com/swaggo/swag/cmd/swag` with a `go install` command including a version (per current Go tooling best practices) to avoid installing an unpinned, possibly incompatible version.
- There are still references to `docker-compose` and `docker-compose.yml` (e.g., in the Monitoring section); since the rest of the README standardizes on `podman-compose`, consider either updating these references or explicitly calling out both options for consistency.

## Individual Comments

### Comment 1
<location path="README.md" line_range="113" />
<code_context>
+The REST API is documented using OpenAPI v3. On a local instance, it can be accessed at <http://localhost:8080/openapi/index.html>.

-To update/regenerate OpenAPI sources run:
+First time, ensure that you have `swaggo/swag` binary installed:
+~~~bash
+go get -u github.com/swaggo/swag/cmd/swag
</code_context>
<issue_to_address>
**nitpick (typo):** Rephrase "First time" for smoother grammar

You could change this to either “For the first time, ensure that you have the `swaggo/swag` binary installed:” or simply “First, ensure that you have the `swaggo/swag` binary installed:” to improve the phrasing.

```suggestion
First, ensure that you have the `swaggo/swag` binary installed:
```
</issue_to_address>

### Comment 2
<location path="README.md" line_range="38-44" />
<code_context>
+Grafana is available at <http://localhost:3000> and Prometheus at <http://localhost:9090>.

+#### Run a component in the host OS
+Run a single component in the host OS, the rest in podman-compose:
+~~~bash
+podman-compose stop evaluator_upload # stop a single component using podman-compose
</code_context>
<issue_to_address>
**suggestion (typo):** Avoid comma splice in this sentence

Consider rephrasing to avoid the comma splice, for example:
- "Run a single component in the host OS while running the rest in podman-compose:"
- "Run a single component in the host OS and run the rest in podman-compose:"

```suggestion
#### Run a component in the host OS
Run a single component in the host OS while running the rest in podman-compose:
~~~bash
podman-compose stop evaluator_upload # stop a single component using podman-compose
export $(xargs < conf/local.env)
./scripts/entrypoint.sh evaluator # (or listener, or manager) run the component in the host OS
</issue_to_address>

### Comment 3
<location path="README.md" line_range="167" />
<code_context>
+
+### Using Admin API
+1. Set `ENABLE_PROFILE_{container_name}=true` in the ClowdApp.
+2. Download the profile file using internal api `/api/patch/admin/pprof/{manager|listener|evaluator_upload|evaluator_recalc}/{heap|profile|block|mutex|trace}`.
+3. Run `go tool pprof <saved.file>`.
</code_context>
<issue_to_address>
**nitpick (typo):** Capitalize "API" consistently

For consistency with common usage and the rest of the document, please capitalize "api" as "API" in this sentence.

```suggestion
2. Download the profile file using internal API `/api/patch/admin/pprof/{manager|listener|evaluator_upload|evaluator_recalc}/{heap|profile|block|mutex|trace}`.

</issue_to_address>


</details>

***

<details>
<summary>Sourcery is free for open source - if you like our reviews please consider sharing them ✨</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https://sourcery.ai)
- [Facebook](https://www.facebook.com/sharer/sharer.php?u=https://sourcery.ai)

</details>

<sub>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
</sub>

Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md Outdated
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