Skip to content

Conversation

alhambrav
Copy link
Member

Ticket reference or full description of what's in the PR

Update the notifications config article craftercms/craftercms#7557

Copy link
Member

@sumerjabri sumerjabri left a comment

Choose a reason for hiding this comment

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

Is this for v5.0.0? If so, we need to update the file to be last updated v5 and make this a draft PR.

@alhambrav alhambrav marked this pull request as draft June 5, 2025 14:17
Copy link

coderabbitai bot commented Sep 25, 2025

Summary by CodeRabbit

  • Documentation
    • Updated Studio reference to use notification-config.xml instead of notifications.xml throughout.
    • Expanded notification templates and examples, including deployment and schedule details and error scenarios.
    • Added collapsible details/summary sections to improve readability of configuration guidance and samples.
    • Refined captions, section text, and list entries for clarity and consistency.
    • Introduced additional sample content and structured HTML blocks to better organize explanations without changing configuration behavior.

Walkthrough

Revises Studio documentation to rename notifications configuration references from notifications.xml to notification-config.xml, restructures and expands notification templates and examples, and wraps added explanatory content in HTML details/summary blocks.

Changes

Cohort / File(s) Summary of changes
Docs: Studio notifications config and templates
source/reference/modules/studio.rst
Renamed file references to notification-config.xml; updated captions and list items; expanded examples and templates; added raw HTML details/summary wrappers for deployment, schedule, and error sections; reorganized content without changing configuration semantics.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly summarizes the main change to the notifications configuration article and includes a reference to the related issue, making it clear and specific enough for a teammate to understand the purpose at a glance.
Description Check ✅ Passed The pull request description follows the repository template by including the required ticket reference section with a clear link to the related issue and a concise summary of the change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
source/reference/modules/studio.rst (2)

2961-2973: Fix path in caption (same inconsistency as above)

Use workflow/notification-config.xml to match the default property and actual location.

-    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
+    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*

2984-3019: Fix path in caption (same inconsistency as above)

Align caption path with workflow/notification-config.xml.

-    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
+    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*
🧹 Nitpick comments (3)
source/reference/modules/studio.rst (3)

3077-3080: Verify variable naming/source consistency (reviewer/submitter fields)

This template mixes snake_case (first_name, last_name) and camelCase (elsewhere you use approver.firstName). If the backing model uses consistent keys, this will break.

Please confirm the actual variables passed to FTL in Studio 5.x and standardize (all camelCase or whatever Studio emits). Based on learnings


3097-3108: Good: schedule/target/reviewer comment surfaced; add variables to docs

You reference publishPackage.* fields not listed in “Template Variables.” Document these (packageType, schedule, target, reviewerComment, submitterComment, etc.) and new file.* fields (page, browserUri, action, path, packageId, liveError, stagingError).


3178-3216: Template variable consistency (reviewer. fields) and links look fine otherwise*

After fixing “&&”, please also verify reviewer.first_name/last_name names as above.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5600fe4 and 930f2a9.

📒 Files selected for processing (1)
  • source/reference/modules/studio.rst (12 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-02T20:40:32.613Z
Learnt from: alhambrav
PR: craftercms/docs#2042
File: source/reference/modules/studio.rst:0-0
Timestamp: 2025-09-02T20:40:32.613Z
Learning: When reviewing CrafterCMS Studio documentation, property names in configuration examples should match the actual Studio source code implementation, even if the underlying Git config keys are different. Studio may have a translation layer that maps Studio property names to actual Git configuration keys.

Applied to files:

  • source/reference/modules/studio.rst
🔇 Additional comments (8)
source/reference/modules/studio.rst (8)

2-2: Meta update looks good

Updated last-updated to 5.0.0 is consistent with the new content.


100-102: Good addition to the config properties index

New “Notification Service Configuration” entry improves discoverability.


105-105: Description reads well

Wording aligns with the section content below.


3023-3030: Nice use of collapsible details

The expandable block improves readability.


3051-3052: LGTM: clearer itemization of deployment failures

The extra details per file are helpful.


3067-3067: Subject logic: good conditional for scheduled vs approved

Looks correct.


3086-3095: Inline link around pages is correct

Conditional anchor wrapping by file.page is solid.


3267-3314: Great addition: Notification Service Configuration defaults

Section is clear and useful. Ensure the configuration file path here matches all captions above (workflow/notification-config.xml) to avoid user confusion.

Comment on lines +2883 to 2884
:caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix path: notification config location inconsistent with defaults

Captions point to config/studio/notification-config.xml but the default property below uses workflow/notification-config.xml. Align to workflow/… to prevent confusion.

Apply this diff:

-    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
+    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*

Also update the sentence above that references “Notification Configuration” if it implies the old path. Based on learnings

📝 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
:caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
:caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*
🤖 Prompt for AI Agents
In source/reference/modules/studio.rst around lines 2883-2884, the caption path
currently points to config/studio/notification-config.xml while the default
property and intended location use workflow/notification-config.xml; update the
caption line to use
*CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*
and also edit the nearby sentence above that references “Notification
Configuration” so its example/path text reflects the
workflow/notification-config.xml location to keep both descriptions consistent.

Comment on lines +3032 to 3034
:caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
:linenos:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix path in caption (same inconsistency as above)

Update to workflow/notification-config.xml.

-    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
+    :caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*
📝 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
:caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*
:linenos:
:caption: *CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*
:linenos:
🤖 Prompt for AI Agents
In source/reference/modules/studio.rst around lines 3032 to 3034 the :caption:
path is incorrect (it currently points to
*CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/notification-config.xml*);
update the caption to the correct path
*CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/workflow/notification-config.xml*
so it matches the intended location.

Comment on lines +3055 to +3058
<#if deploymentError?has_content>
Error:<br/>
<pre>${deploymentError}</pre>
</#if>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Prefer explicit string conversion for deploymentError

Earlier docs say deploymentError must be addressed via toString(); template uses ${deploymentError}. Make it explicit to avoid renderer surprises.

-                            <pre>${deploymentError}</pre>
+                            <pre>${deploymentError?string}</pre>

Alternatively: ${deploymentError.toString()}.

📝 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
<#if deploymentError?has_content>
Error:<br/>
<pre>${deploymentError}</pre>
</#if>
<#if deploymentError?has_content>
Error:<br/>
<pre>${deploymentError?string}</pre>
</#if>
🤖 Prompt for AI Agents
In source/reference/modules/studio.rst around lines 3055 to 3058, the template
directly interpolates ${deploymentError} but earlier docs require using
toString(); update the template to perform an explicit string conversion (e.g.,
call deploymentError.toString() or otherwise coerce to a string) before
rendering so the renderer receives a definite string and avoids surprises;
ensure you guard for null/undefined (call toString() only when deploymentError
is present) consistent with the surrounding has_content check.

<#else>
${submitter.first_name!submitter.username} ${submitter.last_name} has submitted items for your review:
</#if>
<#if files?? &amp;&amp; files?size gt 0>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix Freemarker operator inside CDATA: use &&, not &&

Inside you must use raw “&&”. The escaped form won’t be parsed by FTL.

-                           <#if files?? &amp;&amp; files?size gt 0>
+                           <#if files?? && files?size gt 0>
📝 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
<#if files?? &amp;&amp; files?size gt 0>
<#if files?? && files?size gt 0>
🤖 Prompt for AI Agents
In source/reference/modules/studio.rst around line 3131 the Freemarker
boolean-and operator is incorrectly escaped as "&amp;&amp;" inside a CDATA
block; replace the escaped sequence with the raw operator "&&" so Freemarker
will parse the condition correctly (i.e., change "&amp;&amp;" to "&&" within the
<![CDATA[ ]]> context).

<#else>
${reviewer.first_name!submitter.username} ${reviewer.last_name} has reviewed the following content that requires some revision before it can be approved:
</#if>
<#if files?? &amp;&amp; files?size gt 0>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix Freemarker operator inside CDATA here too

Same issue as above; switch to “&&”.

-                           <#if publishPackage.schedule??>
+                           <#if publishPackage.schedule??>

Note: And change:

-                           <#if files?? &amp;&amp; files?size gt 0>
+                           <#if files?? && files?size gt 0>

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In source/reference/modules/studio.rst around line 3185, the Freemarker logical
AND operator is HTML-escaped as "&amp;&amp;" inside the CDATA; replace the
escaped sequence with the literal "&&" so the conditional reads "<#if files?? &&
files?size gt 0>" (ensure it remains inside CDATA unescaped).

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