feat: Add Temporal Project Structure Rule documentation#27
feat: Add Temporal Project Structure Rule documentation#27anatolyshipitz merged 4 commits intomainfrom
Conversation
- Introduced a new markdown file defining the directory and documentation structure for Temporal-based workflows and workers. - Outlined project structure, shared utilities, documentation requirements, best practices, and enforcement rules for creating new Temporal workers. This addition enhances clarity and consistency in project organization for Temporal workflows.
📝 Walkthrough""" WalkthroughA new rule file, Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Repository
participant RuleFile
Developer->>Repository: Add new Temporal worker/workflow
Repository->>RuleFile: Validate structure and documentation
RuleFile-->>Repository: Enforce compliance (structure, docs, best practices)
Repository-->>Developer: Accept or request changes to PR
Suggested reviewers
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🔍 Vulnerabilities of
|
| digest | sha256:6c733d3457bd4e07e38d40d6bad56cf11282801bb64d9b6af0e9a859971038f9 |
| vulnerabilities | |
| platform | linux/amd64 |
| size | 243 MB |
| packages | 1628 |
📦 Base Image node:20-alpine
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
.cursor/rules/temporal-project-structure.mdc (4)
52-64: Documentation format should be specified.While documentation requirements are clearly stated, the file format isn't explicitly mentioned. Although the
.mdextension suggests Markdown, it would be helpful to explicitly state this for clarity.Each worker must have a dedicated documentation file at: -`docs/user-guide/temporal/workers/<worker-name>.md` +`docs/user-guide/temporal/workers/<worker-name>.md` (in Markdown format)
65-72: Best practices section is well-structured but could be enhanced.The best practices section provides good guidance but could benefit from additional recommendations specific to Temporal workflows, such as error handling, versioning practices, and workflow/activity timeouts.
Consider adding Temporal-specific best practices, for example:
- Place all shared code in `workers-shared/` to maximize reuse and maintainability. + Place all shared code in `workers-shared/` to maximize reuse and maintainability. + - Configure appropriate timeouts for workflows and activities based on their expected execution time. + - Implement proper error handling for activities, including retry policies for transient failures. + - Follow Temporal's versioning practices when updating existing workflows to ensure backward compatibility. + - Avoid non-deterministic code in workflows (e.g., random number generation, current date/time without fixed seeds).
73-76: Enforcement section could be more detailed.The enforcement section is concise but could provide more information about how the rules will be enforced (e.g., through PR reviews, automated checks, or both) and who is responsible for enforcing them.
## Enforcement - PRs introducing new Temporal workers or workflows **must** follow this structure and update documentation accordingly. + PRs introducing new Temporal workers or workflows **must** follow this structure and update documentation accordingly. + - Compliance will be verified during code review by maintainers. + - Future automated checks may be implemented to validate adherence to this structure. + - Exceptions to these rules must be explicitly justified and approved by the team lead.
16-33: Consider including CI/CD configuration in the project structure.The project structure includes source code and documentation but doesn't mention where CI/CD configuration for Temporal workers should be placed. This would be valuable for ensuring consistent deployment practices.
. ├── workers/ # Root directory for all Temporal workers │ ├── main/ # Main worker package ... ├── docker-compose.yml # Docker compose configuration └── Dockerfile.temporal # Base Temporal worker Dockerfile +├── .github/ # CI/CD configuration +│ └── workflows/ # GitHub Actions workflows +│ └── temporal.yml # Workflows for building and deploying Temporal workers
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.cursor/rules/temporal-project-structure.mdc(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Docker Security Scanning (n8n, Dockerfile.n8n, n8n-test:latest)
🔇 Additional comments (1)
.cursor/rules/temporal-project-structure.mdc (1)
1-76: LGTM! The rule is well-structured and provides clear guidance.This rule file provides excellent guidance for organizing Temporal-based projects in a consistent manner. The structure is logical, and the requirements are clear. The suggestions above are enhancements to an already solid foundation.
- Revised the description to clearly define and enforce standardized directory structure and documentation requirements for Temporal-based workflows and workers. - This change enhances clarity and understanding of the project's organization and documentation standards.
killev
left a comment
There was a problem hiding this comment.
Propose small refinement. Please free to argument if disagree as I'm not 100% sure I'm correct
…roject Structure documentation - Updated references in the documentation to reflect the new directory name 'common' for shared utilities, types, and configuration.
|



This addition enhances clarity and consistency in project organization for Temporal workflows.