Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Update thymeleaf email templates #10114

Merged
merged 5 commits into from
Jan 12, 2025

Conversation

krusche
Copy link
Member

@krusche krusche commented Jan 7, 2025

Checklist

General

Server

Motivation and Context

Sending emails leads to deprecation warnings, e.g.
Jan 07 18:48:50 artemis-production-node8.artemis.in.tum.de java[3847328]: 2025-01-07T18:48:50.080+01:00 WARN 3847328 --- [Artemis] [ artemis-task-1] actStandardFragmentInsertionTagProcessor : [THYMELEAF][artemis-task-1][mail/notification/announcementPostEmail] Deprecated unwrapped fragment expression "mail/notification/fragments :: head" found in template mail/notification/announcementPostEmail, line 3, col 11. Please use the complete syntax of fragment expressions instead ("~{mail/notification/fragments :: head}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf.

Description

I updated all email templates and while doing that also updated the URLs of the main TUM artemis instance

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Create an announcement
  2. Make sure you receive the email and it looks correct
  3. Make sure there are no warnings or errors in the logs

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated URLs from artemis.cit.tum.de to artemis.tum.de across multiple documentation files, including user guides, registration documentation, and mobile application server selection.
    • Updated documentation for Orion settings.
  • Configuration

    • Modified email template fragment references to use new Thymeleaf syntax across various email templates.
  • Test Updates

    • Adjusted test cases to reflect new base URL in various test files.
  • Frontend

    • Updated About Us component URL for the IRIS section.

No functional changes were introduced in this release.

@krusche krusche requested a review from a team as a code owner January 7, 2025 17:58
@krusche krusche added this to the 7.8.3 milestone Jan 7, 2025
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) documentation template programming Pull requests that affect the corresponding module labels Jan 7, 2025
Copy link

coderabbitai bot commented Jan 7, 2025

Walkthrough

The pull request involves a comprehensive update of URLs across multiple files in the Artemis project. The primary change is the replacement of the base URL from https://artemis.cit.tum.de to https://artemis.tum.de, affecting documentation, email templates, configuration files, test cases, and frontend components. This modification appears to be a domain restructuring or rebranding effort, ensuring consistent URL references throughout the project.

Changes

File/Path Change Summary
README.md Updated URLs for Technical University of Munich
docs/admin/registration.rst Modified mail service base URL
docs/user/mobile-applications.rst Updated server selection URLs for Android and iOS
docs/user/orion.rst Updated Artemis base and git URLs
src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/LocalVCRepositoryUri.java Updated documentation comments with new base URL examples
Multiple email templates in src/main/resources/templates/mail/ Updated Thymeleaf fragment reference syntax and URLs
src/main/webapp/app/core/about-us/about-us.component.ts Updated 'iris' section URL
src/test/java/de/tum/cit/aet/artemis/programming/icl/RepositoryUriTest.java Updated URLs in test cases and assertions
src/test/javascript/spec/service/external-cloning.service.spec.ts Updated baseUrl and expectedUrl in test cases

Suggested Labels

small, bugfix, chore

Suggested Reviewers

  • BBesrour
  • JohannesStoehr
  • SimonEntholzer
  • florian-glombik
  • HawKhiem
  • Malekos74

Possibly Related PRs


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3592c3 and 2cf36df.

📒 Files selected for processing (1)
  • src/test/javascript/spec/service/external-cloning.service.spec.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/javascript/spec/service/external-cloning.service.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse

Finishing Touches

  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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 (2)
src/main/resources/templates/mail/notification/exerciseOpenForPracticeEmail.html (1)

18-18: Consider using th:replace for consistency

While both th:include and th:replace are valid, consider using th:replace consistently across all fragment references for better maintainability. The template currently uses th:include only for the difficulty translation fragment.

-                <li th:include="~{mail/notification/fragments :: difficultyTranslation}"/>
+                <li th:replace="~{mail/notification/fragments :: difficultyTranslation}"/>
README.md (1)

245-245: Update URL format to follow markdown best practices.

While the URL has been correctly updated to artemis.tum.de, it should be formatted as a proper markdown link to comply with markdown best practices.

-  https://artemis.tum.de  
+  [https://artemis.tum.de](https://artemis.tum.de)  
🧰 Tools
🪛 Markdownlint (0.37.0)

245-245: null
Bare URL used

(MD034, no-bare-urls)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1798b25 and 832f206.

📒 Files selected for processing (26)
  • README.md (3 hunks)
  • docs/admin/registration.rst (1 hunks)
  • docs/user/mobile-applications.rst (2 hunks)
  • docs/user/orion.rst (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/LocalVCRepositoryUri.java (2 hunks)
  • src/main/resources/templates/mail/dataExportFailedAdminEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/announcementPostEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/attachmentChangedEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/dataExportCreatedEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/dataExportFailedEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/duplicateTestCasesEmail.html (2 hunks)
  • src/main/resources/templates/mail/notification/exerciseOpenForPracticeEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/exerciseReleasedEmail.html (2 hunks)
  • src/main/resources/templates/mail/notification/exerciseSubmissionAssessedEmail.html (2 hunks)
  • src/main/resources/templates/mail/notification/fileSubmissionSuccessfulEmail.html (2 hunks)
  • src/main/resources/templates/mail/notification/fragments.html (6 hunks)
  • src/main/resources/templates/mail/notification/plagiarismCaseEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/plagiarismVerdictEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/tutorialGroupBasicEmail.html (2 hunks)
  • src/main/resources/templates/mail/notification/tutorialGroupDeletedEmail.html (1 hunks)
  • src/main/resources/templates/mail/notification/tutorialGroupUpdatedEmail.html (1 hunks)
  • src/main/resources/templates/mail/successfulDataExportsAdminEmail.html (1 hunks)
  • src/main/resources/templates/mail/weeklySummary.html (2 hunks)
  • src/main/webapp/app/core/about-us/about-us.component.ts (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/RepositoryUriTest.java (5 hunks)
  • src/test/javascript/spec/service/external-cloning.service.spec.ts (2 hunks)
✅ Files skipped from review due to trivial changes (21)
  • docs/admin/registration.rst
  • src/main/resources/templates/mail/notification/tutorialGroupUpdatedEmail.html
  • src/main/resources/templates/mail/notification/exerciseSubmissionAssessedEmail.html
  • src/main/resources/templates/mail/notification/dataExportCreatedEmail.html
  • src/main/resources/templates/mail/notification/exerciseReleasedEmail.html
  • src/main/resources/templates/mail/notification/attachmentChangedEmail.html
  • src/main/resources/templates/mail/notification/tutorialGroupBasicEmail.html
  • src/main/resources/templates/mail/notification/fileSubmissionSuccessfulEmail.html
  • src/main/resources/templates/mail/notification/plagiarismVerdictEmail.html
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/RepositoryUriTest.java
  • src/main/resources/templates/mail/notification/tutorialGroupDeletedEmail.html
  • docs/user/orion.rst
  • src/main/webapp/app/core/about-us/about-us.component.ts
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/LocalVCRepositoryUri.java
  • src/main/resources/templates/mail/notification/plagiarismCaseEmail.html
  • src/main/resources/templates/mail/notification/announcementPostEmail.html
  • docs/user/mobile-applications.rst
  • src/main/resources/templates/mail/dataExportFailedAdminEmail.html
  • src/main/resources/templates/mail/successfulDataExportsAdminEmail.html
  • src/main/resources/templates/mail/notification/duplicateTestCasesEmail.html
  • src/main/resources/templates/mail/weeklySummary.html
🧰 Additional context used
📓 Path-based instructions (1)
src/test/javascript/spec/service/external-cloning.service.spec.ts (1)

Pattern src/test/javascript/spec/**/*.ts: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}

🪛 Markdownlint (0.37.0)
README.md

245-245: null
Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse
  • GitHub Check: Build and Push Docker Image
  • GitHub Check: Build .war artifact
🔇 Additional comments (7)
src/main/resources/templates/mail/notification/dataExportFailedEmail.html (1)

3-3: Fragment syntax updates look good!

The Thymeleaf fragment expressions have been correctly updated to use the new syntax with tilde notation (~{...}). This change addresses the deprecation warnings and ensures future compatibility.

Also applies to: 5-5, 8-8, 10-10, 13-13

src/main/resources/templates/mail/notification/exerciseOpenForPracticeEmail.html (2)

3-3: Fragment syntax updates look good!

The Thymeleaf fragment expressions have been correctly updated to use the new syntax with tilde notation (~{...}). This change addresses the deprecation warnings and ensures future compatibility.

Also applies to: 5-5, 8-8, 10-10, 18-18, 21-21, 23-23, 26-26


1-1: Verify fragment syntax across all templates

Let's ensure all Thymeleaf templates have been updated to use the new fragment syntax.

✅ Verification successful

All templates use correct fragment syntax ✓

No unwrapped fragment expressions found across all 22 email templates, confirming consistent usage of the new syntax.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining unwrapped fragment expressions in Thymeleaf templates

# Search for potential unwrapped fragment expressions (negative patterns)
echo "Checking for unwrapped fragment expressions..."
rg -t html 'th:(replace|include)="[^~]' src/main/resources/templates/

# Verify all templates under mail directory have been checked
echo "Listing all email templates for verification..."
find src/main/resources/templates/mail -name "*.html" -type f

Length of output: 1895

src/test/javascript/spec/service/external-cloning.service.spec.ts (1)

6-6: LGTM! URL updates are consistent.

The changes correctly update the test URLs from artemis.cit.tum.de to artemis.tum.de, maintaining test functionality while reflecting the new domain structure.

Also applies to: 15-15

src/main/resources/templates/mail/notification/fragments.html (3)

8-9: LGTM! Fragment syntax updated correctly.

The fragment references now use the complete ~{} syntax as required by newer Thymeleaf versions, addressing the deprecation warnings mentioned in the PR objectives.


145-145: LGTM! Logo URL updated consistently.

The logo URL has been updated from artemis.cit.tum.de to artemis.tum.de, maintaining consistency with the domain changes.


17-130: CSS styles are well-organized and maintainable.

The CSS section is properly structured with clear comments and logical grouping of styles. The styles provide consistent formatting for email notifications.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 7, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 7, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 8, 2025
@HawKhiem HawKhiem temporarily deployed to artemis-test3.artemis.cit.tum.de January 9, 2025 12:12 — with GitHub Actions Inactive
HawKhiem
HawKhiem previously approved these changes Jan 9, 2025
Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

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

Tested on TS3. Works as described

image

ahbitaqu
ahbitaqu previously approved these changes Jan 9, 2025
Copy link

@ahbitaqu ahbitaqu left a comment

Choose a reason for hiding this comment

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

[Tested on TS3]

Works flawlessly. Couldn't confirm with the logs though

@krusche krusche dismissed stale reviews from ahbitaqu, HawKhiem, and coderabbitai[bot] via 2cf36df January 9, 2025 18:35
Copy link

@vinceclifford vinceclifford left a comment

Choose a reason for hiding this comment

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

Works as expected.

Copy link

@sawys777 sawys777 left a comment

Choose a reason for hiding this comment

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

Tested on TS1, everything works as expected

@krusche krusche merged commit 031c0bf into develop Jan 12, 2025
40 of 43 checks passed
@krusche krusche deleted the chore/update-email-templates branch January 12, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) documentation programming Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!) template tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

6 participants