From 173cdcaaae0e3ae731c6f05c0ed113ab66cee2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Fri, 6 Mar 2020 10:08:04 +0100 Subject: [PATCH 1/3] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 43 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..6bc21be6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,43 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Server Side** +- Part-DB Version: [e.g. Part-DB 1.0 (for dev versions commit hash is useful] +- PHP Version: [e.g. PHP 7.4.3] +- Database Server [e.g. MySQL 5.7] + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..11fc491e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 0eed5fd157f70a1fa3ad46aaa5f9e9818ee0f09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Fri, 6 Mar 2020 10:54:18 +0100 Subject: [PATCH 2/3] Create CONTRIBUTING.md --- CONTRIBUTING.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..6f7d2eee --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# How to contribute + +Thank you for consider to contribute to Part-DB! +Please read the text below, so your contributed content can be contributed easily to Part-DB. + +You can contribute to Part-DB in various ways: +* Report bugs and request new features via [issues](https://github.com/Part-DB/Part-DB-symfony/issues) +* Improve translations (via https://part-db.crowdin.com/part-db) +* Improve code (either PHP, Javascript or HTML templates) by creating a [pull request](https://github.com/Part-DB/Part-DB-symfony/pulls) + +## Translations +The recommended way to create/improve translations is to use the online platform [Crowdin](https://part-db.crowdin.com/part-db). +Register an account there and join the Part-DB team. + +If you want to start translation for a new language that does not have an entry on Crowdin yet, send an message to `@jbtronics`. + +Part-DB uses translation keys (e.g. part.info.title) that are sorted by their usage, so you will most likely have to lookup, how the key +was translated in other languages (this is possible via the "Other languages" dropdown in the translation editor). + +## Development environment +For setting up an development you will need to install PHP, composer, a database server (MySQL or MariaDB) and yarn (which needs an nodejs environment). +* Copy `.env` to `.env.local` and change `APP_ENV` to `APP_ENV=dev`. That way you will get development tools (symfony profiler) and other features that +will simplify development. +* Run `composer install` (without -o) to install PHP dependencies and `yarn install` to install frontend dependencies +* Run `yarn watch`. The program will run in the background and compile the frontend files whenever you change something in the CSS or TypeScript files +* For running Part-DB it is recommended to use [Symfony CLI](https://symfony.com/download). +That way you can run a correct configured webserver with `symfony serve` + +## Coding style +Code should follow the [PSR12-Standard](https://www.php-fig.org/psr/psr-12/) and symfony's [coding standards](https://symfony.com/doc/current/contributing/code/standards.html). + +Part-DB uses [Easy Coding Standard](https://github.com/symplify/easy-coding-standard) to check and fix coding style violations: +* To check your code for valid code style run `vendor/bin/ecs check src/` +* To fix violations run `vendor/bin/ecs check src/` (please checks afterwards if the code is valid afterwards) + + From 2d425ff5a0a858c1263ed912d7ecb63fe8f290e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Fri, 6 Mar 2020 11:11:32 +0100 Subject: [PATCH 3/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f7d2eee..eda4f2c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,6 +17,18 @@ If you want to start translation for a new language that does not have an entry Part-DB uses translation keys (e.g. part.info.title) that are sorted by their usage, so you will most likely have to lookup, how the key was translated in other languages (this is possible via the "Other languages" dropdown in the translation editor). +Translation keys can be extracted from templates and PHP codes by running `bin/console translation:extract`. + +## Project structure +Part-DB uses symfony's recommended [project structure](https://symfony.com/doc/current/best_practices.html). +Interesting folders are: +* `public`: Everything in this directory will be publicy accessible via web. Use this folder to serve static images. +* `assets`: The frontend assets are saved here. You can find the javascript and CSS code here. +* `src`: Part-DB's PHP code is saved here. Note that the sub directories are structured by the classes purposes (so use `Controller` Controllers, `Entities` for Database models, etc.) +* `translations`: The translations used in Part-DB are saved here +* `templates`: The templates (HTML) that are used by Twig to render the different pages. Email templates are also saved here. +* `tests/`: Tests that can be run by PHPunit. + ## Development environment For setting up an development you will need to install PHP, composer, a database server (MySQL or MariaDB) and yarn (which needs an nodejs environment). * Copy `.env` to `.env.local` and change `APP_ENV` to `APP_ENV=dev`. That way you will get development tools (symfony profiler) and other features that @@ -33,4 +45,13 @@ Part-DB uses [Easy Coding Standard](https://github.com/symplify/easy-coding-stan * To check your code for valid code style run `vendor/bin/ecs check src/` * To fix violations run `vendor/bin/ecs check src/` (please checks afterwards if the code is valid afterwards) +## TravisCI +Part-DB has a [Travis-CI](https://travis-ci.com/Part-DB/Part-DB-symfony) instance running, that checks for every commit and contribute if the following things are working: +* Yarn dependencies can compile +* PHPunit tests run successful +* Config files, translations and templates has valid syntax +* Doctrine schema valid +* No known vulnerable dependecies are used +* Static analysis successful (phpstan with `--level=2`) +Further the code coverage of the PHPunit tests is determined.