diff --git a/docs/contributing/adding_content.md b/docs/contributing/adding_content.md new file mode 100644 index 0000000..7d85cbb --- /dev/null +++ b/docs/contributing/adding_content.md @@ -0,0 +1,105 @@ +# [Adding Content](#adding-content) + +## Introduction + +> This document will guide you through the process of adding a new page to the +> handbook. + +!!! tip + + The handbook is built using [MkDocs](https://www.mkdocs.org/) and [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/). + These tools also have extensive documentation and guides for contributing to a Mkdocs project. + + Please refer to their respective documentation **first** for any questions you might have. + +## Adding Content to the Documentation + +The documentation is written in Markdown and can be found in the `docs` directory. + +Here are the steps to add new content to the documentation: + +### 1. Create a branch for your changes + +??? note "Note: Naming your branch" + A branch is a way to work on a new feature or bug fix without affecting the main branch. + The standard for this project is to use the following format: + + ```console + $ / + OR + $ / + ``` + Where `` can be a GitHub username or an alias. + + `` is a short description of the changes you are making. + `` is the number of the issue you are working on. + + For example: + + ```console + $ jjjermiah/adding-getting-started-page + OR + $ jjjermiah/13-docs-finish-tutorial-for-page-review + ``` + +To **create a new branch and switch to it**, run the following command: + +```console +git checkout -b +$ git checkout -b jjjermiah/adding-getting-started-page +``` + +If you already have a named branch, you can switch to it with the following command: + +```console +git switch jjjermiah/adding-getting-started-page +``` + +### 2. Add your new content to the `docs` directory + +??? question "How do I know where to create my file?" + + This will create an empty Markdown file called `my_new_page.md` in the `docs/onboarding` directory. + The relative path to the `docs` directory, will be the link to your new page.
+ i.e the link to your new page will be `/handbook/onboarding/my_new_page/` + +Let's say you want to add a new page to the `Onboarding` section. +You would add a new file to the `docs/onboarding` directory. + +```console +$ touch docs/onboarding/my_new_page.md +You should now see a new file at `docs/onboarding/my_new_page.md`. +``` + +To learn more about how to actually write content, see the [HandBook MkDocs Page][mkdocs] and +[Handbook Markdown page][markdown]. + +### 3. Preview your changes + +The following is a [`pixi task`](https://pixi.sh/latest/features/advanced_tasks/) +that will start a local server and preview the documentation at `http://localhost:8000`. + +```console +$ pixi run serve +INFO - Building documentation... +INFO - Cleaning site directory +... +INFO - [08:55:05] Serving on http://127.0.0.1:8000/handbook/ +``` + +You should see your changes appear at `http://127.0.0.1:8000/handbook/onboarding/my_new_page/` + +### 4. Commit and push your changes to your branch + +```console +git add . +git commit -m "Add new getting started page" +git push --set-upstream origin jjjermiah/adding-getting-started-page +``` + +### 5. Create a PR + +Create a pull request (PR) to merge your changes into the main branch. +Request a review from a maintainer. + +See [the section on Reviewing a Contribution][reviewing-a-contribution] for more information. diff --git a/docs/contributing/changelog.md b/docs/contributing/changelog.md new file mode 100644 index 0000000..0324420 --- /dev/null +++ b/docs/contributing/changelog.md @@ -0,0 +1,5 @@ +# Framework Changes Over Time + +{% + include-markdown "../../CHANGELOG.md" +%} diff --git a/docs/contributing/conventional_commits.md b/docs/contributing/conventional_commits.md new file mode 100644 index 0000000..6596b87 --- /dev/null +++ b/docs/contributing/conventional_commits.md @@ -0,0 +1,43 @@ +# [Convential Commits](#convential-commits) + +We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for commit messages. This helps us automate our release process and keep our commit history clean. + +This style is mandatory for [merging pull requests][modify-the-commit-message-as-needed] on the handbook, but are recommended for all commits. + +The main points are summarized below, but you can read the full spec [here](https://www.conventionalcommits.org/en/v1.0.0/). + +## Commit Message Format + +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a ``, a `` and a ``: + +``` +[optional scope]: + +[optional body: explains motivation for the change] + +[optional footer(s): note BREAKING CHANGES here, and issues to be closed] +``` + +The `` of the header is optional and provides context for where the change was made. It can be anything relevant to your package or development workflow (e.g., it could be the module or function - name affected by the change). + +`` refers to the kind of change made and is usually one of: + +- `feat`: A new feature. +- `fix`: A bug fix. +- `docs`: Documentation changes. +- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc). +- `refactor`: A code change that neither fixes a bug nor adds a feature. +- `perf`: A code change that improves performance. +- `test`: Changes to the test framework. +- `build`: Changes to the build process or tools. +- `ci`: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) +- `chore`: Other changes that don't modify src or test files + +Other types may be defined per project, but these are the most common. + + +## Sources + +1. [Angular Commit Format Reference Sheet - Brian Clements](https://gist.github.com/brianclements/841ea7bffdb01346392c) +2. [Origin of Angular Commit Style - AngularJS Git Commit Guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) +3. [Py-Pkgs tutorial - Automatic version bumping using Angular Commit Style](https://py-pkgs.org/en/latest/development/commit-guidelines.html) \ No newline at end of file diff --git a/docs/contributing/images/better_pr_body.png b/docs/contributing/images/better_pr_body.png new file mode 100644 index 0000000..9ecf1e3 Binary files /dev/null and b/docs/contributing/images/better_pr_body.png differ diff --git a/docs/contributing/images/merge_commit.png b/docs/contributing/images/merge_commit.png new file mode 100644 index 0000000..79b756c Binary files /dev/null and b/docs/contributing/images/merge_commit.png differ diff --git a/docs/contributing/images/squash-merge.png b/docs/contributing/images/squash-merge.png new file mode 100644 index 0000000..f25ee7c Binary files /dev/null and b/docs/contributing/images/squash-merge.png differ diff --git a/docs/contributing/images/squash_merge.png b/docs/contributing/images/squash_merge.png new file mode 100644 index 0000000..50ce1b4 Binary files /dev/null and b/docs/contributing/images/squash_merge.png differ diff --git a/docs/contributing/images/submitting-issues.png b/docs/contributing/images/submitting-issues.png new file mode 100644 index 0000000..f733b34 Binary files /dev/null and b/docs/contributing/images/submitting-issues.png differ diff --git a/docs/contributing/images/update_pr_info.png b/docs/contributing/images/update_pr_info.png new file mode 100644 index 0000000..cda79b8 Binary files /dev/null and b/docs/contributing/images/update_pr_info.png differ diff --git a/docs/contributing/index.md b/docs/contributing/index.md new file mode 100644 index 0000000..9fedc99 --- /dev/null +++ b/docs/contributing/index.md @@ -0,0 +1,80 @@ +# Contributing to the Framework + +*Thank you for your interest in contributing to the Responsible AI Framework!* + +This section will guide you through the process of setting up your +development environment, installing dependencies, and building the documentation. + +## Contributing Principles + +### KISS - Keep It Simple, Stupid + +(or Keep It Short and Simple) + +- We strive to keep the handbook **focused** and **concise** to make it easy for anyone to understand +- We **avoid unnecessary complexity** + +### DRY - Don't Repeat Yourself + +- Saves **time** and **energy** +- If details already exist on another page or website, **link to it**, don’t copy paste +- When making a page, remember it might get referred to somewhere else! + +## For Contributors + +Below are some common questions to help you find the right guidance for specific +contributing tasks. + +### Where should I start if I want to contribute? + +If you’re new to contributing, start with the **[Prerequisites](prerequisites.md)** +page to set up your environment and install necessary dependencies. + +--- + +### How do I submit an issue for a problem I found? + +If you’ve identified an issue, refer to the +**[Submitting Issues](submitting_issues.md)** page.
It provides details on +how to use our issue templates and submit effective bug reports or feature requests. + +--- + +### How can I add new content to the handbook? + +To learn about adding or editing content, check out the +**[Adding Content](adding_content.md)** page.
This guide explains how to +structure and format your additions to fit seamlessly into the handbook. + +--- + +### What steps are involved in the review process? + +The **[Reviewing a Contribution](reviews.md)** page outlines the review process, +including best practices for constructive feedback and steps for both reviewers +and contributors. + +--- + +### Where can I view all the changes made to the handbook? + +To see recent updates and changes to the documentation, visit the +**[Changelog](changelog.md)** page for a record of all documented changes. + +--- + +By following these resources, you'll have everything you need to contribute +effectively to the Lab Handbook. If you have additional questions, feel free +to reach out to the maintainers or submit a question through the +**[Submitting Issues](submitting_issues.md)** page. + +--- + +## For Maintainers + +### How do I prepare for releasing and deploying changes? + +Check out the [Release & Deployment](release_deployment.md) page to learn +about our release procedures, automated workflows, and deployment to GitHub Pages. + +--- diff --git a/docs/contributing/prerequisites.md b/docs/contributing/prerequisites.md new file mode 100644 index 0000000..50c1109 --- /dev/null +++ b/docs/contributing/prerequisites.md @@ -0,0 +1,42 @@ +# [Prerequisites](#prerequisites) + +## [Installing Pixi](#installing-pixi) + +Pixi is a tool for managing conda environments and dependencies. +To install Pixi, visit the [Pixi website](https://pixi.sh/latest/) and follow the +instructions specific to your operating system. +The [Pixi documentation](https://pixi.sh/latest/) is an extensive resource for +learning how to use Pixi. + +Running the following command in your terminal should verify installation. + +```console +$pixi --version +pixi 0.34.0 +``` + +## [Cloning the Repository](#cloning-the-repository) + +To begin, clone the repository to your local machine using the following command: + +```console +$ git clone git@github.com:pmcdi/responsible-ai.git +Cloning into 'responsible-ai'... +.... +.... +.... +... +$ cd responsible-ai +``` + +## Installing Dependencies + +Once you have cloned the repository, navigate to the project directory and +install the dependencies: + +```console +$ pixi install +✔ The default environment has been installed. +``` + +This will install the dependencies specified in the `pixi.toml` file. diff --git a/docs/contributing/release_deployment.md b/docs/contributing/release_deployment.md new file mode 100644 index 0000000..a968b80 --- /dev/null +++ b/docs/contributing/release_deployment.md @@ -0,0 +1,52 @@ +# Release and Deployment + +## Introduction + +The framework website is hosted on [GitHub Pages](https://pages.github.com/). +This document provides a detailed overview of how the deployment and release +processes work, ensuring a smooth and automated workflow. + +## GitHub Pages + +GitHub Pages is a service that allows you to host static websites directly +from your GitHub repository. + +### How It Works + +Whenever changes are pushed to the `main` branch, a +[GitHub Action](https://github.com/features/actions) is triggered to +automatically build and deploy the website. + +You can view the build and deployment action at +[this link](https://github.com/pmcdi/responsible-ai/blob/main/.github/workflows/build_docs.yml). + +The automated workflow includes the following steps: + +1. **Check Out the Repository**: The GitHub Action checks out the latest code + from the `main` branch. +2. **Install Dependencies**: Dependencies specified in the `pixi.toml` file + are installed. +3. **Build the Documentation**: The action builds the site using MkDocs and + the configurations defined in your project. +4. **Deploy to GitHub Pages**: The compiled site is deployed to the `gh-pages` + branch. + +Once the `gh-pages` branch is updated, GitHub Pages will automatically publish +the latest version of the website. + +## Releases and Versioned Documentation + +We leverage [Python Semantic Release](https://github.com/python-semantic-release/python-semantic-release) +to automate the release process and manage versioned documentation, +making it easier to maintain version control, changelogs, and multiple +documentation versions. + +### How Releases Work + +When a pull request is merged into the `main` branch, a +[GitHub Action](https://github.com/features/actions) triggers the release +process. + +You can view the release automation action at +[this link](https://github.com/pmcdi/responsible-ai/blob/main/.github/workflows/semantic_release.yml). + diff --git a/docs/contributing/reviews.md b/docs/contributing/reviews.md new file mode 100644 index 0000000..ddfa2fe --- /dev/null +++ b/docs/contributing/reviews.md @@ -0,0 +1,51 @@ +# Reviewing a Contribution + +> **Note**: This document assumes there is an open Pull Request (PR) awaiting review. + +For more details, see the [GitHub Docs on Pull Requests with Required Reviews](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/approving-a-pull-request-with-required-reviews). + +## Introduction + +Once a contribution is submitted, a Pull Request (PR) must be created. Before merging into the main branch, the PR must undergo a review process. + +### Terminology + +- **Author**: The individual who submitted the contribution. +- **Reviewer**: The individual reviewing the contribution. +- **Maintainer**: The person responsible for merging the contribution after review. + +## Understanding a Review + +Reviews are discussions around the changes proposed in a PR. They allow for collaborative feedback, ensuring code quality and alignment with project standards. + +!!! tip + + Anyone can review a PR, including those who are not maintainers! + If you see a PR from another author, and have suggestions for improvement, + feel free to leave a review. + +For further reading, refer to the [Official GitHub Documentation on PR Reviews](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews). + +### Review Statuses + +When submitting a review, you can select from three statuses: + +1. **Comment**: Provide general feedback without explicitly approving or requesting changes. +2. **Approve**: Indicate that the changes are acceptable, and approve merging the PR. +3. **Request Changes**: Highlight issues that need to be addressed before the PR can be merged. + +## Requesting a Review for a Pull Request + +After creating a PR, you can request specific individuals or teams to review it. + +- Only members of the BHK Lab organization can request reviews from other members. + +For more information, check the [Official GitHub Documentation on Requesting a Pull Request Review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review). + +### Adding to an Existing Document + +If a document already exists, you can add to it. Check the bottom of the page for information on current authors. + +## Conclusion + +Effective reviews help ensure that contributions meet project standards, improve code quality, and facilitate knowledge sharing within the team. Whether you're an author, reviewer, or maintainer, understanding the review process is essential to contributing successfully. diff --git a/docs/contributing/submitting_issues.md b/docs/contributing/submitting_issues.md new file mode 100644 index 0000000..f91c61d --- /dev/null +++ b/docs/contributing/submitting_issues.md @@ -0,0 +1,64 @@ +# [Submitting Issues](#submitting-issues) + +## Introduction + +If you encounter any issues, have suggestions, or need clarifications about +the documentation, you can submit an issue directly on our GitHub repository. +We have a set of pre-defined issue templates to help categorize and address +your concerns efficiently. + +link: [Submit and view issues](https://github.com/pmcdi/responsible-ai/issues) + +## Available Issue Templates + +When creating a new issue, you will be presented with the following options: + + ![submitting-issues](images/submitting-issues.png) + +1. **Documentation Bug Report** + + Use this template to report any errors or inconsistencies in the existing + documentation. This could include typos, broken links, incorrect information, + or anything that does not match the expected content. + +2. **Content Update Request** + + Choose this template if you need to request updates to existing content. + For example, if information is outdated or requires clarification, + use this template to suggest the necessary changes. + +3. **Documentation Question** + + Select this option to ask questions or seek clarification about specific + parts of the documentation. This is useful if you are unsure about how + certain sections apply to your work or if you need additional details + on a topic. + +4. **Documentation Enhancement Request** + + This template is for suggesting new content or improvements to existing + sections. If you think the documentation can be expanded or restructured + to better serve the users, please use this option. + +## How to Submit an Issue + +1. Go to the GitHub repository and navigate to the "Issues" tab. +2. Click on the "New Issue" button. +3. Select the appropriate issue template from the list +4. Fill out the template, providing as much detail as possible to help us + understand and address your issue. +5. Submit the issue. + +For any issues that do not fit the existing templates, you can +also select **Open a blank issue** to describe your concern freely. + +## Tips for Submitting Effective Issues + +- **Be Clear and Concise**: Provide a detailed description but be direct. + Clear and specific information helps us address your issue faster. +- **Include Links and Screenshots**: If the issue relates to a specific + section, page, or example, include links and screenshots to provide context. +- **Suggest Solutions**: If you have an idea on how to fix or improve the + issue, let us know! Your suggestions can help expedite the process. + +Your feedback is invaluable, and we diff --git a/mkdocs.yml b/mkdocs.yml index 8dea1a1..643d24d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -31,7 +31,15 @@ nav: - '[4] Deployment and Trials': appendix/4_deploy.md - '[5] Operationalization': appendix/5_monitor.md - References: references.md - - Changelog: changelog.md + - Contributing: + - contributing/index.md + - contributing/prerequisites.md + - contributing/submitting_issues.md + - contributing/adding_content.md + - contributing/reviews.md + - contributing/conventional_commits.md + - contributing/release_deployment.md + - contributing/changelog.md plugins: - search