From 5b541f2d080475c4287596f1c90a3f2008070d9c Mon Sep 17 00:00:00 2001 From: Felix Zailskas Date: Tue, 24 Oct 2023 09:35:43 +0200 Subject: [PATCH 1/3] Added technology and Repository tools. Issue: #3. Signed-off-by: Felix Zailskas --- .github/ISSUE_TEMPLATE/bug_report.md | 23 +++-- .github/ISSUE_TEMPLATE/feature_request.md | 34 ++++--- .gitignore | 12 +++ .pre-commit-config.yaml | 34 +++++++ Deliverables/README.md | 7 +- Deliverables/sprint-01/Dummy.md | 5 + Documentation/README.md | 5 + LICENSES/MIT.txt | 9 ++ Pipfile | 14 +++ README.md | 106 ++++++++++++++++++++-- 10 files changed, 223 insertions(+), 26 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 LICENSES/MIT.txt create mode 100644 Pipfile diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea7..6bac24b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,4 +1,10 @@ + + --- + name: Bug report about: Create a report to help us improve title: '' @@ -12,6 +18,7 @@ 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 '....' @@ -24,15 +31,17 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] + +- 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] + +- 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 index c4bb0c2..3fbab18 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,4 +1,10 @@ + + --- + name: Feature request about: Suggest new feature (using user story) title: '' @@ -8,24 +14,28 @@ assignees: '' --- ## User story + 1. As a {} 2. I want / need {} 3. So that {} ## Acceptance criteria -* Criterion 1 -* Criterion 2 -* ... + +- Criterion 1 +- Criterion 2 +- ... ## Definition of done (DoD) -* Added only after week 5 -* The same for all features -* Here goes the project specific part + +- Added only after week 5 +- The same for all features +- Here goes the project specific part ## DoD general criteria -* Feature has been fully implemented -* Feature has been merged into the mainline -* All acceptance criteria were met -* Product owner approved features -* All tests are passing -* Developers agreed to release + +- Feature has been fully implemented +- Feature has been merged into the mainline +- All acceptance criteria were met +- Product owner approved features +- All tests are passing +- Developers agreed to release diff --git a/.gitignore b/.gitignore index e4ec773..5896fb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2023 + # Node logs npm-debug.log* @@ -18,6 +21,10 @@ pids # Python *.pyc __pycache__/ +Pipfile.lock + +# Jupyter Notebook +.ipynb_checkpoints # vscode .vscode/ @@ -34,3 +41,8 @@ bin/ # MacOS .DS_Store +.AppleDouble +.LSOverride + +# License +.reuse diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f0919df --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2023 + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-yaml + - id: check-json + - id: end-of-file-fixer + - id: trailing-whitespace + - id: no-commit-to-branch + args: ["--branch", "main", "--branch", "dev"] + + - repo: https://github.com/psf/black + rev: 23.10.1 + hooks: + - id: black + + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + args: ["--profile", "black"] + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.3 + hooks: + - id: prettier + + - repo: https://github.com/fsfe/reuse-tool + rev: v2.1.0 + hooks: + - id: reuse diff --git a/Deliverables/README.md b/Deliverables/README.md index 543e374..b5e105e 100644 --- a/Deliverables/README.md +++ b/Deliverables/README.md @@ -1,4 +1,9 @@ -Deliverables that are uploadable files (e.g. PDFs, your logo, but not your code) go here. + + +Deliverables that are uploadable files (e.g. PDFs, your logo, but not your code) go here. Please upload deliverables to a dedicated folder for the sprint they belong to. diff --git a/Deliverables/sprint-01/Dummy.md b/Deliverables/sprint-01/Dummy.md index 71ed7e9..eb7f099 100644 --- a/Deliverables/sprint-01/Dummy.md +++ b/Deliverables/sprint-01/Dummy.md @@ -1 +1,6 @@ + + Delete me if you can! (Yes, you can!) diff --git a/Documentation/README.md b/Documentation/README.md index 10fe2a5..f2b6606 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -1,2 +1,7 @@ + + Build, user, and technical documentation Software architecture description diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000..2071b23 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 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. diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..76714cd --- /dev/null +++ b/Pipfile @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2023 + +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + +[dev-packages] + +[packages] + +[requires] +python_version = "3.10" diff --git a/README.md b/README.md index 112f278..3adf317 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,106 @@ + + # Sales-Lead-Qualifier Project (AMOS WS 2023/24) -## Branching Strategy +## Creating the Environment + +To create the virtual environment in this project you must have `pipenv` installed on your machine. Then run the following commands: + +```[bash] +# for development environment +pipenv install --dev +# for production environment +pipenv install +``` + +To work within the environment you can now run: + +```[bash] +# to activate the virtual environment +pipenv shell +# to run a single command +pipenv run +``` + +To install new packages in the environment add them to the `Pipfile`. Always pin the exact package version to avoid package conflicts and unexpected side effects from package upgrades. + +```[bash] +# to add a package to the development environment +[dev-packages] + = "==" +# to add a package to the production environment +[packages] + = "==" +``` + +Note that this project runs under an MIT license and we only permit the use of non-copyleft-licensed packages. Please be aware of this when installing new packages and inform yourself before blindly installing. + +When you have any issues with the environment contact `felix-zailskas`. + +## Contribution Workflow + +### Branching Strategy **main**: It contains fully stable production code -* **dev**: It contains stable under-development code - - * **epic**: It contains a module branch. Like high level of feature. For example, we have an authentication module then we can create a branch like "epic/authentication" - * **feature**: It contains specific features under the module. For example, under authentication, we have a feature called registration. Sample branch name: "feature/registration" +- **dev**: It contains stable under-development code + + - **epic**: It contains a module branch. Like high level of feature. For example, we have an authentication module then we can create a branch like "epic/authentication" + + - **feature**: It contains specific features under the module. For example, under authentication, we have a feature called registration. Sample branch name: "feature/registration" + + - **bugfix**: It contains bug fixing during the testing phase and branch name start with the issue number for example "bugfix/3-validate-for-wrong-user-name" + +### Commits and Pull Requests + +The stable branches `main` and `dev` are protected against direct pushes. To commit code to these branches create a pull request (PR) describing the feature/bugfix that you are committing to the `dev` branch. This PR will then be reviewed by another SD from the project. Only after being approved by another SD a PR may be merged into the `dev` branch. Periodically the stable code on the `dev` branch will be merged into the `main` branch by creating a PR from `dev`. Hence, every feature that should be committed to the `main` branch mus first run without issues on the `dev` branch for some time. + +Before contributing to this repository make sure that you are identifiable in your git user settings. This way commits and PRs created by you can be identified and easily traced back. + +```[bash] +git config --local user.name "Manu Musterperson" +git config --local user.email "manu@musterperson.org" +``` + +Any commit should always contain a commit message that references an issue created in the project. Also, always signoff on your commits for identification reasons. + +```[bash] +git commit -m "Fixed issue #123" --signoff +``` + +When doing pair programming be sure to always have all SDs mentioned in the commit message. Each SD should be listed on a new line for clarity reasons. + +```[bash] +git commit -a -m "Fixed problem #123 +> Co-authored-by: Manu Musterperson " +``` + +### License + +This project is operated under an MIT license. Every file must contain the REUSE-compliant license and copyright declaration: + +```[bash] +# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: 2023 +``` + +### Pre-Commit Hooks + +This repository uses `pre-commit` hooks to ensure a consistent and clean file organization. Each registered hook will be executed when committing to the repository. To ensure that the hooks will be executed they need to be installed using the following command: + +```[bash] +pre-commit install +``` + +The following things are done by hooks automatically: - * **bugfix**: It contains bug fixing during the testing phase and branch name start with the issue number for example "bugfix/3-validate-for-wrong-user-name" \ No newline at end of file +- formatting of python files using black and isort +- formatting of other files using prettier +- syntax check of JSON and yaml files +- adding new line at the end of files +- removing trailing whitespaces +- prevent commits to `dev` and `main` branch +- check adherence to REUSE licensing format From b8161f57aa769cdbc5d0035d1945e3ed9323d646 Mon Sep 17 00:00:00 2001 From: Felix Zailskas Date: Wed, 25 Oct 2023 09:28:17 +0200 Subject: [PATCH 2/3] Fixed typo from code review. Signed-off-by: Felix Zailskas --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3adf317..28bd24b 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ When you have any issues with the environment contact `felix-zailskas`. ### Commits and Pull Requests -The stable branches `main` and `dev` are protected against direct pushes. To commit code to these branches create a pull request (PR) describing the feature/bugfix that you are committing to the `dev` branch. This PR will then be reviewed by another SD from the project. Only after being approved by another SD a PR may be merged into the `dev` branch. Periodically the stable code on the `dev` branch will be merged into the `main` branch by creating a PR from `dev`. Hence, every feature that should be committed to the `main` branch mus first run without issues on the `dev` branch for some time. +The stable branches `main` and `dev` are protected against direct pushes. To commit code to these branches create a pull request (PR) describing the feature/bugfix that you are committing to the `dev` branch. This PR will then be reviewed by another SD from the project. Only after being approved by another SD a PR may be merged into the `dev` branch. Periodically the stable code on the `dev` branch will be merged into the `main` branch by creating a PR from `dev`. Hence, every feature that should be committed to the `main` branch must first run without issues on the `dev` branch for some time. Before contributing to this repository make sure that you are identifiable in your git user settings. This way commits and PRs created by you can be identified and easily traced back. @@ -82,6 +82,8 @@ git commit -a -m "Fixed problem #123 This project is operated under an MIT license. Every file must contain the REUSE-compliant license and copyright declaration: +[REUSE documentation](https://reuse.software/) + ```[bash] # SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2023 From c3568939fbe54a22c59c6cc6ee89a707f4295efd Mon Sep 17 00:00:00 2001 From: Felix Zailskas Date: Wed, 25 Oct 2023 09:54:46 +0200 Subject: [PATCH 3/3] Added missing # Signed-off-by: Felix Zailskas --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 89e47ae..0f71bda 100644 --- a/Pipfile +++ b/Pipfile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -SPDX-FileCopyrightText: 2023 Felix Zailskas +# SPDX-FileCopyrightText: 2023 Felix Zailskas [[source]] url = "https://pypi.python.org/simple"