Skip to content

DOCPLAN-400: Convert ifeval to ifdef for DITA compatibility - #952

Open
danielclowers wants to merge 1 commit into
kubev2v:mainfrom
danielclowers:worktree-docplan-400-ifeval-fix
Open

DOCPLAN-400: Convert ifeval to ifdef for DITA compatibility#952
danielclowers wants to merge 1 commit into
kubev2v:mainfrom
danielclowers:worktree-docplan-400-ifeval-fix

Conversation

@danielclowers

@danielclowers danielclowers commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Version(s):
NA

Issue:
https://issues.redhat.com/browse/DOCPLAN-400

Link to docs preview:

QE review:

  • QE has approved this change.

Additional information:
Converts ifeval::["{build}" == "value"] to ifdef::value[] for DITA compatibility. Adds :upstream: and :downstream: standalone attributes following existing conditional patterns (ifdef::web[], ifdef::vmware[], etc.). Addresses 7 ConditionalCode warnings flagged by Vale AsciiDocDITA rules as part of CQA 2.0 pre-migration review.

Summary by CodeRabbit

  • New Features

    • Added build-specific documentation flags for upstream and downstream content.
    • Documentation now shows the appropriate installation and upgrade guidance based on the selected build path.
  • Bug Fixes

    • Improved conditional content handling so operator install details and upgrade links display the correct environment-specific information.

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
forklift-documentation Ready Ready Preview, Comment Jul 7, 2026 3:57pm

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces new :upstream: and :downstream: AsciiDoc attributes and migrates conditional content blocks in installation and upgrade documentation modules from {build}-based ifeval checks to ifdef::upstream[]/ifdef::downstream[] conditionals.

Changes

Upstream/downstream attribute-based conditionals

Layer / File(s) Summary
New attribute definitions
documentation/modules/common-attributes.adoc, documentation/upstream-attributes.adoc
Adds :downstream: and :upstream: AsciiDoc attributes used by conditional blocks elsewhere in the docs.
Installation procedure conditionals
documentation/modules/proc_installing-mtv-operator.adoc
Replaces {build}-based ifeval checks with ifdef::upstream[]/ifdef::downstream[] for the Community Operator note and the Subscription manifest source/CSV values.
Upgrade procedure conditionals
documentation/modules/proc_upgrading-mtv-ui.adoc
Wraps upstream-specific link references for changing update channel and approving pending upgrades with ifdef::upstream[]/ifdef::downstream[] blocks.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • kubev2v/forklift-documentation#915: Introduces the Makefile ATTRS_UPSTREAM/ATTRS_DOWNSTREAM build attribute sets that correspond to the :upstream:/:downstream: attributes and conditionals added in this PR.

Suggested reviewers: anarnold97, solenoci

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: replacing ifeval with ifdef to improve DITA compatibility.
✨ 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: 1

🤖 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 `@documentation/modules/common-attributes.adoc`:
- Line 48: The shared attribute definition is making downstream-only content
render in upstream builds as well. Remove the unconditional :downstream: setting
from common-attributes and set it only from a downstream-specific include or
build argument; this keeps the ifdef::downstream[] sections in the install and
upgrade docs mutually exclusive. Use the downstream attribute handling around
common-attributes and the install/upgrade procedure docs as the key places to
adjust.
🪄 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: 3e75a104-87cf-4b1f-928f-21f19cf57dfb

📥 Commits

Reviewing files that changed from the base of the PR and between e8a3400 and 4875d2c.

📒 Files selected for processing (4)
  • documentation/modules/common-attributes.adoc
  • documentation/modules/proc_installing-mtv-operator.adoc
  • documentation/modules/proc_upgrading-mtv-ui.adoc
  • documentation/upstream-attributes.adoc

// doc metadata
:icons: font
:build: downstream
:downstream:

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 | 🟠 Major | ⚡ Quick win

Scope :downstream: to downstream-only builds.

Defining :downstream: in the shared attributes file makes it true for upstream renders as well, because both master docs include this file unconditionally. That will cause the new ifdef::downstream[] blocks in the install/upgrade procedures to render alongside the upstream content instead of staying mutually exclusive.

♻️ Suggested fix
-:downstream:

Set the attribute from a downstream-only include or build arg instead.

📝 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
:downstream:
🤖 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 `@documentation/modules/common-attributes.adoc` at line 48, The shared
attribute definition is making downstream-only content render in upstream builds
as well. Remove the unconditional :downstream: setting from common-attributes
and set it only from a downstream-specific include or build argument; this keeps
the ifdef::downstream[] sections in the install and upgrade docs mutually
exclusive. Use the downstream attribute handling around common-attributes and
the install/upgrade procedure docs as the key places to adjust.

Replace ifeval::["{build}" == "value"] with ifdef::value[] to improve
DITA conversion compatibility. This follows the existing conditional
pattern used for ifdef::web[], ifdef::vmware[], etc.

Changes:
- Add :upstream: and :downstream: standalone attributes in attribute files
- Convert all ifeval statements to ifdef in proc_installing-mtv-operator.adoc
- Convert all ifeval statements to ifdef in proc_upgrading-mtv-ui.adoc

This addresses the 7 ConditionalCode warnings flagged by Vale's
AsciiDocDITA rules as part of the CQA 2.0 pre-migration review.

Signed-off-by: danielclowers <dclowers@redhat.com>
@yaacov

yaacov commented Jul 8, 2026

Copy link
Copy Markdown
Member

lgtm

@danielclowers

Copy link
Copy Markdown
Collaborator Author

Holding on this PR pending the discussion about upstream/downstream strategy. If we're removing upstream conditionals entirely (per Andy's email), this approach would change. Happy to update once direction is clear 👍

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