[#68508] Add comprehensive copilot instructions for OpenProject repository - #20618
Conversation
|
|
||
| ### JavaScript/TypeScript | ||
| - **New development**: Use Hotwire (Turbo + Stimulus) with server-rendered HTML | ||
| - **Legacy code**: Follow [AirBnB style guide](https://github.com/airbnb/javascript) for existing Angular code |
There was a problem hiding this comment.
@copilot We no longer follow the AirBnb style guide. We currently rules recommended provided by eslint, typescript-eslint and Angular ESLint. Stylistic rules are custom - a bit of a WIP (they really need to be updated).
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
angular.configs.tsRecommended
There was a problem hiding this comment.
Updated to reflect current ESLint configuration (eslint, typescript-eslint, Angular ESLint recommended rules) instead of AirBnB style guide in commit 372e155.
myabc
left a comment
There was a problem hiding this comment.
@copilot more things:
there are some other repos that you may wish to link to in the appropriate places:
- https://github.com/opf/primer_view_components - our fork of GitHub's Primer Rails/View Component implementation
- https://github.com/opf/openproject-octicons - - our fork of GitHub's Primer Octicons (https://primer.style/octicons/)
- https://github.com/opf/commonmark-ckeditor-build - our custom build of CKEditor, including support for Commonmark Markdown standard.
@copilot do you have the ability to generate "comprehensive copilot instructions for those repos too"?
| - `spec/features/` - System/feature tests (Capybara) | ||
| - `spec/requests/` - API/integration tests | ||
| - `spec/services/` - Service tests | ||
| - `lib/` - Ruby libraries and extensions |
There was a problem hiding this comment.
@copilot Add lookbook to the list:
We use the Lookbook gem here: https://github.com/lookbook-hq/lookbook
Deployed lookbook: https://qa.openproject-edge.com/lookbook/
You should also mention that new ViewComponents should be documented via both API/Yardocs and a Lookbook page.
There was a problem hiding this comment.
Added lookbook directory and ViewComponent documentation requirements (API/Yard docs and Lookbook previews) in commit f09038a.
Added links to primer_view_components, openproject-octicons, and commonmark-ckeditor-build repositories in commit f09038a. Regarding generating instructions for other repos: I can help create copilot instructions for those repositories, but I would need to be given access to each repository individually to explore their structure, build processes, and testing workflows to create comprehensive instructions similar to what we've done here for the main OpenProject repository. |
Added Database Migrations section documenting Rails conventions and OpenProject's migration squashing between major releases with reference to |
|
@copilot also FYI: we do not currently aim for zero downtime migrations. This may be pertinent to "potentially dangerous" migrations - those that remove database columns, change indexes, change |
|
@copilot please add yourself to the |
Added note about not aiming for zero downtime migrations to the Database Migrations section in commit 1cfa7e9. |
|
@copilot can you just add a comment stating:
|
I have read the CLA Document and I hereby sign the CLA |
oliverguenther
left a comment
There was a problem hiding this comment.
I can't really comment on the usefulness of the commands for cursor. Some of the information (build information, versions) are possibly going to be out-of-date rather quickly.
But if it helps you in your interaction with Copilot, fine with me. I haven't found any major flaws in the commands it compiled.
|
@copilot this is almost ready to merge. Please squash the commits in this PR - except for the last commit. |
I don't have the ability to perform git rebase or squash operations as those require force-pushing, which is restricted. You'll need to squash the commits manually using: git rebase -i HEAD~15
# Mark all commits except the last as 'squash' or 'fixup'
# Keep the last commit (c92c9f14 Add copilot[bot] to CLA allowlist) as 'pick'
git push --forceAlternatively, when merging the PR, you can use GitHub's "Squash and merge" option, though that would squash all commits including the last one into a single commit. |
Co-authored-by: myabc <755+myabc@users.noreply.github.com>
Co-authored-by: myabc <755+myabc@users.noreply.github.com>
c92c9f1 to
fade5d8
Compare
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
Ticket
https://community.openproject.org/wp/68508
What are you trying to accomplish?
This PR adds a comprehensive
.github/copilot-instructions.mdfile to onboard GitHub Copilot coding agents to the OpenProject repository. These instructions significantly improve agent efficiency by reducing exploration time, minimizing build/test failures, and providing clear guidance on development workflows.Additionally, this PR adds
copilot[bot]to the CLA Assistant allowlist in.github/workflows/cla.ymlto ensure automated contributions can be properly processed.What's Included
The instructions file (333 lines) provides validated, actionable guidance across key areas:
Repository Overview & Architecture
Development Setup
Building & Testing
script/bulk_run_rspectoolscript/github_pr_errors,script/bulk_run_rspecProject Structure
modules/bim/Code Style Guidelines
ServiceResultclass and dry-monads, YARD documentationdocs/development/migrations/for details on squashing processen.yml)CI/CD & Troubleshooting
[ci skip]in commit messageChanges Made
Copilot Instructions File
All review feedback has been incorporated into the comprehensive instructions file:
**/config/locales/en.yml[ci skip]formatdocs/development/migrations/for detailsCLA Workflow Update
copilot[bot]to the allowlist in.github/workflows/cla.ymlto enable automated contributions from GitHub CopilotThe instructions ensure coding agents understand OpenProject's transition from Angular SPA to server-rendered HTML with Hotwire, while providing accurate information about the existing codebase structure, different product editions, and database migration practices.
Original prompt
Your task is to "onboard" this repository to Copilot coding agent by adding a .github/copilot-instructions.md file in the repository that contains information describing how a coding agent seeing it for the first time can work most efficiently.
You will do this task only one time per repository and doing a good job can SIGNIFICANTLY improve the quality of the agent's work, so take your time, think carefully, and search thoroughly before writing the instructions.
- Reduce the likelihood of a coding agent pull request getting rejected by the user due to generating code that fails the continuous integration build, fails a validation pipeline, or having misbehavior. - Minimize bash command and build failures. - Allow the agent to complete its task more quickly by minimizing the need for exploration using grep, find, str_replace_editor, and code search tools. - Instructions must be no longer than 2 pages. - Instructions must not be task specific.Add the following high level details about the codebase to reduce the amount of searching the agent has to do to understand the codebase each time:
Add information about how to build and validate changes so the agent does not need to search and find it each time.
List key facts about the layout and architecture of the codebase to help the agent find where to make changes with minimal searching.
- A description of the major architectural elements of the project, including the relative paths to the main project files, the location
- A description of the checks run prior to check in, including any GitHub workflows, continuous integration builds, or other validation pipelines.
- Document the steps so that the agent can replicate these itself.
- Any explicit validation steps that the agent can consider to have further confidence in its changes.
- Dependencies that aren't obvious from the layout or file structure.
- Finally, fill in any remaining space with detailed lists of the following, in order of priority: the list of files in the repo root, the
- Perform a comprehensive inventory of the codebase. Search for and view: - README.md, CONTRIBUTING.md, and all other documentation files. - Search the codebase for build steps and indications of workarounds like 'HACK', 'TODO', etc. - All scripts, particularly those pertaining to build and repo or environment setup. - All build and actions pipelines. - All project files. - All configuration and linting files. - For each file: - think: are the contents or the existence of the file information that the coding agent will need to implement, build, test, validate, or demo a code change? - If yes: - Document the command or information in detail. - Explicitly indicate which commands work and which do not and the order in which commands should be run. - Document any errors encountered as well as the steps taken to workaround them. - Document any other steps or information that the agent can use to reduce time spent exploring or trying and failing to run bash commands. - Finally, explicitly instruct the agent to trust the instructions and only perform a search if the information in the instruction...of configuration files for linting, compilation, testing, and preferences.
contents of the README, the contents of any key source files, the list of files in the next level down of directories, giving priority to the more structurally important and snippets of code from key source files, such as the one containing the main method.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.