diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 8900845..d079329 100755 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@main - name: Compress Images uses: calibreapp/image-actions@main diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86fa970..3bb205d 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: max-parallel: 3 steps: - name: Checkout Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 - name: Get Composer Cache Directory @@ -76,25 +76,25 @@ jobs: php-versions: ['8.0'] steps: - name: Checkout Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 - name: Checkout Build Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop repository: Karaka-Management/Build path: Build - name: Checkout Resource Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop repository: Karaka-Management/Resources path: Resources - name: Checkout phpOMS Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop @@ -102,7 +102,7 @@ jobs: path: phpOMS token: ${{ secrets.GH_PAT }} - name: Checkout Karaka Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop @@ -138,20 +138,20 @@ jobs: php-versions: ['8.0'] steps: - name: Checkout Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 submodules: recursive token: ${{ secrets.GH_PAT }} - name: Checkout Build Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop repository: Karaka-Management/Build path: Build - name: Checkout phpOMS Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop @@ -187,13 +187,13 @@ jobs: php-versions: ['8.0'] steps: - name: Checkout Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 submodules: recursive token: ${{ secrets.GH_PAT }} - name: Checkout Build Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop @@ -226,6 +226,25 @@ jobs: - run: npm install - name: eslint run: npx eslint ./ -c Build/Config/.eslintrc.json + linting: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'NO_CI')" + strategy: + fail-fast: false + max-parallel: 3 + steps: + - name: Checkout Repository + uses: actions/checkout@main + with: + fetch-depth: 0 + submodules: recursive + token: ${{ secrets.GH_PAT }} + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: develop + GITHUB_TOKEN: ${{ secrets.GH_PAT }} custom: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'NO_CI')" @@ -236,11 +255,11 @@ jobs: php-versions: ['8.0'] steps: - name: Checkout Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 - name: Checkout Build Repository - uses: actions/checkout@master + uses: actions/checkout@main with: fetch-depth: 1 ref: develop diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4acb7ce..e9b4371 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,27 +1,82 @@ -# Contributing +# Development -## Code Style & Best Practices +## Development environment -For the code style and best practices please have a look at the developer-guide [https://github.com/karaka-management/Developer-Guide](https://github.com/karaka-management/Developer-Guide). Especially the `standards` should be followed for a successful pull request. + The setup and configuration of the development environment is in the hands of every developer themselves. However, it is recommended to follow the setup instructions in the [Developer-Guide](https://github.com/Karaka-Management/Developer-Guide/blob/develop/general/setup.md). -## How Can I Contribute +## Code of conduct -### Suggestions +Every organization member and contributor to the organization must follow the [code of conduct](../Policies & Guidelines/Code of conduct.md). -If you have a good idea for improvement feel free to create a new issue with all the relevant information. +## Code changes -### Issues +### Topics / Tasks / Todos -Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the code marked with `@todo` or in the [PROJECT.md](https://github.com/karaka-management/Docs/blob/master/Project/PROJECT.md) file. +Generally, the development philosophy is result orientated. This means that anyone can propose tasks, pick up existing tasks or right away implement their code changes. However, implementing code changes without consulting with a senior developer in advance has a much higher risk of code changes not getting admitted. The easiest way to discuss a code change idea in advance are the github [issues](https://github.com/Karaka-Management/Karaka/issues) or [discussions](https://github.com/Karaka-Management/Karaka/discussions). -### Code Style +Developers are encouraged to pick open tasks with high priorities according to their own skill level. Senior developers may directly assign tasks to developers based on their importance. New developers may find it easier to start with a task that has a low priority as they often also have a lower difficulty. -Not always are the defined coding style standards upheld, if you notice that simply create a new pull request with the fix. +Open tasks can be found in the project overview: [PROJECT.md](../Project/PROJECT.md) -### Code Coverage +Tasks currently in development are prefixed in the priority column with an asterisk `*` and a name tag in the task description of the developer who is working on the task. -While code coverage is just a metric it is still appreciated to cover as many files and code paths as possible. Just have a look at the code coverage and implement missing unit tests. +The open tasks are reviewed once a month by a senior developer. The senior developer updates the project overview if necessary and requests feedback regarding development status of important tasks under development. During this process important tasks may also get directly assigned to developers. This review is performed on a judgmental bases of the senior basis. -### Freatures +### Code style -You have a good idea for a feature and can implement it yourself, go ahead and create a new pull request. \ No newline at end of file +Code changes must follow the [style guidelines](https://github.com/Karaka-Management/Developer-Guide/tree/develop/standards). Additionally, the automatic code style inspection tools must return no errors, failures or warnings. Developers should test their changes with inspection tools and configurations mentioned in the [inspection documentation](https://github.com/Karaka-Management/Developer-Guide/blob/develop/quality/inspections.md) in advance before submitting them for review. + +In rare cases errors, failures or warnings during the automatic inspection are acceptable. Reasons can be changes in the programming language, special cases which cannot, are difficult or must be individually configured in the inspection settings. If this is the case for a code change and if inspection configuration changes are necessary are decided by the senior developer performing the code review. + +Automated checks which are run during the review process: + +```sh +php ./vendor/bin/phpcs ./ --standard="Build/Config/phpcs.xml" +npx eslint ./ -c ./Build/Config/.eslintrc.json +``` + +### Tests + +Code changes must follow the inspection guidelines (i.e. code coverage) mentioned in the [inspection documentation](https://github.com/Karaka-Management/Developer-Guide/blob/develop/quality/inspections.md). Developers should check if the code changes comply with the inspection guidelines before submitting them. + +In rare cases it might be not possible to follow the inspection guidelines. In such cases the senior developer performing the code review may decide if the code change still gets accepted. + +Automated tests which are run during the review process: + +```sh +php ./vendor/bin/phpunit -c tests/PHPUnit/phpunit_default.xml +php ./vendor/bin/phpstan analyse --autoload-file=phpOMS/Autoloader.php -l 9 -c Build/Config/phpstan.neon ./ +npx jasmine-node ./ +./cOMS/tests/test.sh +``` + +Additional inspections which are run but might be ignored during the review depending on the use case are mentioned in the [inspection documentation](https://github.com/Karaka-Management/Developer-Guide/blob/develop/quality/inspections.md) as other checks. + +### Demo + +Some code changes may also require changes or extensions in the demo setup scripts. The demo setup script try to simulate a real world use case by generating and modifying mostly random data. This is also a good way to setup and “manually” test the code changes in a larger picture. The demo setup script can be found in the [demoSetup](https://github.com/Karaka-Management/demoSetup) repository. The demo setup script takes a long time due to the large amount of user input simulated data which is generated. Therefore it is recommended to run this only sporadically. + +### Code review + +In addition to the automatic code review performed by the various inspection tools such as (phpcs, phpstan, phpunit, eslint and custom scripts) a senior developer must check the proposed code change before it is merged with the respective `develop` branch. Only upon the approval by the reviewer a code change requests gets merged as no other developers have permission in the software to make such code merges. + +In case a code change request is not approved the reviewer states the reason for the decision, this may include some tips and requests which will allow the contributor to make improvements so that the code change may get approved. + +If the code reviewer only finds minor issues with the proposed code change the reviewer may make small changes to the proposed code change and inform the contributor to speed up the implementation process. Code reviewers are encouraged to do this with new contributors to avoid long iteration processes and to not discourage new developers. However, communication is key and severe issues with code change requests or if the contributor already made multiple code change requests in the past the reviewer should not implement the improvements by himself and rather decline the code change requests with his reasoning. + +### Release flow + +Code changes must be performed in a new branch. A new branch can be created with: + +```sh +git checkout -b new-branch-name +``` + +The name of the branch can be chosen freely however it is recommended to follow the following branch naming conventions: + +* `feature-*` for feature implementations +* `bug-*` for bug fixes +* `security-*` for security related fixes/improvements +* `general-*` for general improvements (i.e. code documentation improvements, code style improvements) + +The senior developer who performs the code review merges the change request into the `develop` branch upon approval. \ No newline at end of file diff --git a/ICAL.txt b/ICAL.txt new file mode 100644 index 0000000..019045f --- /dev/null +++ b/ICAL.txt @@ -0,0 +1,49 @@ +# Individual Contributor License Agreement ("CLA") 1.0 + +Thank you for your interest in Karaka-Management (the "Company"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must provide a Contributor License Agreement ("CLA") on file that has been made available to each Contributor. This license is for your protection as a Contributor as well as the protection of the Company and its users; it does not change your rights to use your own Contributions for any other purpose. + +By contributing to the Company You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Company. In return, the Company shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with its bylaws in effect at the time of the Contribution. Except for the license granted herein to the Company and recipients of software distributed by the Company, You reserve all right, title, and interest in and to Your Contributions. + +## Definitions + +**"You" (or "Your")** + +"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with the Company. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +**"Contribution"** + +"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to the Company for inclusion in, or documentation of, any of the products owned or managed by the Company (the "Work"). This includes but is not limited to technical material, techniques, articles, sketches, drawings, images, models, inventions, know-how, processes, apparatus, equipment, algorithms, software programs, software source documents, and formula related to the current, future and proposed products and services regarding the Company". For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Company or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Company for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." + +## Grant of Copyright License + +Subject to the terms and conditions of this Agreement, You hereby grant to the Company and to recipients of software distributed by the Company a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sub license, and distribute Your Contributions and such derivative works. + +## Grant of Patent License + +Subject to the terms and conditions of this Agreement, You hereby grant to the Company and to recipients of software distributed by the Company a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. + +## Authorization + +You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Company, or that your employer has executed a separate Corporate CLA with the Company. + +You represent that each of Your Contributions is Your original creation (see "Third-party Contribution" for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. + +## Support + +You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + +## Third-party Contribution + +Should You wish to submit work that is not Your original creation, You may submit it to the Company separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]". + +## Survival + +This Agreement shall govern all communications between the parties. You understand that this Agreement stays active even if the connection with You gets terminated unless the project the Company gets officially canceled by the project manager "Dennis Eichhorn". + +## Governing Law and Jurisdiction + +This Agreement shall be governed exclusively by German law. The courts of Hessen, Germany shall have exclusive jurisdiction. + +## Entire Agreement + +This agreement constitutes the entire agreement and supersedes all prior or contemporaneous oral or written agreements concerning such Contribution. This agreement may only be changed by mutual agreement of authorized representatives of the parties in writing. You agree to notify the Company of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index 14e4e68..56d5426 100755 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -8,4 +8,7 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. + +BY CONTRIBUTING YOU AUTOMATICALLY ACCEPT THE INDIVIDUAL CONTRIBUTOR LICENSE +AGREEMENT 1.0 ("CLA") INCLUDED IN THIS REPOSITORY. \ No newline at end of file