Skip to content

Add support for coping <version>/*.md files to / container#422

Merged
phracek merged 2 commits intomasterfrom
copy_md_files
Mar 18, 2026
Merged

Add support for coping <version>/*.md files to / container#422
phracek merged 2 commits intomasterfrom
copy_md_files

Conversation

@phracek
Copy link
Member

@phracek phracek commented Mar 17, 2026

Add support for coping /*.md files

to /root directory.

After sync to GitLab we have MD files present
in each image.

Relevant issue https://redhat.atlassian.net/browse/RHELMISC-27557

The output looks like, in case in directory are more MD files:

$ make build TARGET=rhel9 SINGLE_VERSION=1.26
make[1]: Entering directory '/root/nginx-container'
1.20/README.md	1.20/SEE_ALSO.md  1.20/USAGE.md
'1.20/README.md' -> '1.20/root/README.md'
'1.20/SEE_ALSO.md' -> '1.20/root/SEE_ALSO.md'
'1.20/USAGE.md' -> '1.20/root/USAGE.md'
1.22/README.md
'1.22/README.md' -> '1.22/root/README.md'
1.22-micro/README.md
'1.22-micro/README.md' -> '1.22-micro/root/README.md'
1.24/README.md
'1.24/README.md' -> '1.24/root/README.md'
1.26/README.md
'1.26/README.md' -> '1.26/root/README.md'
VERSION="1.20" SKIP_SQUASH=1 OS=rhel9 CLEAN_AFTER= DOCKER_BUILD_CONTEXT=.. OPENSHIFT_NAMESPACES="" CUSTOM_REPO="" REGISTRY="""" /usr/bin/env bash common/build.sh

Summary by CodeRabbit

  • Chores
    • Documentation Markdown files are copied into each version's root directory during the build.
    • Per-version builds now wait for those documentation files to be copied before running.
    • Cleanup now removes the copied Markdown files as part of the standard clean step.

@phracek
Copy link
Member Author

phracek commented Mar 17, 2026

[test]

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

Adds Make targets to copy and remove per-version Markdown files into each version's root directory, makes $(VERSIONS) depend on the copy step, and updates clean to remove the copied Markdown files during cleanup. (<=50 words)

Changes

Cohort / File(s) Summary
Build Configuration
common.mk
Added copy_md_files (creates $(version)/root, copies $(version)/*.md into it, sets read perms) and remove_md_files targets; made $(VERSIONS) depend on copy_md_files; updated clean to depend on remove_md_files and clean-images.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • pkhartsk

Poem

🐇 I hop through folders, swift and spry,
Copying Markdown as versions fly.
Roots fill with notes, neat and bright,
Clean removes them when day turns night. ✨📄

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title contains a typo ('coping' instead of 'copying') and is partially related to the change, referring to a real aspect but with unclear phrasing. Correct the typo from 'coping' to 'copying' for clarity: 'Add support for copying /*.md files to /root container'
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copy_md_files
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@phracek
Copy link
Member Author

phracek commented Mar 17, 2026

During the our weekly call, we have discovered that container misses /root/help.1 file and readmes are not present as well.
This pull request should fix it.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
common.mk (1)

85-86: Missing .PHONY declaration for copy_md_files target.

The copy_md_files target should be declared as .PHONY to ensure it always runs regardless of whether a file with that name exists. This is consistent with how other non-file-producing targets in this Makefile are declared.

♻️ Proposed fix

Add copy_md_files to an existing .PHONY declaration or create a new one before the target:

+.PHONY: copy_md_files
 # Copy also all .md files from version directory to the root of
 # container images, so that they are available in the image
 # Currently there is only README.md, but there may be more in the future
 copy_md_files:

Also applies to: 142-146

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@common.mk` around lines 85 - 86, Add a .PHONY declaration for the
copy_md_files target so it always runs (e.g., include copy_md_files in the
existing .PHONY list or add a new `.PHONY: copy_md_files` near the top); update
the Makefile so the copy_md_files target (referenced by the rule for
$(VERSIONS)) is declared phony to avoid skipping when a file named copy_md_files
exists.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@common.mk`:
- Around line 142-146: The copy_md_files Makefile rule is copying from the
project root (cp -v *.md) instead of from each version directory and will fail
if no .md files exist; update the loop in the copy_md_files target to cp from
the version directory (use cp -v "$$version"/*.md "$$version"/root/) and guard
the copy with a existence check such as ls "$$version"/*.md >/dev/null 2>&1 &&
cp -v "$$version"/*.md "$$version"/root/ so the command only runs when files
exist (refer to the copy_md_files target and the $$version variable in the
diff).

---

Nitpick comments:
In `@common.mk`:
- Around line 85-86: Add a .PHONY declaration for the copy_md_files target so it
always runs (e.g., include copy_md_files in the existing .PHONY list or add a
new `.PHONY: copy_md_files` near the top); update the Makefile so the
copy_md_files target (referenced by the rule for $(VERSIONS)) is declared phony
to avoid skipping when a file named copy_md_files exists.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37ea045f-1884-4900-82f7-d7b3c7196075

📥 Commits

Reviewing files that changed from the base of the PR and between 18f0075 and 02fb671.

📒 Files selected for processing (1)
  • common.mk

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed

to <version>/root directory.

After sync to GitLab we have MD files present
in each image.

Relevant issue https://redhat.atlassian.net/browse/RHELMISC-27557

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@phracek
Copy link
Member Author

phracek commented Mar 17, 2026

[test]

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
common.mk (1)

142-148: Add .PHONY declaration for copy_md_files.

The target produces no output file, so it should be declared .PHONY to match other similar targets in this file (e.g., build, test, clean). This ensures Make always runs it regardless of filesystem state.

♻️ Proposed fix
+.PHONY: copy_md_files
 copy_md_files:
 	`@for` version in $(VERSIONS); do \
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@common.mk` around lines 142 - 148, Add a .PHONY declaration for the Make
target copy_md_files so Make always runs it (like the existing .PHONY list for
build/test/clean); update the .PHONY line(s) to include copy_md_files
(referencing the target name copy_md_files) rather than leaving it as a
file-dependent target.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@common.mk`:
- Around line 142-148: Add a .PHONY declaration for the Make target
copy_md_files so Make always runs it (like the existing .PHONY list for
build/test/clean); update the .PHONY line(s) to include copy_md_files
(referencing the target name copy_md_files) rather than leaving it as a
file-dependent target.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d489d3d2-67f9-4efb-8c2d-c0e535460230

📥 Commits

Reviewing files that changed from the base of the PR and between 02fb671 and 16b15c5.

📒 Files selected for processing (1)
  • common.mk

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
RHEL8 - s2i-base-containerRHEL-8.10.0-Nightlyx86_64✅ passed17.03.2026 15:31:3518min 13stest pipeline
RHEL8 - s2i-perl-containerRHEL-8.10.0-Nightlyx86_64✅ passed17.03.2026 15:51:0927min 48stest pipeline
Fedora - nginx-containerFedora-latestx86_64✅ passed17.03.2026 15:41:1013min 14stest pipeline
Fedora - s2i-base-containerFedora-latestx86_64✅ passed17.03.2026 15:19:3512min 8stest pipeline
CentOS Stream 9 - nginx-containerCentOS-Stream-9x86_64✅ passed17.03.2026 15:30:4719min 11stest pipeline
RHEL10 - s2i-perl-containerRHEL-10-Nightlyx86_64✅ passed17.03.2026 15:18:5327min 38stest pipeline
CentOS Stream 9 - s2i-perl-containerCentOS-Stream-9x86_64✅ passed17.03.2026 15:35:1622min 24stest pipeline
RHEL10 - nginx-containerRHEL-10-Nightlyx86_64✅ passed17.03.2026 15:18:5318min 23stest pipeline
RHEL8 - postgresql-containerRHEL-8.10.0-Nightlyx86_64✅ passed17.03.2026 15:51:5840min 36stest pipeline
CentOS Stream 9 - s2i-base-containerCentOS-Stream-9x86_64✅ passed17.03.2026 15:47:1517min 9stest pipeline
RHEL9 - s2i-base-containerRHEL-9.6.0-Nightlyx86_64✅ passed17.03.2026 15:18:5821min 49stest pipeline
CentOS Stream 10 - nginx-containerCentOS-Stream-10x86_64✅ passed17.03.2026 15:18:5214min 46stest pipeline
RHEL10 - postgresql-containerRHEL-10-Nightlyx86_64✅ passed17.03.2026 15:18:5225min 4stest pipeline
RHEL9 - nginx-containerRHEL-9.6.0-Nightlyx86_64✅ passed17.03.2026 15:45:2125min 7stest pipeline
RHEL10 - s2i-python-containerRHEL-10-Nightlyx86_64✅ passed17.03.2026 15:18:5237min 30stest pipeline
CentOS Stream 10 - s2i-perl-containerCentOS-Stream-10x86_64✅ passed17.03.2026 15:43:1723min 46stest pipeline
CentOS Stream 9 - postgresql-containerCentOS-Stream-9x86_64✅ passed17.03.2026 15:39:1429min 17stest pipeline
RHEL9 - postgresql-containerRHEL-9.6.0-Nightlyx86_64✅ passed17.03.2026 15:59:3839min 35stest pipeline
CentOS Stream 10 - postgresql-containerCentOS-Stream-10x86_64✅ passed17.03.2026 15:18:5221min 14stest pipeline
RHEL10 - s2i-base-containerRHEL-10-Nightlyx86_64✅ passed17.03.2026 13:48:4416min 41stest pipeline
RHEL9 - s2i-perl-containerRHEL-9.6.0-Nightlyx86_64✅ passed17.03.2026 15:18:5429min 47stest pipeline
CentOS Stream 10 - s2i-base-containerCentOS-Stream-10x86_64✅ passed17.03.2026 15:41:1713min 37stest pipeline
RHEL8 - nginx-containerRHEL-8.10.0-Nightlyx86_64✅ passed17.03.2026 15:18:5221min 44stest pipeline
Fedora - s2i-python-containerFedora-latestx86_64✅ passed17.03.2026 15:57:131h 4min 39stest pipeline
Fedora - s2i-perl-containerFedora-latestx86_64✅ passed17.03.2026 15:33:5240min 13stest pipeline
CentOS Stream 10 - s2i-python-containerCentOS-Stream-10x86_64✅ passed17.03.2026 15:55:361h 9min 25stest pipeline
Fedora - postgresql-containerFedora-latestx86_64✅ passed17.03.2026 15:18:5323min 32stest pipeline
RHEL8 - s2i-python-containerRHEL-8.10.0-Nightlyx86_64✅ passed17.03.2026 15:55:281h 32min 44stest pipeline
CentOS Stream 9 - s2i-python-containerCentOS-Stream-9x86_64✅ passed17.03.2026 15:25:321h 49min 40stest pipeline
RHEL9 - s2i-python-containerRHEL-9.6.0-Nightlyx86_64✅ passed17.03.2026 15:41:231h 45min 12stest pipeline

Copy link
Contributor

@pkhartsk pkhartsk left a comment

Choose a reason for hiding this comment

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

Works for me when building postgresql-container locally

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@phracek
Copy link
Member Author

phracek commented Mar 17, 2026

[test]

@phracek
Copy link
Member Author

phracek commented Mar 18, 2026

@pkubatrh Added MD files removal. As soon as You are fine with it please Approve.

Copy link
Contributor

@pkhartsk pkhartsk left a comment

Choose a reason for hiding this comment

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

LGTM

@phracek phracek merged commit bf3bb46 into master Mar 18, 2026
35 checks passed
@phracek phracek deleted the copy_md_files branch March 18, 2026 09:26
phracek added a commit to sclorg/httpd-container that referenced this pull request Mar 18, 2026
deploying sclorg/container-common-scripts#422

The next step will be sync to GitLab repo and see,
whether README.md file will be present in GitLab repo
in `root` directory

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/httpd-container that referenced this pull request Mar 18, 2026
deploying sclorg/container-common-scripts#422

The next step will be sync to GitLab repo and see,
whether README.md file will be present in GitLab repo
in `root` directory

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/nginx-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/mariadb-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/mysql-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-ruby-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-perl-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/redis-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/valkey-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/varnish-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-base-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/postgresql-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-base-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/valkey-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/varnish-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/redis-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/mariadb-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/mysql-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-php-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-python-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-nodejs-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-python-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
phracek added a commit to sclorg/s2i-nodejs-container that referenced this pull request Mar 19, 2026
Deliver fix for copying version during the tests

sclorg/container-common-scripts#422

This is needed to have MD files in downstream GitLab repos

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
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.

3 participants