|
1 | | -# Copilot Chat Instructions for PR Reviews |
2 | | - |
3 | | -## Node Addition and Documentation Check |
4 | | - |
5 | | -When reviewing a pull request, follow these steps: |
6 | | - |
7 | | -1. **Detect New Node Additions** |
8 | | - - If a method is marked with `[IsVisibleInDynamoLibrary(true)]`, or if the commit message or PR description mentions a new node, treat this as a new node addition. |
9 | | - |
10 | | -2. **Verify Documentation** |
11 | | - - For each new node, check that the following documentation files are included. Each file should contain the method name (with possible additional words): |
12 | | - - A `.dyn` file (sample graph) |
13 | | - - A `.md` file (markdown documentation) |
14 | | - - A `.jpg` file (visual preview) |
15 | | - - If any of these files are missing, notify the contributor that documentation is incomplete and must be added. |
16 | | - - Ensure that any new user-facing strings are properly added to the appropriate `.resx` files for localization purposes. |
17 | | - - Ensure that any UI changes are documented with appropriate screenshots or descriptions in the PR. |
18 | | - - If code modifies some build requirements, the readme is updated if necessary to reflect any new dependencies or changes in the build process. |
19 | | - |
20 | | -3. **Identify API-Breaking Changes** |
21 | | - - Look for changes that may break the public API, such as: |
22 | | - - Removed or renamed public methods or properties |
23 | | - - Changes in method accessibility (e.g., from public to private) |
24 | | - - Modified method signatures or return types |
25 | | - - If such changes are found, alert the contributor and recommend: |
26 | | - - Updating versioning appropriately |
27 | | - - Documenting the change clearly in the changelog |
28 | | - |
29 | | -4. **Verify Coding Standards Documentation** |
30 | | - - For each new node or code change, verify that documentation and code style comply with the [Dynamo Coding Standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards), including: |
31 | | - - Presence of XML documentation comments for all public methods and properties. |
32 | | - - Proper code formatting and adherence to naming conventions. |
33 | | - - If any aspect does not meet these standards, notify the contributor to update the documentation and code to comply. |
34 | | - |
35 | | -5. **Restrictions** |
36 | | - - Code change should contain no files larger than 50 MB |
37 | | - - Code change should not introduce any new network connections unless explicitly stated and tested in no-network mode. |
38 | | - - Data collection should not be introduced without proper user consent check and documentation. |
| 1 | +# Dynamo Repository Copilot Instructions |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +Dynamo is a visual programming tool that aims to be accessible to both non-programmers and programmers alike. It gives users the ability to visually script behavior, define custom pieces of logic, and script using various textual programming languages. Dynamo is primarily developed in C# and WPF, with a focus on Windows compatibility, though the Dynamo engine (DynamoCore) can be built for Linux and macOS. |
| 6 | + |
| 7 | +## Tech Stack |
| 8 | + |
| 9 | +- **Primary Language**: C# (.NET 10) |
| 10 | +- **UI Framework**: Windows Presentation Foundation (WPF) |
| 11 | +- **Build System**: MSBuild and dotnet CLI |
| 12 | +- **IDE**: Visual Studio 2022 (any edition) |
| 13 | +- **Testing**: NUnit |
| 14 | +- **Node.js**: Required for certain build steps |
| 15 | +- **Target Platforms**: Windows (full UI), Linux and macOS (engine only) |
| 16 | + |
| 17 | +## Build and Test Commands |
| 18 | + |
| 19 | +### Building the Project |
| 20 | + |
| 21 | +**Windows (Full Build):** |
| 22 | +```bash |
| 23 | +# Restore dependencies for Windows |
| 24 | +dotnet restore src/Dynamo.All.sln --runtime=win-x64 -p:Configuration=Release -p:DotNet=net10.0 |
| 25 | + |
| 26 | +# Build with MSBuild |
| 27 | +msbuild src/Dynamo.All.sln /p:Configuration=Release |
| 28 | +``` |
| 29 | + |
| 30 | +**DynamoCore Only (Cross-Platform):** |
| 31 | +```bash |
| 32 | +# For Windows |
| 33 | +dotnet restore src/DynamoCore.sln --runtime=win-x64 -p:Configuration=Release -p:DotNet=net10.0 |
| 34 | +msbuild src/DynamoCore.sln /p:Configuration=Release |
| 35 | + |
| 36 | +# For Linux |
| 37 | +dotnet restore src/DynamoCore.sln --runtime=linux-x64 -p:Configuration=Release -p:Platform=NET_Linux -p:DotNet=net10.0 |
| 38 | +dotnet build src/DynamoCore.sln -c Release /p:Platform=NET_Linux |
| 39 | +``` |
| 40 | + |
| 41 | +### Running Tests |
| 42 | + |
| 43 | +Tests are located in the `test/` directory. Use Visual Studio Test Explorer or dotnet test CLI to run tests. |
| 44 | + |
| 45 | +## Code Style and Formatting |
| 46 | + |
| 47 | +### Follow Existing Standards |
| 48 | + |
| 49 | +- **Coding Standards**: Follow the [Dynamo Coding Standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards) |
| 50 | +- **Naming Standards**: Follow the [Dynamo Naming Standards](https://github.com/DynamoDS/Dynamo/wiki/Naming-Standards) |
| 51 | +- **EditorConfig**: The repository includes `.editorconfig` with formatting rules: |
| 52 | + - Use spaces (4-space indentation) |
| 53 | + - LF line endings |
| 54 | + - UTF-8 encoding |
| 55 | + - Trim trailing whitespace |
| 56 | + - Insert final newline |
| 57 | + |
| 58 | +### XML Documentation |
| 59 | + |
| 60 | +- All public methods and properties **MUST** have XML documentation comments |
| 61 | +- Use clear, concise descriptions that explain what the method does, its parameters, and return values |
| 62 | + |
| 63 | +### Code Analysis |
| 64 | + |
| 65 | +- The project uses Roslyn analyzers with specific rules enabled |
| 66 | +- Warning-as-error is enabled for specific analyzers (RS0016, RS0017) |
| 67 | +- Security analyzers are configured with error severity (CA2327, CA2329, CA2330, CA2328) |
| 68 | + |
| 69 | +### Public API Management |
| 70 | + |
| 71 | +- **RS0016 Mitigation**: All new public APIs must be declared in `PublicAPI.Unshipped.txt` files |
| 72 | +- Public API files are located in project directories (e.g., `src/DynamoCore/PublicAPI.Unshipped.txt`) |
| 73 | +- When adding new public types, methods, or properties: |
| 74 | + 1. Add the API signature to the appropriate `PublicAPI.Unshipped.txt` file |
| 75 | + 2. Use the format: `namespace.ClassName.MemberName -> ReturnType` |
| 76 | + 3. Entries in `PublicAPI.Unshipped.txt` are moved to `PublicAPI.Shipped.txt` upon release |
| 77 | +- Existing PublicAPI files: DynamoCore, DynamoUtilities, DynamoCoreWpf |
| 78 | + |
| 79 | +## Project Structure |
| 80 | + |
| 81 | +``` |
| 82 | +Dynamo/ |
| 83 | +├── src/ # Main source code |
| 84 | +│ ├── DynamoCore.sln # Core engine solution |
| 85 | +│ ├── Dynamo.All.sln # Complete solution with UI |
| 86 | +│ ├── DynamoCore/ # Core engine |
| 87 | +│ ├── DynamoCoreWpf/ # WPF UI components |
| 88 | +│ ├── DynamoApplications/ # Application entry points |
| 89 | +│ ├── Libraries/ # Node libraries |
| 90 | +│ └── ... |
| 91 | +├── test/ # Unit and integration tests |
| 92 | +├── doc/ # Documentation |
| 93 | +│ ├── distrib/NodeHelpFiles/ # Node documentation (.dyn, .md, .jpg) |
| 94 | +│ └── integration_docs/ # Integration documentation |
| 95 | +├── tools/ # Build and utility tools |
| 96 | +└── extern/ # External dependencies |
| 97 | +``` |
| 98 | + |
| 99 | +## Contribution Guidelines |
| 100 | + |
| 101 | +### Pull Requests |
| 102 | + |
| 103 | +- Use one of the [Dynamo PR templates](https://github.com/DynamoDS/Dynamo/wiki/Choosing-a-Pull-Request-Template) |
| 104 | +- All template declarations must be satisfied |
| 105 | +- Include unit tests when adding new features |
| 106 | +- Start with a test that highlights broken behavior when fixing bugs |
| 107 | +- PRs are reviewed monthly, oldest to newest |
| 108 | +- PR owners have 30 days to respond to feedback |
| 109 | + |
| 110 | +### API Compatibility |
| 111 | + |
| 112 | +- **DO NOT** introduce breaking changes to the public API |
| 113 | +- Follow semantic versioning |
| 114 | +- Maintain backwards compatibility |
| 115 | +- File an issue before proposing API changes |
| 116 | + |
| 117 | +## Node Development |
| 118 | + |
| 119 | +### Detecting New Node Additions |
| 120 | + |
| 121 | +A new node addition is identified by: |
| 122 | +- Methods marked with `[IsVisibleInDynamoLibrary(true)]` |
| 123 | +- Commit messages or PR descriptions mentioning new nodes |
| 124 | + |
| 125 | +### Required Documentation for New Nodes |
| 126 | + |
| 127 | +For each new node, provide in `doc/distrib/NodeHelpFiles/`: |
| 128 | +- A `.dyn` file (sample graph demonstrating usage) |
| 129 | +- A `.md` file (markdown documentation) |
| 130 | +- A `.jpg` file (visual preview/screenshot) |
| 131 | + |
| 132 | +### Localization |
| 133 | + |
| 134 | +- New user-facing strings **MUST** be added to appropriate `.resx` files |
| 135 | +- UI changes should be documented with screenshots |
| 136 | + |
| 137 | +## Security and Restrictions |
| 138 | + |
| 139 | +### Security Rules |
| 140 | + |
| 141 | +- **NEVER** commit secrets or credentials to source code |
| 142 | +- **DO NOT** introduce new network connections without explicit documentation and no-network mode testing |
| 143 | +- **DO NOT** add data collection without proper user consent checks and documentation |
| 144 | +- Security analyzer warnings for XML-related vulnerabilities (CA2327, CA2329, CA2330, CA2328) are treated as errors |
| 145 | + |
| 146 | +### File Size Limits |
| 147 | + |
| 148 | +- Code changes should contain no files larger than 50 MB |
| 149 | +- The check_file_size.yml workflow validates this |
| 150 | + |
| 151 | +### Build Requirements Updates |
| 152 | + |
| 153 | +- If build requirements change, update README.md to reflect new dependencies |
| 154 | + |
| 155 | +## API-Breaking Changes |
| 156 | + |
| 157 | +Alert contributors if changes include: |
| 158 | +- Removed or renamed public methods or properties |
| 159 | +- Changes in method accessibility (e.g., public to private) |
| 160 | +- Modified method signatures or return types |
| 161 | + |
| 162 | +**Required Actions:** |
| 163 | +- Update versioning appropriately |
| 164 | +- Document changes clearly in the changelog |
| 165 | +- Follow API compatibility guidelines |
| 166 | + |
| 167 | +## Important Documentation |
| 168 | + |
| 169 | +- [Dynamo Wiki](https://github.com/DynamoDS/Dynamo/wiki) |
| 170 | +- [Dynamo Coding Standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards) |
| 171 | +- [Dynamo Naming Standards](https://github.com/DynamoDS/Dynamo/wiki/Naming-Standards) |
| 172 | +- [API Changes](https://github.com/DynamoDS/Dynamo/wiki/API-Changes) |
| 173 | +- [Zero-Touch Plugin Development](https://github.com/DynamoDS/Dynamo/wiki/Zero-Touch-Plugin-Development) |
| 174 | +- [Developer Resources](https://developer.dynamobim.org/) |
| 175 | +- [Dynamo Samples](https://github.com/DynamoDS/DynamoSamples) |
| 176 | +- [Contributing Guide](CONTRIBUTING.md) |
0 commit comments