From 709658b7f8a3bd844788a02f739f81682f34181d Mon Sep 17 00:00:00 2001 From: bogdan-rosianu Date: Fri, 22 Jul 2022 13:39:48 +0300 Subject: [PATCH 1/2] EN-12514: github community standards --- .github/CODE_OF_CONDUCT.md | 74 ++++++++++++++++++++++ .github/CONTRIBUTING.md | 44 +++++++++++++ .github/ISSUE_TEMPLATE/bug-report.md | 19 ------ .github/ISSUE_TEMPLATE/bug-report.yml | 59 +++++++++++++++++ .github/ISSUE_TEMPLATE/feature-request.yml | 45 +++++++++++++ .github/ISSUE_TEMPLATE/feature.md | 12 ---- .github/ISSUE_TEMPLATE/question.md | 12 ---- .github/ISSUE_TEMPLATE/question.yml | 24 +++++++ .github/PULL_REQUEST_TEMPLATE.md | 14 ++++ 9 files changed, 260 insertions(+), 43 deletions(-) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature.md delete mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/ISSUE_TEMPLATE/question.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..9647b1ebb15 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers 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, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at contact@elrond.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000000..0efa31900af --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,44 @@ + +# Contributing to elrond-go + +If you are unfamiliar with the workflow of contributing to github, you can refer to this [this article](https://github.com/firstcontributions/first-contributions/blob/master/README.md) + +## Fork & clone this repository + +The development should happen in a personal fork, cloned on the local machine. + +## Use development branch + +External contributions should happen against the `development` branch. + +Other branches may be used by the team members in accordance to internal decisions. + +## Use linter + +Make sure the code is well-formatted and aligned before opening a PR. Some linters such `gofmt` can be used, or code style +can be proactively checked while written code when using an IDE. + +## Writing tests + +In case of adding a new feature, make sure you follow these guidelines: +- Attempt to write some unit tests which verify the component in isolation and mock the external components around it +- If the component relies on many other external components which are difficult to mock, write integrations tests for it +- Try to cover both expected functionality but also verify that the code fails in expected ways + +In case of fixing a bug: +- Try to first write the unit test that exposes the bug, then fix it and have a test that will make sure the specific situation will always be tested in the future + +In both cases, make sure that the new code has a good code coverage (ideally, 100% of the new lines are covered) and also try to cover edge-cases. + +## Make sure the tests pass + +Before opening a Pull Request, make sure that all tests pass. One can run the following commands before opening a pull request: +- `make test` + +## Manual testing + +Although the nominal use case looks good, the linter runs without issues, as well as the unit & integration tests pass without any error, some unforeseen bugs may arise. + +Depending on the PR type, there are multiple ways of manual testing the new code: +- if it only affects an API, a log, or something not critical, one could sync a node with new code on Testnet or Devnet and see if everything works good. +- if the changes would affect the entire network (consensus, processing, and so on), a local testnet should be started. Also, make sure backwards compatibility is maintained. diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index aaf01666f98..00000000000 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Bug Report -about: Report a bug in elrond-go protocol -title: "[BUG]" -labels: bug -assignees: '' - ---- - - - -
-Executing details -
-Application version string: 
-Hosting VPS:  
-
-
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 00000000000..f68b8774acb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,59 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: [bug, triage] +assignees: + - members +body: + - type: markdown + attributes: + value: | + Thank you for taking the time to fill out this bug report! + - type: input + id: contact + attributes: + label: Contact Details + description: How can we get in touch with you if we need more info? + placeholder: ex. email@example.com + validations: + required: false + - type: input + id: description + attributes: + label: Description + description: A short, concise description of the problem + placeholder: Description + validations: + required: true + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to reproduce + description: A minimum list of steps for validating the behavior of the bug + validations: + required: false + - type: dropdown + id: network + attributes: + label: On which network is the bug manifesting itself? + multiple: true + options: + - Mainnet + - Devnet + - Testnet + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: sh + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ElrondNetwork/elrond-go/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 00000000000..e875886279d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,45 @@ +name: Feature Request +description: Add new feature request +title: "[Feature Request]: " +labels: [feature request] +body: + - type: markdown + attributes: + value: | + Thank you for taking the time to fill out new feature request! + - type: textarea + id: describe-solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of the needed improvement. + validations: + required: true + - type: textarea + id: related-problem + attributes: + label: Is your feature request related to a problem? + description: A clear and concise description of what the problem is. + validations: + required: false + - type: textarea + id: alternative-problem + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + validations: + required: false + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. + validations: + required: false + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ElrondNetwork/elrond-go/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md deleted file mode 100644 index 109dec8be0f..00000000000 --- a/.github/ISSUE_TEMPLATE/feature.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Feature -about: Suggest a new feature for elrond-go -title: "[FEAT]" -labels: enhancement -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 01dfcedd2e4..00000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Question -about: Ask a question about elrond-go -title: "[QUESTION]" -labels: '' -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 00000000000..c1923233e73 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,24 @@ +name: Question about the Elrond node +description: Ask a question +title: "[Question]: " +labels: [question] +body: + - type: markdown + attributes: + value: | + Thank you for taking the time to fill out the question form! For a faster response, please use our validator's telegram page: https://t.me/ElrondValidators + - type: textarea + id: describe-solution + attributes: + label: Please write the desired question + description: What is misunderstood, not found on docs or anything similar. + validations: + required: true + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ElrondNetwork/elrond-go/blob/main/.github/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..2bad3c860d5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,14 @@ +## Description of the reasoning behind the pull request (what feature was missing / how the problem was manifesting itself / what was the motive behind the refactoring) +- +- +- + +## Proposed Changes +- +- +- + +## Testing procedure +- +- +- From 50cb97a97df6d11bf52cbc50210b7991d4f6fef2 Mon Sep 17 00:00:00 2001 From: bogdan-rosianu Date: Fri, 22 Jul 2022 15:52:38 +0300 Subject: [PATCH 2/2] fixes after review --- .github/CONTRIBUTING.md | 12 +++++++----- .github/ISSUE_TEMPLATE/bug-report.yml | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0efa31900af..c431b8b8c35 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -16,20 +16,22 @@ Other branches may be used by the team members in accordance to internal decisio ## Use linter Make sure the code is well-formatted and aligned before opening a PR. Some linters such `gofmt` can be used, or code style -can be proactively checked while written code when using an IDE. +can be proactively checked while writing code, when using an IDE. ## Writing tests In case of adding a new feature, make sure you follow these guidelines: -- Attempt to write some unit tests which verify the component in isolation and mock the external components around it -- If the component relies on many other external components which are difficult to mock, write integrations tests for it -- Try to cover both expected functionality but also verify that the code fails in expected ways +- write unit tests which verify the component in isolation and mock the external components around it; +- if the component relies on many other external components which are difficult to mock, write integrations tests for it; Although, this usually means that further decoupling using interfaces is required. Also, the component might needed to be split in smaller, specialized sub-components; +- cover both expected functionality but also verify that the code fails in expected ways. In case of fixing a bug: -- Try to first write the unit test that exposes the bug, then fix it and have a test that will make sure the specific situation will always be tested in the future +- write the unit test that exposes the bug, then fix it and have a test that will make sure the specific situation will always be tested in the future. In both cases, make sure that the new code has a good code coverage (ideally, 100% of the new lines are covered) and also try to cover edge-cases. +Please take care of the severity of the bug. Pushing directly a fix of an undiscovered, critical bug, or a bug that can be exploited in such a way that could create damage to the blockchain, loss of funds, state alteration beyond repair, and so on, can be exploited before the team can take any action. Please contact the team on private channels before pushing the fix if you have any doubts. + ## Make sure the tests pass Before opening a Pull Request, make sure that all tests pass. One can run the following commands before opening a pull request: diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index f68b8774acb..750eef27bb5 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -25,6 +25,22 @@ body: placeholder: Description validations: required: true + - type: input + id: version + attributes: + label: Node version + description: The version of the node used when discovering the bug + placeholder: v1.3.35.0-0-gfc78258fe/go1.17.6/linux-amd64 + validations: + required: false + - type: input + id: host + attributes: + label: Host machine + description: Specifications and other details about the host of the node + placeholder: DO, AWS, Contabo, no VPS (if you run your validator on a physical machine) + validations: + required: false - type: textarea id: steps-to-reproduce attributes: