Skip to content

Commit

Permalink
Prepare for open sourcing (#42)
Browse files Browse the repository at this point in the history
* Prepare for open sourcing

* Address comments

* Update README
  • Loading branch information
cicdguy authored May 24, 2022
1 parent 35e9861 commit 1ef4bb2
Show file tree
Hide file tree
Showing 15 changed files with 430 additions and 97 deletions.
118 changes: 118 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Contribution Guidelines

First of all, thank you for taking the time to contribute! ✌️ 🎉

We love your input regardless of its size, content or scope - whether it is an issue, feature request, bug-fix or documentation enhancement.

Thanks 🙏 You rock 🤘

## Table of contents

[👶 Getting started](#getting-started)

[📔 Code of Conduct](#code-of-conduct)

[🗃 License](#license)

[🐛 How to report a bug?](#how-to-report-a-bug)

[💡 How to request the change?](#how-to-request-the-change)

[🚩 How to submit a change?](#how-to-submit-a-change)

[👗 Style guide](#style-guide)

[🧐 Recognition model](#recognition-model)

[❓ Any questions](#any-questions)

## Getting started

For an introduction, please read [`README`](README.md) file. You can also find vignettes [here](vignettes/). Usually you will find a "Getting started" article. Please also see the package manual in the form of a `pkgdown` website.

## Code of Conduct

This project is governed by [Code of Conduct](../CODE_OF_CONDUCT.md). By participating, you are expected to follow the rules outlined there.

## License

All of your code changes would be under the same [license](../LICENSE) that covers this project.

## How to report a bug?

We use GitHub to track issues, feature requests as well as bugs. Before opening a new issue please double-check if it's already reported (but don't worry if to be a duplicate - we will manage). If already there - up-vote ⬆️. We will have a look at it faster!

We kindly ask you to write a good issue with a minimal and reproducible example that demonstrates the problem. It would also be great to know your local environment (R session info) as well. You will find our template for issues when opening a bug ticket. This will speed up the fixing process a lot! 📈.

## How to request the change?

If you notice a missing feature or you have an idea how to enhance existing functionalities - please let us know by creating a new issue. Before opening a new issue please double-check if it's already reported (but don't worry if occurs to be a duplicate - we will manage). If already there - up-vote ⬆️. We will have a look at it faster!

Please elaborate on "why?" - what's the context, what's the benefit and for whom. You will find our template when opening a feature request ticket. This will help us prioritize and submit meaningful changes.

## How to submit a change?

### GitHub Flow

We are following [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow) to collaborate in this repository. In order to submit the changes please do the following:

1. Open a branch

Please see branch naming convention below. If you don't have write access please fork it first.

1. Make changes.

Make sure your code passes all the checks and is well documented and tested so as not to decrease existing test coverage 💪.

1. Create a PR(s)

Please link an issue and make a good change description. Include development assumptions when necessary. Give all the details for a reviewer to efficiently check your changes.

1. Address review comments

Please apply changes where necessary. If you disagree with a reviewer - please explain why.

1. Once approved - merge your PR(s) and delete a branch

### Branching convention

In case you are working on a task inside one specific repository, please name your branch `<issue_id>_<short_description>` all lowercase. Multiple words of the description should be divided by an underscore (`_`). E.g. `15_fix_spelling_error` in case you try to solve a spelling mistake mentioned in the issue number `15`.

In case you are working on a task from one repository that affects multiple repositories, please always name your branches: `<issue_id>_<issue_repo>_<short description>` all lowercase. Multiple words of the description should be divided by an underscore (`_`). E.g. `15_abc_fix_spelling_error` in case you try to solve a spelling mistake inside `xyz` which closes issue `15` inside `abc`.

### `monorepo` and `staged.dependencies`

Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using [`staged.dependencies`](https://github.com/openpharma/staged.dependencies) functionality to simulate a `monorepo` behavior. The configuration is already in the [`staged_dependencies.yaml`](../staged_dependencies.yaml) file. You just need to name the feature branches identically. This is the only exception from branch naming convention described above. Please read the package manual for more details.

### Recommended development environment & tools

#### R & package versions

We continuously test our packages against the newest R version as well as a given package dependencies. We recommend to set-up your working environment in the same way. You can find all the details in a given GitHub Action execution log - there is a step that prints out session info.

If you find out any bugs on the older version of dependencies - please create appropriate bug ticket.

#### `pre-commit`

We highly recommend the [`pre-commit`](https://pre-commit.com/) tool combined with [`R hooks for pre-commit`](https://github.com/lorenzwalthert/precommit) to execute some of the checks prior committing and pushing. The configuration is already there in a repository ([here](../.pre-commit-config.yaml)). Please, follow the installation guide on the official [`pre-commit` page](https://github.com/lorenzwalthert/precommit) and the [`GitHub` `readme` page](https://github.com/lorenzwalthert/precommit#installation) for the R hooks.

## Style guide

This repository follows standard [`tidyverse` style guide](https://style.tidyverse.org/) and it's being checked against it by [`lintr`](https://github.com/r-lib/lintr). There are some slight modifications to its default settings available in the [`.lintr`](../.lintr) file.

Although it allows for some flexibility - we recommend sticking to the style of the existing code.

Please note that there is a style and also `lintr` check in place that will validate your code.

## Recognition model

Any contribution is highly welcomed and appreciated. While all the contribution data is already there in GitHub repository insights feature, we introduced some objective rules to recognize a _significant_ contribution so as to became a package author:

- Minimum 5% of lines of code authored (determined by `git blame` query) OR
- Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed.

The package maintainer also reserves the rights to manually adjust the criteria to recognize contributions.

## Any questions

If you have any further questions regarding contribution - please reach out to the repository maintainer(s)!
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: 🐞 Bug Report
description: File a bug report
title: "[Bug]: <title>"
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: session-info
attributes:
label: sessionInfo()
description: Please copy and paste your output from `sessionInfo()`. This will be automatically formatted into code, so no need for backticks.
render: R
- 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: R
- type: checkboxes
id: code-of-conduct
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal.code/CODE_OF_CONDUCT.html)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
- type: checkboxes
id: contributor-guidelines
attributes:
label: Contribution Guidelines
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal.code/CONTRIBUTING.html)
options:
- label: I agree to follow this project's Contribution Guidelines.
required: true
- type: checkboxes
id: security-policy
attributes:
label: Security Policy
description: By submitting this issue, you agree to follow our [Security Policy.](https://github.com/insightsengineering/teal.code/security/policy)
options:
- label: I agree to follow this project's Security Policy.
required: true
56 changes: 0 additions & 56 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
blank_issues_enabled: false

contact_links:
- name: We are hiring!
url: https://careers.gene.com/
about: Genentech and Roche are hiring!
- name: Pharmaverse
url: https://pharmaverse.org/
about: Related projects @ Pharmaverse.org
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: ✨ Feature Request
description: Request or propose a new feature
title: "[Feature Request]: <title>"
labels: ["enhancement"]
body:
- type: textarea
attributes:
label: Feature description
validations:
required: true
- type: checkboxes
id: code-of-conduct
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal.code/CODE_OF_CONDUCT.html)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
- type: checkboxes
id: contributor-guidelines
attributes:
label: Contribution Guidelines
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal.code/CONTRIBUTING.html)
options:
- label: I agree to follow this project's Contribution Guidelines.
required: true
- type: checkboxes
id: security-policy
attributes:
label: Security Policy
description: By submitting this issue, you agree to follow our [Security Policy.](https://github.com/insightsengineering/teal.code/security/policy)
options:
- label: I agree to follow this project's Security Policy.
required: true
39 changes: 0 additions & 39 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: ❓ Question
description: Question about usage or documentation
title: "[Question]: <title>"
labels: ["question"]
body:
- type: textarea
attributes:
label: What is your question?
validations:
required: true
- type: checkboxes
id: code-of-conduct
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal.code/CODE_OF_CONDUCT.html)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
- type: checkboxes
id: contributor-guidelines
attributes:
label: Contribution Guidelines
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal.code/CONTRIBUTING.html)
options:
- label: I agree to follow this project's Contribution Guidelines.
required: true
- type: checkboxes
id: security-policy
attributes:
label: Security Policy
description: By submitting this issue, you agree to follow our [Security Policy.](https://github.com/insightsengineering/teal.code/security/policy)
options:
- label: I agree to follow this project's Security Policy.
required: true
6 changes: 6 additions & 0 deletions .github/workflows/check.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ name: Check 🛠

on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- pre-release
push:
branches:
- main
- pre-release
workflow_dispatch:

jobs:
audit:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docs.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
- LICENSE.*
- NAMESPACE
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- pre-release
Expand All @@ -25,6 +30,7 @@ on:
- man/**
- LICENSE.*
- NAMESPACE
workflow_dispatch:

jobs:
docs:
Expand Down
Loading

0 comments on commit 1ef4bb2

Please sign in to comment.