Skip to content

Dist gen generation#541

Open
tjuhaszrh wants to merge 9 commits into
sclorg:masterfrom
tjuhaszrh:dist-git2
Open

Dist gen generation#541
tjuhaszrh wants to merge 9 commits into
sclorg:masterfrom
tjuhaszrh:dist-git2

Conversation

@tjuhaszrh

@tjuhaszrh tjuhaszrh commented May 18, 2026

Copy link
Copy Markdown
Contributor

Cleaning up the draft PR.

Summary by CodeRabbit

  • New Features
    • Added templated generation for Node.js 20, 22, and 24 images across RHEL, Fedora, and CentOS Stream, including full and minimal variants.
    • Introduced improved S2I build/run behavior with development vs production installs, debugging support, init-style signal handling, and node_modules artifact saving.
  • Documentation
    • Added comprehensive README documentation for full and minimal images, plus updated build/run/environment guidance.
    • Updated the “Versions” table with additional platform registry addresses.
  • Maintenance
    • Updated buildpack stack targets to Node.js 22/24 and removed legacy c8s Dockerfile variants.

@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

[test]

@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - 24Fedora-latestx86_64✅ passed19.05.2026 12:13:4210min 14stest pipeline
CentOS Stream 10 - 24-minimalCentOS-Stream-10x86_64✅ passed19.05.2026 12:02:4410min 18stest pipeline
CentOS Stream 10 - 22-minimalCentOS-Stream-10x86_64✅ passed19.05.2026 11:15:5811min 44stest pipeline
CentOS Stream 9 - 24CentOS-Stream-9x86_64✅ passed19.05.2026 11:16:4613min 52stest pipeline
CentOS Stream 10 - 22CentOS-Stream-10x86_64✅ passed19.05.2026 11:37:3813min 40stest pipeline
RHEL10 - FIPS Enabled - 24-minimalRHEL-10.2-Nightlyx86_64✅ passed19.05.2026 10:52:3118min 52stest pipeline
RHEL10 - FIPS Enabled - 22-minimalRHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:15:1220min 10stest pipeline
RHEL8 - 22RHEL-8.10.0-Nightlyx86_64✅ passed19.05.2026 12:11:0316min 57stest pipeline
RHEL8 - 22-minimalRHEL-8.10.0-Nightlyx86_64✅ passed19.05.2026 11:57:5618min 13stest pipeline
RHEL10 - 24-minimalRHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:23:5921min 18stest pipeline
RHEL10 - Unsubscribed host - 24RHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:59:0421min 54stest pipeline
Fedora - 24-minimalFedora-latestx86_64✅ passed04.06.2026 10:14:437min 44stest pipeline
RHEL10 - FIPS Enabled - 24RHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:05:4527min 2stest pipeline
RHEL9 - 24RHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:51:5125min 59stest pipeline
RHEL9 - Unsubscribed host - 22RHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:45:2021min 28stest pipeline
RHEL9 - FIPS Enabled - 24-minimalRHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 10:51:4523min 44stest pipeline
RHEL10 - FIPS Enabled - 22RHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:10:0023min 17stest pipeline
RHEL9 - FIPS Enabled - 22-minimalRHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:01:3931min 33stest pipeline
RHEL9 - FIPS Enabled - 24RHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:06:5834min 52stest pipeline
RHEL10 - 22RHEL-10.2-Nightlyx86_64✅ passed19.05.2026 12:15:0628min 5stest pipeline
RHEL9 - Unsubscribed host - 22-minimalRHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:59:1722min 15stest pipeline
RHEL10 - Unsubscribed host - 22-minimalRHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:53:1218min 42stest pipeline
CentOS Stream 9 - 24-minimalCentOS-Stream-9x86_64✅ passed19.05.2026 12:14:2910min 46stest pipeline
RHEL10 - 24RHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:31:2020min 21stest pipeline
RHEL10 - 22-minimalRHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:34:2218min 25stest pipeline
RHEL9 - FIPS Enabled - 22RHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 10:55:4830min 40stest pipeline
RHEL9 - 22-minimalRHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 12:04:5123min 4stest pipeline
RHEL10 - Unsubscribed host - 22RHEL-10.2-Nightlyx86_64✅ passed19.05.2026 12:06:1020min 53stest pipeline
RHEL9 - Unsubscribed host - 24RHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:51:0121min 37stest pipeline
RHEL9 - 22RHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:50:4226min 55stest pipeline
RHEL9 - Unsubscribed host - 24-minimalRHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:42:4122min 31stest pipeline
RHEL9 - 24-minimalRHEL-9.8.0-Nightlyx86_64✅ passed19.05.2026 11:28:3722min 19stest pipeline
CentOS Stream 10 - 24CentOS-Stream-10x86_64✅ passed19.05.2026 11:15:4513min 25stest pipeline
RHEL10 - Unsubscribed host - 24-minimalRHEL-10.2-Nightlyx86_64✅ passed19.05.2026 11:54:4219min 1stest pipeline

@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

Tests seem to mostly pass, the failures look like infra issues.
I have also separated the changes into more commits for better structuring.

@tjuhaszrh
tjuhaszrh force-pushed the dist-git2 branch 4 times, most recently from a5b6c0f to 6852710 Compare May 19, 2026 10:38
@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

[test]

@tjuhaszrh tjuhaszrh changed the title [Draft] Dist gen generation Dist gen generation May 19, 2026
@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

@phracek Could you do a review please?

@phracek phracek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a few comments. C8S is not supported at all.

Comment thread specs/multispec.yml Outdated
Comment thread specs/multispec.yml Outdated
Comment thread manifest-minimal.yml Outdated
Comment thread manifest.yml Outdated
@phracek

phracek commented Jun 4, 2026

Copy link
Copy Markdown
Member

@tjuhaszrh Please update .github/workflows/container-tests.yml and .github/workflows/container-upstream-tests.yml so it checks distgen. See here: https://github.com/sclorg/postgresql-container/blob/master/.github/workflows/container-tests.yml#L7. This has to be done as separate pull request. @pkhartsk Am I right, or it could be part of this pull request?

@tjuhaszrh tjuhaszrh self-assigned this Jun 4, 2026
@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

[test]

@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

I don't think the README check targets changes from this PR.
I don't even understand why it was runned, I probably accidentally started it manually.

@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

Just a few comments. C8S is not supported at all.

Removed all mentions of c8s and regenerated files, so c8s dockerfiles should be gone.

@tjuhaszrh
tjuhaszrh requested a review from phracek June 4, 2026 10:30
@phracek

phracek commented Jun 4, 2026

Copy link
Copy Markdown
Member

@tjuhaszrh Please by make version-table regenerated the version table and add README.md to the pull request as well.

@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

[test]

@phracek phracek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@phracek

phracek commented Jun 8, 2026

Copy link
Copy Markdown
Member

[test]

@phracek

phracek commented Jun 9, 2026

Copy link
Copy Markdown
Member

[test-pytest]

@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

[test]

@phracek phracek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@phracek phracek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See my comments. Let's make the src/Dockerfile more readable. Let's remove a lot of duplicty.

But thanks for your good work.

Comment thread src/Dockerfile Outdated
Comment thread src/Dockerfile Outdated
{% if spec.prod in ["c9s", "rhel10", "c10s"] %}
# Package libatomic_ops was removed
{% endif %}{% if spec.prod in ["rhel10", "c10s"] and spec.version == "22" %}
RUN INSTALL_PKGS="make gcc gcc-c++ git openssl-devel nodejs nodejs-nodemon nodejs-npm nss_wrapper-libs which" && \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about to add none npm package to mamultispec.yml file and add only nodejs version or unversioned packages here.

Comment thread src/Dockerfile Outdated
Comment thread src/Dockerfile Outdated
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@tjuhaszrh, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 797387d1-3a5c-4cbd-8139-be62b9e04e56

📥 Commits

Reviewing files that changed from the base of the PR and between 987fc0a and 02fb0d2.

📒 Files selected for processing (45)
  • 22-minimal/.exclude-c8s
  • 22-minimal/.exclude-c9s
  • 22-minimal/.exclude-fedora
  • 22-minimal/Dockerfile.c8s
  • 22-minimal/s2i/bin/init-wrapper
  • 22-minimal/s2i/bin/run
  • 22/.exclude-c8s
  • 22/.exclude-c9s
  • 22/.exclude-fedora
  • 22/Dockerfile.rhel8
  • 22/Dockerfile.rhel9
  • 22/s2i/bin/init-wrapper
  • 22/s2i/bin/run
  • 22/test
  • 24-minimal/.exclude-c8s
  • 24-minimal/.exclude-rhel8
  • 24-minimal/Dockerfile.c8s
  • 24-minimal/s2i/bin/init-wrapper
  • 24-minimal/s2i/bin/run
  • 24/.exclude-c8s
  • 24/.exclude-rhel8
  • 24/Dockerfile.c8s
  • 24/Dockerfile.rhel8
  • 24/Dockerfile.rhel9
  • 24/s2i/bin/init-wrapper
  • 24/s2i/bin/run
  • 24/test
  • README.md
  • manifest-minimal.yml
  • manifest.yml
  • specs/multispec-npm-config.yml
  • specs/multispec.yml
  • src/Dockerfile
  • src/README.md
  • src/README.minimal.md
  • src/root/opt/app-root/etc/generate_container_user
  • src/root/opt/app-root/etc/npm_global_module_list
  • src/root/opt/app-root/etc/scl_enable
  • src/root/usr/bin/fix-permissions
  • src/s2i/bin/assemble
  • src/s2i/bin/init-wrapper
  • src/s2i/bin/run
  • src/s2i/bin/run-minimal
  • src/s2i/bin/save-artifacts
  • src/s2i/bin/usage
📝 Walkthrough

Walkthrough

The change adds templated Node.js image sources, multispec build matrices, generation manifests, S2I lifecycle scripts, runtime helpers, and documentation. It also updates Node.js 22/24 metadata and generated artifacts, fills registry entries, and removes obsolete c8s Dockerfiles.

Changes

Node.js image generation and runtime

Layer / File(s) Summary
Version and distribution build matrix
specs/multispec.yml, specs/multispec-npm-config.yml
Defines supported distributions, Node.js 20/22/24 full and minimal variants, package configuration, image naming, and build combinations.
Image artifact generation manifests
manifest.yml, manifest-minimal.yml
Adds rules for generating Dockerfiles and READMEs, copying executable runtime files, and wiring test symlinks.
Parameterized Dockerfile and runtime support
src/Dockerfile, src/root/opt/app-root/etc/*, src/root/usr/bin/fix-permissions
Templatizes image bases, metadata, package installation, links, post-install behavior, permissions, and RHEL8 toolset setup, with supporting runtime files.
S2I build and startup lifecycle
src/s2i/bin/*
Adds assembly, npm configuration, startup selection, debug handling, artifact saving, usage output, user mapping, and signal forwarding through init-wrapper.
Generated image documentation
src/README.md, src/README.minimal.md
Documents S2I and Dockerfile workflows, environment variables, development mode, hot deploy, and init-wrapper usage.

Versioned artifact corrections

Layer / File(s) Summary
Node.js 22 and 24 stack metadata
22/Dockerfile.rhel*, 24/Dockerfile.rhel*
Updates CNB stack environment values and Buildpacks labels to the matching Node.js versions.
Generated artifact normalization
22*/s2i/bin/run, 24*/s2i/bin/run, 22/test, 24/test, README.md
Normalizes whitespace and test symlink targets, and fills registry entries for Node.js 22 and 24 variants.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant S2I
  participant assemble
  participant run
  participant init-wrapper
  participant NodeProcess
  S2I->>assemble: provide application source
  assemble->>assemble: configure npm and install dependencies
  assemble->>assemble: build and prune production dependencies
  S2I->>run: start container
  run->>run: resolve DEV_MODE and startup command
  run->>init-wrapper: launch wrapped command when enabled
  init-wrapper->>NodeProcess: start and forward signals
  run->>NodeProcess: launch direct or derived command
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague and does not clearly describe the main change in the pull request. Use a concise, specific title that mentions the distgen manifest and Dockerfile regeneration changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/README.md (1)

5-5: ⚡ Quick win

Fix spelling and grammar errors in both README templates.

Multiple spelling errors and hyphenation issues reduce clarity and professional appearance. Consistent errors across both files:

  • src/README.md#L206, src/README.minimal.md#L278: "souce" → "source"
  • src/README.md#L264, src/README.minimal.md#L336: "avalable" → "available"
  • src/README.md#L149, src/README.minimal.md#L222: "environemnt variale" → "environment variable"
  • src/README.md#L301, src/README.minimal.md#L372: "another versions" → "other versions"
  • src/README.md#L5,L7, src/README.minimal.md#L7: "Fedora based" → "Fedora-based"
  • src/README.md#L166, src/README.minimal.md#L238: "key value pairs" → "key-value pairs"
🔧 Proposed fixes for spelling and grammar in src/README.md
-Users can choose between RHEL, CentOS and Fedora based images.
+Users can choose between RHEL, CentOS and Fedora-based images.

-and the Fedora images are available in [Quay.io](https://quay.io/organization/fedora).
+and the Fedora-based images are available in [Quay.io](https://quay.io/organization/fedora).

-In case of `NODE_CMD` environemnt variale is specified, then `init-wrapper` script will use the value of `NODE_CMD` to start your application.
+In case of `NODE_CMD` environment variable is specified, then `init-wrapper` script will use the value of `NODE_CMD` to start your application.

-One way to define a set of environment variables is to include them as key value pairs in your repo's `.s2i/environment` file.
+One way to define a set of environment variables is to include them as key-value pairs in your repo's `.s2i/environment` file.

-As part of development mode, this image supports hot deploy. If development mode is enabled, any souce code that is changed in the running container will be immediately reflected in the running nodejs application.
+As part of development mode, this image supports hot deploy. If development mode is enabled, any source code that is changed in the running container will be immediately reflected in the running nodejs application.

-A detailed explanation on how the init-wrapper script works is avalable in
+A detailed explanation on how the init-wrapper script works is available in

-In that repository you also can find another versions of Node.js environment Dockerfiles.
+In that repository you also can find other versions of Node.js environment Dockerfiles.
🔧 Proposed fixes for spelling and grammar in src/README.minimal.md
-Users can choose between RHEL, CentOS and Fedora based images.
+Users can choose between RHEL, CentOS and Fedora-based images.

-In case of `NODE_CMD` environemnt variale is specified, then `init-wrapper` script will use the value of `NODE_CMD` to start your application.
+In case of `NODE_CMD` environment variable is specified, then `init-wrapper` script will use the value of `NODE_CMD` to start your application.

-One way to define a set of environment variables is to include them as key value pairs in your repo's `.s2i/environment` file.
+One way to define a set of environment variables is to include them as key-value pairs in your repo's `.s2i/environment` file.

-As part of development mode, this image supports hot deploy. If development mode is enabled, any souce code that is changed in the running container will be immediately reflected in the running nodejs application.
+As part of development mode, this image supports hot deploy. If development mode is enabled, any source code that is changed in the running container will be immediately reflected in the running nodejs application.

-A detailed explanation on how the init-wrapper script works is avalable in
+A detailed explanation on how the init-wrapper script works is available in

-In that repository you also can find another versions of Node.js environment Dockerfiles.
+In that repository you also can find other versions of Node.js environment Dockerfiles.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/README.md` at line 5, Fix all spelling and grammar errors across
src/README.md and src/README.minimal.md. In src/README.md at lines 5-7, change
"Fedora based" to "Fedora-based". Additionally, in src/README.md, correct
"souce" to "source" at line 206, "avalable" to "available" at line 264,
"environemnt variale" to "environment variable" at line 149, "another versions"
to "other versions" at line 301, and "key value pairs" to "key-value pairs" at
line 166. In src/README.minimal.md, apply the same corrections at the
corresponding locations: line 7 for "Fedora-based", line 278 for "source", line
336 for "available", line 222 for "environment variable", line 372 for "other
versions", and line 238 for "key-value pairs".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Dockerfile`:
- Around line 71-73: The conditional guard on line 71 checks for
`config.post_install` but the RUN directive on line 73 renders
`spec.post_install`, causing a namespace mismatch. Since the post_install field
is defined in the spec namespace in specs/multispec.yml, the condition will
always evaluate to false and skip the post-install hook. Change the conditional
on line 71 from `{% if config.post_install %}` to `{% if spec.post_install %}`
to match the namespace being used in the RUN statement.

In `@src/s2i/bin/run`:
- Around line 31-37: The startup command detection has two issues: First, on
line 36, the condition `[ -n $package_json_main ]` uses an unquoted variable,
which when empty expands to `[ -n ]` and evaluates to true incorrectly—add
quotes around the variable to properly check if it is non-empty. Second, lines
31-32 execute sed commands on package.json without verifying the file exists
first, which will cause the script to exit under set -e if the file is
missing—add a file existence check before the sed commands that read the
package.json file to ensure the script handles missing package.json gracefully.

---

Nitpick comments:
In `@src/README.md`:
- Line 5: Fix all spelling and grammar errors across src/README.md and
src/README.minimal.md. In src/README.md at lines 5-7, change "Fedora based" to
"Fedora-based". Additionally, in src/README.md, correct "souce" to "source" at
line 206, "avalable" to "available" at line 264, "environemnt variale" to
"environment variable" at line 149, "another versions" to "other versions" at
line 301, and "key value pairs" to "key-value pairs" at line 166. In
src/README.minimal.md, apply the same corrections at the corresponding
locations: line 7 for "Fedora-based", line 278 for "source", line 336 for
"available", line 222 for "environment variable", line 372 for "other versions",
and line 238 for "key-value pairs".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48becdda-8e9b-440a-9d42-410371d84779

📥 Commits

Reviewing files that changed from the base of the PR and between 07647bd and dc26e09.

📒 Files selected for processing (45)
  • 22-minimal/.exclude-c8s
  • 22-minimal/.exclude-c9s
  • 22-minimal/.exclude-fedora
  • 22-minimal/Dockerfile.c8s
  • 22-minimal/s2i/bin/init-wrapper
  • 22-minimal/s2i/bin/run
  • 22/.exclude-c8s
  • 22/.exclude-c9s
  • 22/.exclude-fedora
  • 22/Dockerfile.c8s
  • 22/Dockerfile.rhel8
  • 22/Dockerfile.rhel9
  • 22/s2i/bin/init-wrapper
  • 22/s2i/bin/run
  • 22/test
  • 24-minimal/.exclude-c8s
  • 24-minimal/.exclude-rhel8
  • 24-minimal/Dockerfile.c8s
  • 24-minimal/s2i/bin/init-wrapper
  • 24-minimal/s2i/bin/run
  • 24/.exclude-c8s
  • 24/.exclude-rhel8
  • 24/Dockerfile.c8s
  • 24/Dockerfile.rhel8
  • 24/Dockerfile.rhel9
  • 24/s2i/bin/init-wrapper
  • 24/s2i/bin/run
  • 24/test
  • README.md
  • manifest-minimal.yml
  • manifest.yml
  • specs/multispec.yml
  • src/Dockerfile
  • src/README.md
  • src/README.minimal.md
  • src/root/opt/app-root/etc/generate_container_user
  • src/root/opt/app-root/etc/npm_global_module_list
  • src/root/opt/app-root/etc/scl_enable
  • src/root/usr/bin/fix-permissions
  • src/s2i/bin/assemble
  • src/s2i/bin/init-wrapper
  • src/s2i/bin/run
  • src/s2i/bin/run-minimal
  • src/s2i/bin/save-artifacts
  • src/s2i/bin/usage
💤 Files with no reviewable changes (4)
  • 24-minimal/Dockerfile.c8s
  • 24/Dockerfile.c8s
  • 22-minimal/Dockerfile.c8s
  • 22/Dockerfile.c8s

Comment thread src/Dockerfile Outdated
Comment thread src/s2i/bin/run
Comment on lines +31 to +37
package_json_start=$(sed -n 's/\s*"start"\s*:\s*"\(.*\)".*/\1/p' package.json)
package_json_main=$(sed -n 's/\s*"main"\s*:\s*"\(.*\)".*/\1/p' package.json)

if [ -n "$package_json_start" ]; then
start_command=$package_json_start
elif [ -n $package_json_main ]; then
start_command="node ."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

unset package_json_main
if [ -n $package_json_main ]; then
  echo "unquoted check => true (bug)"
else
  echo "unquoted check => false"
fi

if [ -n "$package_json_main" ]; then
  echo "quoted check => true"
else
  echo "quoted check => false (expected)"
fi

bash -c 'set -e; sed -n "s/.*/x/p" package.json; echo "still running"' 2>/dev/null || \
  echo "missing package.json causes non-zero path under set -e"

Repository: sclorg/s2i-nodejs-container

Length of output: 126


🏁 Script executed:

cat -n src/s2i/bin/run | head -50

Repository: sclorg/s2i-nodejs-container

Length of output: 2147


🏁 Script executed:

#!/bin/bash
set -e

echo "=== Testing unquoted [ -n \$var ] without set -u ==="
unset package_json_main
if [ -n $package_json_main ]; then
  echo "unquoted empty var => true"
else
  echo "unquoted empty var => false (correct)"
fi

echo ""
echo "=== Testing sed on missing file under set -e ==="
bash -c 'set -e; sed -n "s/.*/x/p" nonexistent.json; echo "still running"' 2>&1 || \
  echo "FAILED: script exited due to sed failure (as expected)"

echo ""
echo "=== Verifying lines 34-37 logic ==="
# Simulate the scenario
package_json_start=""
package_json_main=""

echo "package_json_start='$package_json_start'"
echo "package_json_main='$package_json_main'"

if [ -n "$package_json_start" ]; then
  echo "Result: uses package_json_start"
elif [ -n $package_json_main ]; then
  echo "Result: uses package_json_main (node .)"
else
  echo "Result: falls through to other checks"
fi

Repository: sclorg/s2i-nodejs-container

Length of output: 435


Startup command detection fails when package_json_main is empty, and script exits if package.json is missing.

Line 36 uses [ -n $package_json_main ] unquoted. When the variable is empty, this expands to [ -n ], which evaluates to true because it tests whether the string "-n" itself is non-empty—incorrectly forcing start_command="node .". Additionally, lines 31–32 execute sed on package.json without checking file existence first, so a missing file will cause the script to exit under set -e.

Proposed fix
-    package_json_start=$(sed -n 's/\s*"start"\s*:\s*"\(.*\)".*/\1/p' package.json)
-    package_json_main=$(sed -n 's/\s*"main"\s*:\s*"\(.*\)".*/\1/p' package.json)
+    package_json_start=""
+    package_json_main=""
+    if [ -f "package.json" ]; then
+      package_json_start=$(sed -n 's/[[:space:]]*"start"[[:space:]]*:[[:space:]]*"\(.*\)".*/\1/p' package.json)
+      package_json_main=$(sed -n 's/[[:space:]]*"main"[[:space:]]*:[[:space:]]*"\(.*\)".*/\1/p' package.json)
+    fi
@@
-    elif [ -n $package_json_main ]; then
+    elif [ -n "$package_json_main" ]; then
       start_command="node ."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
package_json_start=$(sed -n 's/\s*"start"\s*:\s*"\(.*\)".*/\1/p' package.json)
package_json_main=$(sed -n 's/\s*"main"\s*:\s*"\(.*\)".*/\1/p' package.json)
if [ -n "$package_json_start" ]; then
start_command=$package_json_start
elif [ -n $package_json_main ]; then
start_command="node ."
package_json_start=""
package_json_main=""
if [ -f "package.json" ]; then
package_json_start=$(sed -n 's/[[:space:]]*"start"[[:space:]]*:[[:space:]]*"\(.*\)".*/\1/p' package.json)
package_json_main=$(sed -n 's/[[:space:]]*"main"[[:space:]]*:[[:space:]]*"\(.*\)".*/\1/p' package.json)
fi
if [ -n "$package_json_start" ]; then
start_command=$package_json_start
elif [ -n "$package_json_main" ]; then
start_command="node ."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/s2i/bin/run` around lines 31 - 37, The startup command detection has two
issues: First, on line 36, the condition `[ -n $package_json_main ]` uses an
unquoted variable, which when empty expands to `[ -n ]` and evaluates to true
incorrectly—add quotes around the variable to properly check if it is non-empty.
Second, lines 31-32 execute sed commands on package.json without verifying the
file exists first, which will cause the script to exit under set -e if the file
is missing—add a file existence check before the sed commands that read the
package.json file to ensure the script handles missing package.json gracefully.

@phracek phracek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Last round. Now it looks really awesome.

Comment thread src/Dockerfile Outdated
Comment thread src/Dockerfile Outdated
@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

[test]

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (2)
src/README.md (1)

29-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fix Markdown lint violations in the source templates.

The same generated-formatting issues appear in both files.

  • src/README.md#L29-L34: add fence languages and normalize heading formatting throughout the template.
  • src/README.minimal.md#L36-L61: apply the same changes, then regenerate artifacts.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/README.md` around lines 29 - 34, Fix Markdown linting in both source
templates: update src/README.md lines 29-34 and src/README.minimal.md lines
36-61 by adding appropriate languages to fenced code blocks and normalizing
heading formatting throughout each template, then regenerate the derived
artifacts.

Source: Linters/SAST tools

src/Dockerfile (1)

72-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify script path targeting.

Since $STI_SCRIPTS_PATH correctly resolves to /usr/libexec/s2i in the utilized S2I core bases, you can simplify the template by referencing the environment variable unconditionally.

♻️ Proposed refactor
-RUN chmod +x {% if spec.version == "20" %}$STI_SCRIPTS_PATH/init-wrapper{% else %}/usr/libexec/s2i/init-wrapper{% endif %}
+RUN chmod +x $STI_SCRIPTS_PATH/init-wrapper
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Dockerfile` at line 72, Update the init-wrapper chmod command to use
$STI_SCRIPTS_PATH/init-wrapper unconditionally, removing the spec.version
conditional while preserving the existing executable-permission step.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@specs/multispec-npm-config.yml`:
- Around line 64-65: Update the full_image_name configuration for rhel10 to
append the :latest tag, matching the tag format used by the other image
configurations while leaving img_name unchanged.

In `@src/Dockerfile`:
- Around line 56-58: Update the conditional removal commands in the Node.js
symlink setup to use force removal, replacing each relevant rm invocation for
node, npm, and npx with rm -f so builds continue when the unversioned binaries
are absent.
- Around line 65-68: Move the spec.post_install hook into the preceding RUN
command before the package-manager clean all operation, preserving valid command
chaining and avoiding a standalone RUN block ending with && \. Remove the
separate RUN {{ spec.post_install }} block while keeping the existing
conditional behavior for configurations without post_install.

In `@src/README.md`:
- Around line 289-296: Update the custom-command examples in src/README.md lines
289-296 and src/README.minimal.md lines 361-368 to use INIT_WRAPPER=true in both
container build and container start commands, preserving the documented
init-wrapper usage.
- Around line 191-194: Correct both Podman development-mode examples by adding
the missing --env option before DEBUG_PORT=5454 in src/README.md lines 191-194
and src/README.minimal.md lines 263-266, ensuring both commands set DEBUG_PORT
correctly.
- Around line 227-250: Fix the package.json examples in src/README.md lines
227-250 and src/README.minimal.md lines 299-322 by removing the inline
annotations and trailing commas, or change both fenced blocks to jsonc
consistently so the examples are valid as documented.

---

Nitpick comments:
In `@src/Dockerfile`:
- Line 72: Update the init-wrapper chmod command to use
$STI_SCRIPTS_PATH/init-wrapper unconditionally, removing the spec.version
conditional while preserving the existing executable-permission step.

In `@src/README.md`:
- Around line 29-34: Fix Markdown linting in both source templates: update
src/README.md lines 29-34 and src/README.minimal.md lines 36-61 by adding
appropriate languages to fenced code blocks and normalizing heading formatting
throughout each template, then regenerate the derived artifacts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 326e8a59-ae2a-4781-97e8-e72da2fe3747

📥 Commits

Reviewing files that changed from the base of the PR and between dc26e09 and 447bf9f.

📒 Files selected for processing (45)
  • 22-minimal/.exclude-c8s
  • 22-minimal/.exclude-c9s
  • 22-minimal/.exclude-fedora
  • 22-minimal/Dockerfile.c8s
  • 22-minimal/s2i/bin/init-wrapper
  • 22-minimal/s2i/bin/run
  • 22/.exclude-c8s
  • 22/.exclude-c9s
  • 22/.exclude-fedora
  • 22/Dockerfile.rhel8
  • 22/Dockerfile.rhel9
  • 22/s2i/bin/init-wrapper
  • 22/s2i/bin/run
  • 22/test
  • 24-minimal/.exclude-c8s
  • 24-minimal/.exclude-rhel8
  • 24-minimal/Dockerfile.c8s
  • 24-minimal/s2i/bin/init-wrapper
  • 24-minimal/s2i/bin/run
  • 24/.exclude-c8s
  • 24/.exclude-rhel8
  • 24/Dockerfile.c8s
  • 24/Dockerfile.rhel8
  • 24/Dockerfile.rhel9
  • 24/s2i/bin/init-wrapper
  • 24/s2i/bin/run
  • 24/test
  • README.md
  • manifest-minimal.yml
  • manifest.yml
  • specs/multispec-npm-config.yml
  • specs/multispec.yml
  • src/Dockerfile
  • src/README.md
  • src/README.minimal.md
  • src/root/opt/app-root/etc/generate_container_user
  • src/root/opt/app-root/etc/npm_global_module_list
  • src/root/opt/app-root/etc/scl_enable
  • src/root/usr/bin/fix-permissions
  • src/s2i/bin/assemble
  • src/s2i/bin/init-wrapper
  • src/s2i/bin/run
  • src/s2i/bin/run-minimal
  • src/s2i/bin/save-artifacts
  • src/s2i/bin/usage
💤 Files with no reviewable changes (3)
  • 24-minimal/Dockerfile.c8s
  • 24/Dockerfile.c8s
  • 22-minimal/Dockerfile.c8s
🚧 Files skipped from review as they are similar to previous changes (24)
  • 24/test
  • 24-minimal/s2i/bin/run
  • 22/s2i/bin/run
  • src/s2i/bin/init-wrapper
  • 22/Dockerfile.rhel9
  • src/s2i/bin/save-artifacts
  • 22/Dockerfile.rhel8
  • 22/test
  • 24/Dockerfile.rhel9
  • manifest.yml
  • 24/Dockerfile.rhel8
  • 22-minimal/s2i/bin/run
  • src/root/opt/app-root/etc/npm_global_module_list
  • src/root/opt/app-root/etc/scl_enable
  • src/root/usr/bin/fix-permissions
  • src/s2i/bin/usage
  • src/s2i/bin/run
  • README.md
  • manifest-minimal.yml
  • src/s2i/bin/assemble
  • 24/s2i/bin/run
  • src/s2i/bin/run-minimal
  • specs/multispec.yml
  • src/root/opt/app-root/etc/generate_container_user

Comment on lines +64 to +65
img_name: "ubi10/$NAME-$NODEJS_VERSION"
full_image_name: "ubi10/$NAME-$NODEJS_VERSION"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the missing :latest tag to the full image name.

The full_image_name for rhel10 is missing the :latest tag, unlike rhel8, rhel9, c9s, and c10s. This causes a divergence in the generated usage label in the Dockerfile.

💚 Proposed fix
       img_name: "ubi10/$NAME-$NODEJS_VERSION"
-      full_image_name: "ubi10/$NAME-$NODEJS_VERSION"
+      full_image_name: "ubi10/$NAME-$NODEJS_VERSION:latest"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
img_name: "ubi10/$NAME-$NODEJS_VERSION"
full_image_name: "ubi10/$NAME-$NODEJS_VERSION"
img_name: "ubi10/$NAME-$NODEJS_VERSION"
full_image_name: "ubi10/$NAME-$NODEJS_VERSION:latest"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@specs/multispec-npm-config.yml` around lines 64 - 65, Update the
full_image_name configuration for rhel10 to append the :latest tag, matching the
tag format used by the other image configurations while leaving img_name
unchanged.

Comment thread src/Dockerfile
Comment thread src/Dockerfile Outdated
Comment thread src/README.md
Comment on lines +191 to +194
To run the container in development mode with a debug port of 5454, run:
```
$ podman run --env DEV_MODE=true DEBUG_PORT=5454 my-image-id
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the Podman environment-variable examples.

Both templates omit --env for DEBUG_PORT, so the documented command does not set the variable.

  • src/README.md#L191-L194: change DEBUG_PORT=5454 to --env DEBUG_PORT=5454.
  • src/README.minimal.md#L263-L266: change DEBUG_PORT=5454 to --env DEBUG_PORT=5454.
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 192-192: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 193-193: Dollar signs used before commands without showing output

(MD014, commands-show-output)

📍 Affects 2 files
  • src/README.md#L191-L194 (this comment)
  • src/README.minimal.md#L263-L266
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/README.md` around lines 191 - 194, Correct both Podman development-mode
examples by adding the missing --env option before DEBUG_PORT=5454 in
src/README.md lines 191-194 and src/README.minimal.md lines 263-266, ensuring
both commands set DEBUG_PORT correctly.

Comment thread src/README.md
Comment on lines +227 to +250
```json
{
"name": "node-echo",
"version": "0.0.1",
"description": "node-echo",
"main": "example.js", <--- main attribute
"dependencies": {
},
"devDependencies": {
"nodemon": "*"
},
"engine": {
"node": "*",
"npm": "*"
},
"scripts": {
"dev": "nodemon --ignore node_modules/ server.js",
"start": "node server.js" <-- start script
},
"keywords": [
"Echo"
],
"license": "",
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the invalid package.json examples.

Both fenced examples contain non-JSON annotations and trailing commas.

  • src/README.md#L227-L250: remove the inline annotations/trailing comma or mark the block as jsonc.
  • src/README.minimal.md#L299-L322: apply the same correction.
📍 Affects 2 files
  • src/README.md#L227-L250 (this comment)
  • src/README.minimal.md#L299-L322
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/README.md` around lines 227 - 250, Fix the package.json examples in
src/README.md lines 227-250 and src/README.minimal.md lines 299-322 by removing
the inline annotations and trailing commas, or change both fenced blocks to
jsonc consistently so the examples are valid as documented.

Comment thread src/README.md
- Clean, readable template using universal variables
- Uses {{ spec.build_deps }} and {{ spec.pkgs }} instead of complex conditionals
- MariaDB-style consolidated RUN instruction
- Removed redundant comment blocks for better readability
- Universal variables with readable multiline formatting
- Version-specific pkgs and build_deps using clean Jinja2 conditionals
- Eliminates need for complex logic in Dockerfile templates
- Maintains all distro-specific package requirements
Remove c8s files and configurations from the project.
Regenerate README.md with updated version table.
@tjuhaszrh

Copy link
Copy Markdown
Contributor Author

[test]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants