From c4b4be48a5e3d0b3d5dc61e1e5be21a55d9969c0 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Thu, 19 Jun 2025 09:42:32 -0400 Subject: [PATCH] Add copilot management files (#12207) * Add copilot management files * Add AI statements to README and CONTRIBUTING * Add statement to pull request template --- .github/CONTRIBUTING.md | 5 +++ .github/PULL_REQUEST_TEMPLATE.md | 5 +-- .github/copilot-instructions.md | 38 +++++++++++++++++++++++ .github/workflows/copilot-setup-steps.yml | 29 +++++++++++++++++ README.md | 4 +++ 5 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 .github/copilot-instructions.md create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d8b8322d9..225c67f61 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -15,6 +15,7 @@ These are just guidelines, not rules. Use your best judgment, and feel free to p * [Bug reports](#bug-reports) * [Discuss with the team](#discuss-with-the-team) * [Your first code contribution](#your-first-code-contribution) + * [Using AI](#using-ai) * [Pull requests](#pull-requests) * [Translations](#translations) @@ -74,6 +75,10 @@ Unsure where to begin contributing to KeePassXC? You can start by looking throug Both issue lists are sorted by total number of comments. While not perfect, looking at the number of comments on an issue can give a general idea of how much an impact a given change will have. +### Using AI + +Generative AI is fast becoming a first-party feature in most development environments, including GitHub itself. If you use Generative AI to write the vast majority of your submission (e.g., agent-based or vibe coding) then you **must document your use of AI** in your pull request. Please include the service you used and/or model that generated the code. All code submissions go through a rigourous review process regardless of the development workflow used. + ### Pull requests Along with our desire to hear your feedback and suggestions, we're also interested in accepting direct assistance in the form of code. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cbb8face9..5e039d00b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,12 +1,13 @@ -[NOTE]: # ( Describe your changes in detail, why is this change required? ) -[NOTE]: # ( Explain large or complex code modifications. ) +[NOTE]: # ( Describe your changes in detail. Explain large or complex code modifications. ) [NOTE]: # ( If it fixes an open issue, please add "Fixes #XXX". ) +[NOTE]: # ( If you used Generative AI to write the majority of your code, you must state this. ) ## Screenshots [NOTE]: # ( Do not include screenshots of your actual database! ) [TIP]: # ( Use View -> Allow Screen Capture ) + ## Testing strategy [NOTE]: # ( Please describe in detail how you tested your changes. ) [TIP]: # ( We expect new code to be covered by unit tests and include helpful comments. ) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..0eb7156bf --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,38 @@ +This is a C++ based repository that uses Qt5 as a primary support and GUI library. This repository is for a password manager application that stores passwords +and other highly sensitive information. The data format that passwords are stored is called KDBX which is a mixed binary and XML format that is fully encrypted +at rest. This format is unpacked into a series of data structures: Database, Groups, and Entries. Please follow these guidelines when contributing: + +## Code Standards + +### Required Before Each Commit +- Run `cmake --build . --target format` before committing any changes to ensure proper code formatting +- This will run clang-format to ensure all code conforms to the style guide +- From the checkout directory, also run `./release-tool i18n lupdate` to update translation files + +### Development Flow +- Setup Build Folder: `mkdir build; cd build` +- Configure: `cmake -G Ninja -DWITH_XC_ALL=ON -DWITH_GUI_TESTS=ON ..` +- Build: `cmake --build . -- -j $(nproc)` +- Test: `ctest` + +## Repository Structure +- `docs/topics`: Documentation written in asciidoctor syntax +- `src/`: Main source code files are under this subdirectory +- `src/autotype`: Code that emulates a virtual keyboard to type into interfaces +- `src/browser`: Interface with the KeePassXC Browser Extension using a JSON-based protocol +- `src/cli`: Command Line Interface code +- `src/core`: Contains files that define the data model and other shared code structures +- `src/format`: Code for import/export and reading/writing of KDBX databases +- `src/fdosecrets`: freedesktop.org Secret Service interface code +- `src/quickunlock`: Quick unlock interfaces for various platforms +- `src/sshagent`: SSH Agent interface code to load private keys from the database into ssh-agent +- `tests/`: Test source code files +- `tests/gui`: GUI test source code files + +## Key Guidelines +1. Follow C++20 and Qt5 best practices and idiomatic patterns +2. Maintain existing code structure and organization +3. Prefer not to edit cryptographic handling code or other sensitive parts of the code base +4. Write unit tests for new functionality using QTest scaffolding +5. Suggest changes to the `docs/topics` folder when appropriate +6. Unless the change is simple, don't actually make edits to .ui files, just suggest the changes needed diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 000000000..cfd6b46e7 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,29 @@ +name: "Copilot Setup Steps" + +# Setup the environment for Copilot agents to run in +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + + # Needed to clone the repository + permissions: + contents: read + + # Install dependencies + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt update + sudo apt install --no-install-recommends build-essential cmake g++ ninja-build qtbase5-dev qtbase5-private-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev libargon2-dev libkeyutils-dev libminizip-dev libbotan-2-dev libqrencode-dev zlib1g-dev asciidoctor libreadline-dev libpcsclite-dev libusb-1.0-0-dev libxi-dev libxtst-dev libqt5x11extras5-dev diff --git a/README.md b/README.md index 66078c3b6..9648e6dd0 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ You may directly contribute your own code by submitting a pull request. Please r Contributors are required to adhere to the project's [Code of Conduct](CODE-OF-CONDUCT.md). +## Generative AI + +Generative AI is fast becoming a first-party feature in most development environments, including GitHub itself. If the majority of a code submission is made using Generative AI (e.g., agent-based or vibe coding) then **we will document that in the pull request.** All code submissions go through a rigourous review process regardless of the development workflow or submitter. + ## License KeePassXC code is licensed under GPL-2 or GPL-3. Additional licensing for third-party files is detailed in [COPYING](./COPYING).