Skip to content

Commit d4015cb

Browse files
committed
Add CONTRIBUTING.md and update README.md to reference contribution guidelines
1 parent c8b222f commit d4015cb

2 files changed

Lines changed: 135 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Contributing to GitHub Copilot for Eclipse
2+
3+
Thank you for your interest in contributing to GitHub Copilot for Eclipse! This document provides guidelines and instructions for contributing to this project.
4+
5+
## Code of Conduct
6+
7+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any questions or concerns.
8+
9+
## Contributor License Agreement (CLA)
10+
11+
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [https://cla.opensource.microsoft.com](https://cla.opensource.microsoft.com).
12+
13+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
14+
15+
## Getting Started
16+
17+
### Prerequisites
18+
19+
- **Java 21** or later
20+
- **Maven 3.8+** (or use the provided Maven wrapper `./mvnw`)
21+
- **Eclipse IDE for Eclipse Committers 2024-03** or later (for development)
22+
23+
### Building the Project
24+
25+
Clone the repository and build with the Maven wrapper:
26+
27+
```shell
28+
./mvnw clean package
29+
```
30+
31+
### Running Tests
32+
33+
```shell
34+
./mvnw test
35+
```
36+
37+
### Building the Update Site
38+
39+
```shell
40+
./mvnw clean verify
41+
```
42+
43+
The installable P2 repository is generated in `com.microsoft.copilot.eclipse.repository/target/repository/`.
44+
45+
### Running in Eclipse
46+
47+
1. Import all modules into your Eclipse workspace.
48+
2. Use the launch configurations in the `launch/` directory.
49+
50+
## How to Contribute
51+
52+
### Reporting Issues
53+
54+
- Search [existing issues](https://github.com/microsoft/copilot-for-eclipse/issues) before filing a new one to avoid duplicates.
55+
- File bugs or feature requests as a new GitHub Issue.
56+
- Include steps to reproduce, expected behavior, actual behavior, and your environment details (Eclipse version, OS, Java version).
57+
58+
### Submitting Pull Requests
59+
60+
1. Fork the repository and create a feature branch from `main`.
61+
2. Make your changes following the code style and architecture guidelines below.
62+
3. Ensure all checks pass before submitting:
63+
```shell
64+
./mvnw checkstyle:check # Code style compliance
65+
./mvnw clean verify # Compilation and packaging
66+
./mvnw test # Unit tests
67+
```
68+
4. Open a pull request with a clear description of the change and its motivation.
69+
5. Address any feedback from reviewers.
70+
71+
### Security Vulnerabilities
72+
73+
**Please do not report security vulnerabilities through public GitHub issues.** For security reporting information, please review the guidance at [https://aka.ms/SECURITY.md](https://aka.ms/SECURITY.md).
74+
75+
## Project Structure
76+
77+
The project is a multi-module Maven/Tycho build consisting of OSGi bundles:
78+
79+
| Module | Purpose |
80+
|--------|---------|
81+
| `com.microsoft.copilot.eclipse.core` | Core functionality: LSP client, authentication, chat/completion logic |
82+
| `com.microsoft.copilot.eclipse.ui` | User interface: chat view, completion UI, agent tools |
83+
| `com.microsoft.copilot.eclipse.ui.jobs` | Copilot Jobs view integration |
84+
| `com.microsoft.copilot.eclipse.terminal.api` | Terminal tool API definitions |
85+
| `com.microsoft.copilot.eclipse.ui.terminal` | Terminal integration (Eclipse 4.37+) |
86+
| `com.microsoft.copilot.eclipse.ui.terminal.tm` | TM Terminal integration (Eclipse 4.36 and earlier) |
87+
| `com.microsoft.copilot.eclipse.branding` | Product branding and about dialog |
88+
| `com.microsoft.copilot.eclipse.core.agent.*` | Platform-specific Copilot language server agent bundles |
89+
| `com.microsoft.copilot.eclipse.feature` | Eclipse feature definition |
90+
| `com.microsoft.copilot.eclipse.repository` | P2 update site |
91+
| `com.microsoft.copilot.eclipse.core.test` | Core bundle tests |
92+
| `com.microsoft.copilot.eclipse.ui.test` | UI bundle tests |
93+
94+
## Code Style
95+
96+
This project enforces **Google Java Style** (with customizations) via Checkstyle. The configuration is in [`checkstyle.xml`](checkstyle.xml).
97+
98+
## Development Guidelines
99+
100+
### Threading
101+
102+
- **Never block the UI thread** with I/O or long-running operations.
103+
- Use `CompletableFuture.runAsync()` or Eclipse `Job` API for background work.
104+
- Always update SWT widgets on the UI thread using `Display.asyncExec()` or `Display.syncExec()`.
105+
106+
### Resource Management
107+
108+
- Dispose SWT resources (fonts, images) when done.
109+
- Use try-with-resources for streams and Eclipse resources.
110+
- Close editors before deleting files.
111+
112+
### Error Handling
113+
114+
- Use Eclipse `IStatus` / `Status` objects for error reporting.
115+
- Log errors via `CopilotCore.getPlugin().logError(message, exception)`.
116+
- Never silently swallow exceptions.
117+
118+
### Dependencies
119+
120+
- Minimize bundle dependencies — only add what is necessary.
121+
- Avoid circular dependencies between bundles.
122+
- Use `Require-Bundle` for essential dependencies, `Import-Package` for optional or version-flexible ones.
123+
124+
### Testing
125+
126+
- Use **JUnit 5** (Jupiter) for new tests.
127+
- Name test classes `<ClassName>Test` or `<ClassName>Tests`.
128+
- Name test methods descriptively: `testMethodName_scenario_expectedOutcome`.
129+
- Clean up resources in teardown methods.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ For bug reports and feature requests, use this repository’s Issues.
9494

9595
For support guidance, see [SUPPORT.md](SUPPORT.md).
9696

97+
## Contributing
98+
99+
This project welcomes contributions and suggestions. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to get started, build the project, submit pull requests, and follow our code style guidelines.
100+
101+
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [Contributor License Agreements](https://cla.opensource.microsoft.com).
102+
97103
## Trademarks
98104

99105
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft

0 commit comments

Comments
 (0)