From b9332e112e452a39cc7c6c8a964d148f0606fba2 Mon Sep 17 00:00:00 2001 From: Konrad `ktoso` Malawski Date: Thu, 16 Feb 2023 09:35:48 +0900 Subject: [PATCH 1/3] Update CoC and add CONTRIBUTING file --- CODE_OF_CONDUCT.md | 77 ++---------------------------------------- CONTRIBUTING.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 74 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 02669a1..76501d7 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,76 +1,5 @@ -# Contributor Covenant Code of Conduct +# Code of Conduct -## Our Pledge +The code of conduct for this project can be found at https://swift.org/code-of-conduct. -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, sex characteristics, 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 swifttracing@slashmo.codes. 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 - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c3399ba --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,83 @@ +## Legal + +By submitting a pull request, you represent that you have the right to license +your contribution to Apple and the community, and agree by submitting the patch +that your contributions are licensed under the Apache 2.0 license (see +`LICENSE.txt`). + +## How to submit a bug report + +Please ensure to specify the following: + +* Swift Distributed Tracing commit hash +* Contextual information (e.g. what you were trying to achieve with Swift Distributed Tracing) +* Simplest possible steps to reproduce + * More complex the steps are, lower the priority will be. + * A pull request with failing test case is preferred, but it's just fine to paste the test case into the issue description. +* Anything that might be relevant in your opinion, such as: + * Swift version or the output of `swift --version` + * OS version and the output of `uname -a` + * Network configuration + +### Example + + ``` + Commit hash: b17a8a9f0f814c01a56977680cb68d8a779c951f + Context: + While testing my application that uses with Swift Distributed Tracing, I noticed that ... + Steps to reproduce: + 1. ... + 2. ... + 3. ... + 4. ... + $ swift --version + Swift version 4.0.2 (swift-4.0.2-RELEASE) + Target: x86_64-unknown-linux-gnu + Operating system: Ubuntu Linux 16.04 64-bit + $ uname -a + Linux beefy.machine 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux + My system has IPv6 disabled. + ``` + +## Writing a Patch + +A good patch is: + +1. Concise, and contains as few changes as needed to achieve the end result. +2. Tested, ensuring that any tests provided failed before the patch and pass after it. +3. Documented, adding API documentation as needed to cover new functions and properties. +4. Accompanied by a great commit message, using our commit message template. + +### Commit Message Template + +We require that your commit messages match our template. The easiest way to do that is to get git to help you by explicitly using the template. To do that, `cd` to the root of our repository and run: + + git config commit.template dev/git.commit.template + +### Run `./scripts/soundness.sh` + +The scripts directory contains a [soundness.sh script](https://github.com/apple/swift-distributed-tracing/blob/main/scripts/soundness.sh) +that enforces additional checks, like license headers and formatting style. + +Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail +on minor changes such as a missing `self.` or similar formatting issues. + +> The script also executes the above mentioned `generate_linux_tests.rb`. +For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command in the project root directory: + + ```bash + cat << EOF > .git/hooks/pre-push + #!/bin/bash + if [[ -f "scripts/soundness.sh" ]]; then + scripts/soundness.sh + fi + EOF + ``` + +Which makes the script execute, and only allow the `git push` to complete if the check has passed. + +In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again. + +## How to contribute your work + +Please open a pull request at https://github.com/apple/swift-distributed-tracing. Make sure the CI passes, and then wait for code review. \ No newline at end of file From 68e15c2ab3da4e48816bd97bbb641207e5bb9cb9 Mon Sep 17 00:00:00 2001 From: Konrad `ktoso` Malawski Date: Thu, 16 Feb 2023 16:34:22 +0900 Subject: [PATCH 2/3] add commit template --- dev/git.commit.template | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 dev/git.commit.template diff --git a/dev/git.commit.template b/dev/git.commit.template new file mode 100644 index 0000000..1c17b80 --- /dev/null +++ b/dev/git.commit.template @@ -0,0 +1,14 @@ + + +**Motivation:** + + + +**Modifications:** + + + +**Result:** + + From b5ddbb2fea67fa7cc030f086fdb9bb8307f88f1e Mon Sep 17 00:00:00 2001 From: Konrad `ktoso` Malawski Date: Thu, 16 Feb 2023 19:18:01 +0900 Subject: [PATCH 3/3] Update CONTRIBUTING.md Co-authored-by: Moritz Lang --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3399ba..76a7f7f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Please ensure to specify the following: ``` Commit hash: b17a8a9f0f814c01a56977680cb68d8a779c951f Context: - While testing my application that uses with Swift Distributed Tracing, I noticed that ... + While testing my application that uses Swift Distributed Tracing, I noticed that ... Steps to reproduce: 1. ... 2. ...