foreman-documentation icon indicating copy to clipboard operation
foreman-documentation copied to clipboard

Include table definition in Ruby script

Open ekohl opened this issue 1 month ago • 3 comments

What changes are you introducing?

It moves some steps from manual to a little bit longer script that's already copied verbatim anyway.

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

This reduces the number of steps a user needs to take.

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

The whole procedure is ugly and should be replaced with something else native to Foreman but that's out of scope for this PR.

Contributor checklists

  • [x] I am okay with my commits getting squashed when you merge this PR.
  • [x] I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • [ ] Foreman 3.17/Katello 4.19
  • [ ] Foreman 3.16/Katello 4.18 (Satellite 6.18)
  • [ ] Foreman 3.15/Katello 4.17
  • [ ] Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4)
  • [ ] Foreman 3.13/Katello 4.15 (EL9 only)
  • [ ] Foreman 3.12/Katello 4.14 (Satellite 6.16; orcharhino 7.2 on EL9 only; orcharhino 7.3)
  • [ ] Foreman 3.11/Katello 4.13 (orcharhino 6.11 on EL8 only; orcharhino 7.0 on EL8+EL9; orcharhino 7.1 with Leapp)
  • [ ] Foreman 3.10/Katello 4.12
  • [ ] Foreman 3.9/Katello 4.11 (Satellite 6.15; orcharhino 6.8/6.9/6.10)
  • We do not accept PRs for Foreman older than 3.9.

Summary by Sourcery

Documentation:

  • Clarify the procedure for creating a complete permission table by expanding the Ruby script usage to cover additional manual steps.

ekohl avatar Nov 21 '25 17:11 ekohl

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Extends the existing Ruby-based procedure for creating a complete permission table so that the script itself now includes the table definition, reducing the manual steps required from the user.

File-Level Changes

Change Details Files
Inline the permission table definition into the Ruby script used in the documentation procedure, streamlining the manual workflow.
  • Update the documented Ruby script to define the permissions table structure directly in code instead of requiring a separate manual definition step
  • Adjust surrounding procedural text so fewer steps are run manually and more are handled by the script
  • Ensure the example remains copy-pasteable and consistent with the existing Foreman documentation style
guides/common/modules/proc_creating-a-complete-permission-table.adoc

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

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Nov 21 '25 17:11 sourcery-ai[bot]

QA

Tested locally :heavy_check_mark:

$ cat test_me.rb
#!/usr/bin/env ruby

result = "hello\n"

f = File.open('/tmp/table.html', 'w')
f.write("<table border=\"1\"><tr><td>Permission name</td><td>Actions</td><td>Resource type</td></tr>\n")
f.write(result)
f.write("</table>\n")
$ ./test_me.rb
$ cat /tmp/table.html
<table border="1"><tr><td>Permission name</td><td>Actions</td><td>Resource type</td></tr>
hello
</table>

maximiliankolb avatar Nov 24 '25 07:11 maximiliankolb