Github Standards (#391)

This commit is contained in:
iranl
2024-06-07 13:23:09 +02:00
committed by GitHub
parent 552589a2c6
commit f42cede998
9 changed files with 395 additions and 0 deletions

54
.github/ISSUE_TEMPLATE/Bug_report.md vendored Normal file
View File

@@ -0,0 +1,54 @@
---
name: Problem Report
about: Create a Report to help us improve
---
<!-- Thanks for reporting a problem for this project. READ THIS FIRST:
This issue template is meant to REPORT Nuki Hub PROBLEMS ONLY
Please DO NOT OPEN AN ISSUE:
- If your Nuki Hub version is not the latest from the master branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Nuki Hub can be downloaded from https://github.com/technyon/nuki_hub/releases
- If your issue has been addressed before (i.e., duplicated issue), please ask in the original issue
Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.
DO NOT DELETE ANY TEXT from this template! Otherwise the issue will be auto-closed.
-->
### PROBLEM DESCRIPTION
_A clear and concise description of what the problem is._
### REQUESTED INFORMATION
_Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!_
- [ ] Read the [Contributing Guide and Policy](https://github.com/technyon/nuki_hub/blob/master/CONTRIBUTING.md) and [the Code of Conduct](https://github.com/technyon/nuki_hub/blob/master/CODE_OF_CONDUCT.md)
- [ ] Searched the problem in [issues](https://github.com/technyon/nuki_hub/issues)
- [ ] Searched the problem in [discussions](https://github.com/technyon/nuki_hub/discussions)
- [ ] Searched the problem in the [docs](https://github.com/technyon/nuki_hub)
- [ ] Searched the problem in the [chat](https://discord.gg/9nPq85bP4p)
- [ ] Device used (e.g., ESP32-S3): _____
- [ ] Nuki Hub binary firmware version number used: _____
- [ ] Pre-compiled
- [ ] Self-compiled
- [ ] Provide the output of http://nukihubIP/info:
```
### TO REPRODUCE
_Steps to reproduce the behavior:_
### EXPECTED BEHAVIOUR
_A clear and concise description of what you expected to happen._
### SCREENSHOTS
_If applicable, add screenshots to help explain your problem._
### ADDITIONAL CONTEXT
_Add any other context about the problem here._
**(Please, remember to close the issue when the problem has been addressed)**

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Nuki Hub Readme
url: https://github.com/technyon/nuki_hub
about: All the information related to Nuki Hub.
- name: Nuki Hub Discussions and Support
url: https://github.com/technyon/nuki_hub/discussions
about: Nuki Hub usage Questions, Feature Requests and Projects.
- name: Nuki Hub Users Chat
url: https://discord.gg/9nPq85bP4p
about: Chat for feedback, questions and troubleshooting.

12
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,12 @@
## Description:
**Related issue (if applicable):** fixes #<Nuki Hub issue number goes here>
## Checklist:
- [ ] The pull request is done against the latest master branch
- [ ] Only relevant files were touched
- [ ] Only one feature/fix was added per PR and the code change compiles without warnings
- [ ] The code change is tested and works
- [ ] I accept the [CLA](https://github.com/technyon/nuki_hub/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla).
_NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_

11
.github/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
# Anything higher than this threshold will be marked as toxic and commented on
sentimentBotToxicityThreshold: .7
# *Required* Comment to reply with
sentimentBotReplyComment: >
Please be sure to review the code of conduct and be respectful of other users.
# Note: the bot will only work if your repository has a Code of Conduct

50
.github/issue-close-app.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
# CLOSE ISSUE BOT
# ---------------
# A bot which helps you to close issues that don't include some specific contents.
# See how to use it in https://github.com/offu/close-issue-app.
# Comment that will be sent if an issue is judged to be closed.
comment: >-
This issue has been automatically closed because the PROBLEM REPORT TEMPLATE is missing or incomplete.
Filling the template is required so standard questions don't need to be asked again each time.
Our ability to provide assistance is greatly hampered if few minutes are not taken to complete the issue template
with the requested information. The details requested potentially affect which options to pursue. The small amount
of time you will spend completing the template will also help the volunteers, providing assistance to you, to reduce
the time required to help you.
Please, could you be so kind on completing the [PROBLEM REPORT TEMPLATE](https://github.com/technyon/nuki_hub/issues/new/choose) in order to have more information so as to properly help you?
Thank you for taking the time to report, hopefully it can be resolved soon.
[README](https://github.com/technyon/nuki_hub) for more information.
[Discussions](https://github.com/technyon/nuki_hub/discussions) for Questions, Feature Requests and Projects.
[Chat](https://discord.gg/9nPq85bP4p) for more users experience.
Please check the [Code of Conduct](https://github.com/technyon/nuki_hub/blob/master/CODE_OF_CONDUCT.md) and the [Contributing Guideline and Policy](https://github.com/technyon/nuki_hub/blob/master/CONTRIBUTING.md)
issueConfigs:
# There can be several configs for different kind of issues.
- content:
# template 1: bug report
- "PROBLEM DESCRIPTION"
- "REQUESTED INFORMATION"
- "TO REPRODUCE"
- "EXPECTED BEHAVIOUR"
- content:
# template 2: feature request
- "Have you looked for this feature in other issues and in the docs"
- "Describe the solution you'd like"
# Optional configuration:
#
# whether the keywords are case-insensitive
# default value is false, which means keywords are case-sensitive
caseInsensitive: true
# the label that will be added when the bot close an issue
# The bot will only add a label if this property is set.
label: "template missing/incomplete"
# The issue is judged to be legal if it includes all keywords from any of these two configs.
# Or it will be closed by the app.

21
.github/workflows/stale-actions.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: "Mark or close stale issues and PRs"
on:
schedule:
- cron: "30 * * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 45
days-before-close: 15
stale-issue-message: "This issue has been automatically marked as stale because it hasn't had any activity in the last few weeks. It will be closed if no further activity occurs. Thank you for your contributions."
stale-pr-message: "This PR has been automatically marked as stale because it hasn't had any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions."
close-issue-message: "This issue was automatically closed because of being stale. Feel free to reopen if you still experience this problem."
close-pr-message: "This PR was automatically closed because of being stale."
stale-pr-label: "stale"
stale-issue-label: "stale"
exempt-issue-labels: "bug,enhancement,pinned,security"
exempt-pr-labels: "bug,enhancement,pinned,security"

129
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,129 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

102
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,102 @@
# Contributing
**Any contribution helps make Nuki Hub better for the entire community!**
Everybody is welcome and invited to contribute to Nuki Hub by:
* Testing newly released features and reporting issues.
* Providing Pull Requests (Features, Proof of Concepts, Language files or Fixes)
* Contributing missing documentation for features and devices
This document describes rules that are in effect for this repository, meant for handling issues by contributors in the issue tracker and PRs.
## Opening New Issues
**Issue tracker is NOT a general discussion forum!**
1. Opening an issue means that a problem exists in the code and should be addressed by the project contributors.
2. When opening an issue, it is required to fill out the presented template. The requested information is important! If the template is ignored or insufficient info about the issue is provided, the issue may be closed.
3. Questions of type "How do I..." or "Can you please help me with..." or "Can Nuki Hub do..." WILL NOT be handled here. Such questions should be directed at a discussion forum or on Discord. All issues of this type will be closed with a simple reference to this contributing policy.
4. Issues about topics already handled in the documentation will be closed in a similar manner.
5. Issues for unmerged PRs will be closed. If there is an issue with a PR, the explanation should be added to the PR itself.
6. Issues with accompanied investigation that shows the root of the problem should be given priority.
7. Duplicate issues will be closed.
## Triaging of Issues/PR's
1. Any contributor to the project can participate in the triaging process, if he/she chooses to do so.
2. An issue that needs to be closed, either due to not complying with this policy, or for other reasons, should be closed by a contributor.
3. Issues that are accepted should be marked with appropriate labels.
4. Issues that could impact functionality for many users should be considered severe.
5. Issues caused by the SDK or chip should not be marked severe, as there usually isnt much to be done. Common sense should be applied when deciding. Such issues should be documented in the Wiki, for reference by users.
6. Issues with feature requests should be discussed for viability/desirability.
7. Feature requests or changes that are meant to address a very specific/limited use case, especially if at the expense of increased code complexity, may be denied, or may be required to be redesigned, generalized, or simplified.
8. Feature requests that are not accompanied by a PR:
* could be closed immediately (denied).
* could be closed after some predetermined period of time (left as candidate for somebody to pick up).
9. In some cases, feedback may be requested from the issue reporter, either as additional info for clarification, additional testing, or other. If no feedback is provided, the issue may be closed by a contributor or after 45 days by the STALE bot.
## Pull requests
A Pull Request (PR) is the process where code modifications are managed in GitHub.
The process is straight-forward.
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0)
- Fork the Nuki Hub Repository [git repository](https://github.com/technyon/nuki_hub).
- Write/Change the code in your Fork for a new feature, bug fix, new sensor, optimization, etc.
- Ensure tests work.
- Create a Pull Request against the [**master**](https://github.com/technyon/nuki_hub/tree/master) branch of Nuki Hub.
1. All pull requests must be done against the master branch.
2. Only relevant files should be touched (Also beware if your editor has auto-formatting feature enabled).
3. Only one feature/fix should be added per PR.
4. PRs that don't compile (fail in CI Tests) or cause coding errors will not be merged. Please fix the issue. Same goes for PRs that are raised against older commit in development - you might need to rebase and resolve conflicts.
5. All pull requests should undergo peer review by at least one contributor other than the creator, excepts for the owner.
6. All pull requests should consider updates to the documentation.
7. Pull requests that address an outstanding issue, particularly an issue deemed to be severe, should be given priority.
8. If a PR is accepted, then it should undergo review and updated based on the feedback provided, then merged.
9. By submitting a PR, it is needed to use the provided PR template and check all boxes, performing the required tasks and accepting the CLA.
10. Pull requests that don't meet the above will be denied and closed.
--------------------------------------
## Contributor License Agreement (CLA)
```
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the MIT license; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the MIT license; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it) is maintained indefinitely
and may be redistributed consistent with this project or the open
source license(s) involved.
```
This Contributor License Agreement (CLA) was adopted on June 6st, 2024.
To accept the CLA it is required to put a x between [ ] on `[ ] I accept the CLA` in the PR template when submitting it. The [ ] is an opt-in box, so you have to manually accept it.
**Why a CLA ?**
_"A Contributor License Agreement (CLA) is strongly recommended when accepting third party contributions to an open development project, such as an open source software project. In order to redistribute contributions, it is necessary to ensure that the project has the necessary rights to do so. A Contributor License Agreement is a lightweight agreement, signed by the copyright holder, that grants the necessary rights for the contribution to be redistributed as part of the project."_ [OSS Watch](http://oss-watch.ac.uk/resources/cla)
A CLA is a legal document in which you state _you are entitled to contribute the code/documentation/translation to the project_ youre contributing to and that _you are willing to have it used in distributions and derivative works_. This means that should there be any kind of legal issue in the future as to the origins and ownership of any particular piece of code, then that project has the necessary forms on file from the contributor(s) saying they were permitted to make this contribution.
CLA is a safety because it also ensures that once you have provided a contribution, you cannot try to withdraw permission for its use at a later date. People can therefore use that software, confident that they will not be asked to stop using pieces of the code at a later date.
A __license__ grants "outbound" rights to the user of project.
A __CLA__ enables a contributor to grant "inbound" rights to a project.

5
SECURITY.md Normal file
View File

@@ -0,0 +1,5 @@
# Security Policy
## Reporting a Vulnerability
Please report security issues at [Github](https://github.com/technyon/nuki_hub/issues)