From 0acfed69668610400fe7c35cde3e42b6ec4aa2e4 Mon Sep 17 00:00:00 2001 From: prasadtalasila Date: Sat, 14 Dec 2024 22:13:43 +0100 Subject: [PATCH] Adds guidelines --- CODE_OF_CONDUCT.md | 128 ++++++++++++++++++++++++++++++ CONTRIBUTING.md | 172 ++++++++++++++++++++++++++++++++++++++++ docs/developer/index.md | 44 +++++++--- 3 files changed, 334 insertions(+), 10 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..3276197f4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# 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 responsible for enforcement at +Open new issue. +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. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..d00d614d5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,172 @@ +# Contributors Guide + +Welcome to the Digital Twin as a Service (DTaaS) contributing guide + +Thank you for investing your time in contributing to our project! + +Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community +approachable and respectable. + +In this guide you will get an overview of the contribution workflow +from opening an issue, creating a PR, reviewing, and merging the PR. + +## Project Goals + +It helps development team members get familiar with +the DTaaS project software design, and development processes. +Please see developer-specific +[Slides](https://odin.cps.digit.au.dk/into-cps/dtaas/assets/DTaaS-developer-overview_march2024.pdf), +[Video](https://odin.cps.digit.au.dk/into-cps/dtaas/assets/videos/DTaaS-developer-overview_march2024.mp4), +and [Research paper](https://arxiv.org/abs/2305.07244). + +## :computer: Development Environment + +Please use the steps given here to have suitable development +environment. + +### DevContainers + +There is a [devcontainer configuration](.devcontainer/devcontainer.json) +for the project. Please use it to get a dockerized development environment. +DevContainer is the easiest way to get started. + +### Ubuntu/Linux + +The code base has been developed for most part on +Ubuntu/Linux Operating System.Thus certain parts of the code base might +have bugs when run on Windows. At the moment, only +[runner](./servers/execution/runner/DEVELOPER.md) has problems running +on non-Linux OS. + +The development environment can be installed by using the following +scripts. + +```bash +bash script/env.sh +bash script/docker.sh +``` + +:warning: The docker images are large and are likely to consume +about 5GB of bandwidth and 15GB of space. +You will have to download the docker images on a really good network. + +### Windows + +The development environment scripts for Windows are still buggy. +Any help in improving them is greatly appreciated. +Given that, caveat, please use the following installation steps +for Windows. + +Two powershell installation scripts, namely `base.ps1` and `env.ps1` +are available to install the required +software packages. But errors might crop up due to missing +environment variables. The potential errors are: + +1. `npm is not recognized.........` in `base.ps1`. +1. `gem is not recognized.........` in `env.ps1` + +If you encounter these errors, +remember to include _node_ and _ruby_ installation locations in +**PATH** environment variable +(`Settings --> search for "system environment variables"` +`--> Advanced --> Environment Variables --> PATH`). + +The `base.ps1` and `env.ps1` scripts can be run again after setting +the correct **PATH** environment variable. + +#### Pre-install Nodejs and Ruby Software + +Another way to solve the **PATH** environment problem is to +install Nodejs and Ruby software packages before running the powershell +scripts. + +1. Install the latest stable version of NodeJS from the + [official NodeJS website](https://nodejs.org/en). +1. Install Ruby from + [official Ruby website](https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.2-1/rubyinstaller-devkit-3.1.2-1-x64.exe) + and follow all the defaults during the installation. + +#### Run Scripts + +Then, open powershell with **administrative** priviledges and run the +following commands in the given order: + +```bash +powershell -F script/base.ps1 +powershell -F script/env.ps1 +powershell -F script/docker.ps1 +``` + +:warning: The docker images are large and are likely to consume +about 5GB of bandwidth and 15GB of space. +You will have to download the docker images on a really good network. + +## :building_construction: Development Workflow + +To manage collaboration by multiple developers on the software, +a development workflow is in place. Each developer should follow these steps: + +1. Fork of the main repository into your github account. +1. Setup + [Code Climate](https://docs.codeclimate.com/docs/getting-started-with-code-climate) + and + [Codecov](https://docs.codecov.com/docs/quick-start) + for your fork. The codecov does not require secret token + for public repositories. +1. Install git-hooks for the project. +1. Use + [Fork, Branch, PR](https://gun.io/news/2017/01/how-to-github-fork-branch-and-pull-request/) + workflow. +1. Work in your fork and open a PR from your working + branch to your `feature/distributed-demo` branch. + The PR will run all the github actions, code climate and codecov checks. +1. Resolve all the issues identified in the previous step. +1. Once changes are verified, a PR should be made to + the `feature/distributed-demo` branch of + the upstream + [DTaaS repository](https://github.com/into-cps-association/DTaaS). +1. The PR will be merged after checks by either the + project administrators or the maintainers. + +Remember that every PR should be meaningful and satisfies +a well-defined user story or improve +the code quality. + +## :eye: Code Quality + +The project code qualities are measured based on: + +- Linting issues identified by + [Code Climate](https://codeclimate.com/github/INTO-CPS-Association/DTaaS) +- Test coverage report collected by + [Codecov](https://codecov.io/gh/INTO-CPS-Association/DTaaS) +- Successful [github actions](https://github.com/INTO-CPS-Association/DTaaS/actions) + +### Code Climate + +Code Climate performs static analysis, linting and style checks. +Quality checks are performed by codeclimate are to ensure the best +possible quality of code to add to our project. + +While any new issues introduced in your code would be +shown in the PR page itself, to address any specific issue, +you can visit the issues or code section of the codeclimate page. + +It is highly recommended that any code you add does +not introduce new quality issues. If they are introduced, +they should be fixed immediately using the appropriate suggestions +from Code Climate, or in worst case, adding a ignore flag +(To be used with caution). + +### Codecov + +Codecov keeps track of the test coverage for the entire project. +For information about testing and workflow related to that, +please see the [testing page](testing/intro.md). + +### Github Actions + +The project has multiple +[github actions](https://github.com/INTO-CPS-Association/DTaaS/tree/feature/distributed-demo/.github/workflows) +defined. All PRs and direct code commits must have successful +status on github actions. diff --git a/docs/developer/index.md b/docs/developer/index.md index 0b6354ba9..d00d614d5 100644 --- a/docs/developer/index.md +++ b/docs/developer/index.md @@ -1,6 +1,17 @@ -# Developer Guide +# Contributors Guide + +Welcome to the Digital Twin as a Service (DTaaS) contributing guide + +Thank you for investing your time in contributing to our project! + +Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community +approachable and respectable. + +In this guide you will get an overview of the contribution workflow +from opening an issue, creating a PR, reviewing, and merging the PR. + +## Project Goals -This guide is for DTaaS platform developers. It helps development team members get familiar with the DTaaS project software design, and development processes. Please see developer-specific @@ -10,15 +21,26 @@ and [Research paper](https://arxiv.org/abs/2305.07244). ## :computer: Development Environment -Ideally, developers should work on Ubuntu/Linux Operating System.There is -an ongoing effort -to bring support for Windows Operating System. But, the development and -software installation scripts are still heavily suited to Ubuntu/Linux +Please use the steps given here to have suitable development +environment. -Please use the steps given here to install the required software packages. +### DevContainers + +There is a [devcontainer configuration](.devcontainer/devcontainer.json) +for the project. Please use it to get a dockerized development environment. +DevContainer is the easiest way to get started. ### Ubuntu/Linux +The code base has been developed for most part on +Ubuntu/Linux Operating System.Thus certain parts of the code base might +have bugs when run on Windows. At the moment, only +[runner](./servers/execution/runner/DEVELOPER.md) has problems running +on non-Linux OS. + +The development environment can be installed by using the following +scripts. + ```bash bash script/env.sh bash script/docker.sh @@ -30,6 +52,11 @@ You will have to download the docker images on a really good network. ### Windows +The development environment scripts for Windows are still buggy. +Any help in improving them is greatly appreciated. +Given that, caveat, please use the following installation steps +for Windows. + Two powershell installation scripts, namely `base.ps1` and `env.ps1` are available to install the required software packages. But errors might crop up due to missing @@ -94,9 +121,6 @@ a development workflow is in place. Each developer should follow these steps: branch to your `feature/distributed-demo` branch. The PR will run all the github actions, code climate and codecov checks. 1. Resolve all the issues identified in the previous step. -1. If you have access to the - [integration server](https://github.com/INTO-CPS-Association/DTaaS/wiki/DTaaS-Integration-Server), - try your working branch on the integration server. 1. Once changes are verified, a PR should be made to the `feature/distributed-demo` branch of the upstream