From 910ad885a2bcbab8d0ad6e6114b7d6a4e16ab44a Mon Sep 17 00:00:00 2001 From: Dinakar <26552821+dinakar29@users.noreply.github.com> Date: Mon, 23 May 2022 13:14:21 -0500 Subject: [PATCH] Update actions, vanity improvements (#84) --- .github/CONTRIBUTING.md | 122 +++++++++++++++++++-- .github/ISSUE_TEMPLATE/bug.yml | 51 +++++++++ .github/ISSUE_TEMPLATE/bug_report.md | 58 ---------- .github/ISSUE_TEMPLATE/config.yml | 10 ++ .github/ISSUE_TEMPLATE/feature.yml | 27 +++++ .github/ISSUE_TEMPLATE/feature_request.md | 39 ------- .github/ISSUE_TEMPLATE/question.yml | 27 +++++ .github/PULL_REQUEST_TEMPLATE.md | 4 +- .github/workflows/audit.yaml | 3 +- .github/workflows/bioccheck.yaml | 3 +- .github/workflows/build-check-install.yaml | 52 +++++---- .github/workflows/gitleaks.yaml | 5 +- .github/workflows/licenses.yaml | 3 +- .github/workflows/links.yaml | 5 +- .github/workflows/linter.yaml | 3 +- .github/workflows/pkgdown.yaml | 22 ++-- .github/workflows/release.yaml | 3 +- .github/workflows/roxygen.yaml | 3 +- .github/workflows/spelling.yaml | 3 +- .github/workflows/style.yaml | 5 +- .github/workflows/test-coverage.yaml | 3 +- .github/workflows/validation.yaml | 18 +-- .github/workflows/version-bump.yaml | 3 +- .github/workflows/version.yaml | 3 +- .gitignore | 1 + CONTRIBUTING.md | 118 -------------------- DESCRIPTION | 1 + init.sh | 1 + 28 files changed, 305 insertions(+), 291 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/question.yml delete mode 100644 CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d614e7181..4b3baecb3 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,10 +1,118 @@ -# Contributing +# Contribution Guidelines -Thank you for your interest in contributing to this repo! +First of all, thank you for taking the time to contribute! โœŒ๏ธ ๐ŸŽ‰ -Here are a few things you can do that will increase the likelihood of your pull request being accepted: +We love your input regardless of its size, content or scope - whether it is an issue, feature request, bug-fix or documentation enhancement. -- Ensure that the pull request is associated with an existing Github issue. If not, create a new issue that is associated with this change. -- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. -- Complete the checklist and description while creating the pull request. -- Write good commit messages. +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 `_` 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: `__` 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! diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 000000000..cf47384eb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,51 @@ +--- +name: ๐Ÿž Bug Report +description: File a bug report +title: "[Bug]: " +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: dropdown + id: r-version + attributes: + label: Which version(s) of R were you using? + multiple: true + options: + - "3.6.x" + - "4.1.x" + - "4.2.x" + - "Other" + - 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/r.pkg.template/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/r.pkg.template/CONTRIBUTING.html) + options: + - label: I agree to follow this project's Contribution Guidelines. + required: true diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 45275072c..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "" -labels: "bug" -assignees: "" ---- - -<!-- -**Thank you for wanting to report a bug!** - - -โš  -Verify first that your issue is not already reported on -../search?q=is%3Aissue&type=issues. - -Also test if the latest main branch are affected too. ---> - -**Summary** - -<!-- -Please briefly describe your problem and, when relevant, the output you expect. -Please also provide the output of `utils::sessionInfo()` or -`devtools::session_info()` at the end of your post. - -If at all possible, please include a minimal, reproducible -example https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. ---> - -Your brief description of the problem - -```r - -# your reproducible example here - -``` - -**R session info** - -<!-- -Paste verbatim output from `R -e "utils::sessionInfo()"` below. ---> - -```sh - -# R -e "utils::sessionInfo()" output goes here - -``` - -**OS / Environment** - -<!-- -Provide all relevant information below, e.g. target OS versions, docker image, etc. ---> - -- OS: [e.g. Windows 10, Ubuntu 20.04, Centos 8] -- Docker Image [e.g. rocker/verse:4.1.0] diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..648e8e066 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 000000000..5efe065af --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,27 @@ +--- +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/r.pkg.template/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/r.pkg.template/CONTRIBUTING.html) + options: + - label: I agree to follow this project's Contribution Guidelines. + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index ec1388615..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "" -labels: "enhancement" -assignees: "" ---- - -**Summary** - -<!-- -Describe the new feature/improvement you would like briefly below. - - -What's the problem this feature will solve? - -What are you trying to do, that you are unable to achieve -with this package as it currently stands? - - -* Provide examples of real-world use cases that this would enable -and how it solves the problem you described. - -* How do you solve this now? - -* Have you tried to work around the problem using other tools? - -* Could there be a different approach to solving this issue? ---> - -As a [persona], I [want to], [so that]. - -**Additional Information** - -<!-- -Describe how the feature would be used, why it is needed and what it would solve. - -**HINT:** You can paste https://gist.github.com links for larger files. ---> diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 000000000..b3e46c1c5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,27 @@ +--- +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/r.pkg.template/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/r.pkg.template/CONTRIBUTING.html) + options: + - label: I agree to follow this project's Contribution Guidelines. + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9e57691c9..81c84dc33 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,3 @@ # Pull Request -<!--- Replace `#nnn` with your issue link for reference. --> - -Fixes #nnn +<!-- Please describe your pull request here --> diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml index 81a26625d..e4200a0e0 100644 --- a/.github/workflows/audit.yaml +++ b/.github/workflows/audit.yaml @@ -9,6 +9,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: jobs: @@ -22,7 +23,7 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run oysteR scan on dependencies ๐Ÿ” run: | diff --git a/.github/workflows/bioccheck.yaml b/.github/workflows/bioccheck.yaml index fa57b4aaa..3a45e5e8c 100644 --- a/.github/workflows/bioccheck.yaml +++ b/.github/workflows/bioccheck.yaml @@ -12,6 +12,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: secrets: REPO_GITHUB_TOKEN: @@ -67,7 +68,7 @@ jobs: uses: tj-actions/branch-names@v5 - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} diff --git a/.github/workflows/build-check-install.yaml b/.github/workflows/build-check-install.yaml index 317d8c268..fe6fca828 100644 --- a/.github/workflows/build-check-install.yaml +++ b/.github/workflows/build-check-install.yaml @@ -12,6 +12,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: secrets: REPO_GITHUB_TOKEN: @@ -34,6 +35,16 @@ on: required: false default: true type: boolean + skip-r-cmd-check: + description: Skip the R CMD check step in this workflow + required: false + default: false + type: boolean + skip-r-cmd-install: + description: Skip the R CMD INSTALL step in this workflow + required: false + default: false + type: boolean concurrency: group: r-cmd-${{ github.event.pull_request.number || github.ref }} @@ -61,7 +72,7 @@ jobs: uses: tj-actions/branch-names@v5 - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} @@ -110,6 +121,12 @@ jobs: - name: Run R CMD check ๐Ÿ run: | + if [ "${{ inputs.skip-r-cmd-check }}" == "true" ] + then { + echo "Skipping R CMD check as 'skip-r-cmd-check' was set to 'true'" + exit 0 + } + fi if [ "${{ inputs.R_CHECK_FORCE_SUGGESTS }}" == "" ] then { _R_CHECK_FORCE_SUGGESTS_="FALSE" @@ -157,20 +174,20 @@ jobs: } shell: Rscript {0} - - name: Upload check results โคด - if: failure() - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.config.tag }}-results - path: ${{ github.event.repository.name }}.Rcheck/00check.log - - name: Install R package ๐Ÿšง - run: R CMD INSTALL ${{ env.PKGBUILD }} + run: | + if [ "${{ inputs.skip-r-cmd-install }}" == "true" ] + then { + echo "Skipping R CMD INSTALL as 'skip-r-cmd-install' was set to 'true'" + exit 0 + } + fi + R CMD INSTALL ${{ env.PKGBUILD }} shell: bash - name: Upload package build โคด if: startsWith(github.ref, 'refs/tags/v') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: ${{ env.PKGBUILD }} name: ${{ env.PKGBUILD }} @@ -185,16 +202,7 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 - - - name: Wait for release to succeed โณ - timeout-minutes: 2 - uses: lewagon/wait-on-check-action@v1.1.1 - with: - ref: ${{ github.ref }} - check-name: "Release ๐Ÿš€" - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 + uses: actions/checkout@v3 - name: Set release version and package build filename ๐Ÿ“ run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV @@ -203,7 +211,7 @@ jobs: run: echo "PKGBUILD=${{ github.event.repository.name }}_${{ env.RELEASE_VERSION }}.tar.gz" >> $GITHUB_ENV - name: Download artifact โฌ - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: ${{ env.PKGBUILD }} @@ -214,4 +222,4 @@ jobs: file: ${{ env.PKGBUILD }} asset_name: ${{ env.PKGBUILD }} tag: ${{ github.ref }} - overwrite: false + overwrite: true diff --git a/.github/workflows/gitleaks.yaml b/.github/workflows/gitleaks.yaml index 737d1b756..1e02a2d4a 100644 --- a/.github/workflows/gitleaks.yaml +++ b/.github/workflows/gitleaks.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: inputs: additional_args: @@ -31,7 +32,7 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download and install gitleaks ๐Ÿ’ง run: | @@ -60,7 +61,7 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/.github/workflows/licenses.yaml b/.github/workflows/licenses.yaml index 71b09bdf7..53976b93e 100644 --- a/.github/workflows/licenses.yaml +++ b/.github/workflows/licenses.yaml @@ -9,6 +9,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: concurrency: @@ -24,7 +25,7 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate license report ๐Ÿ“œ uses: insightsengineering/r-license-report@v1 diff --git a/.github/workflows/links.yaml b/.github/workflows/links.yaml index 4f27f0d58..5c36c229f 100644 --- a/.github/workflows/links.yaml +++ b/.github/workflows/links.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: inputs: additional_args: @@ -31,10 +32,10 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Check URLs in docs ๐Ÿ”ฌ - uses: lycheeverse/lychee-action@v1.0.9 + uses: lycheeverse/lychee-action@v1.4.1 with: args: >- --exclude-private diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 0c1493b7b..750555960 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: concurrency: @@ -25,7 +26,7 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index a27a942ac..dd4891485 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -20,6 +20,7 @@ on: - man/** - LICENSE.* - NAMESPACE + workflow_dispatch: workflow_call: secrets: REPO_GITHUB_TOKEN: @@ -62,7 +63,7 @@ jobs: uses: tj-actions/branch-names@v5 - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} @@ -109,7 +110,7 @@ jobs: - name: Upload docs for review โฌ† if: github.ref != 'refs/heads/main' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pkgdown.zip path: pkgdown.zip @@ -131,19 +132,10 @@ jobs: && !contains(github.event.commits[0].message, '[skip docs]') steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 - - - name: Wait for release to succeed โณ - timeout-minutes: 2 - uses: lewagon/wait-on-check-action@v1.1.1 - with: - ref: "${{ github.ref }}" - check-name: "Release ๐Ÿš€" - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 + uses: actions/checkout@v3 - name: Download artifact โฌ - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: pkgdown.zip @@ -154,7 +146,7 @@ jobs: file: pkgdown.zip asset_name: pkgdown.zip tag: ${{ github.ref }} - overwrite: false + overwrite: true multiversion-docs: name: Multi-version docs ๐Ÿ“– @@ -168,7 +160,7 @@ jobs: needs: docs steps: - name: Checkout GH pages branch ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: gh-pages diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 68335aa57..c9fd793ac 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,6 +6,7 @@ on: tags: - "v*" workflow_call: + workflow_dispatch: concurrency: group: release-${{ github.event.pull_request.number || github.ref }} @@ -20,7 +21,7 @@ jobs: contents: write steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate Changelog ๐Ÿ“œ run: | diff --git a/.github/workflows/roxygen.yaml b/.github/workflows/roxygen.yaml index fd1bcec9e..ab524716f 100644 --- a/.github/workflows/roxygen.yaml +++ b/.github/workflows/roxygen.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: inputs: install-system-dependencies: @@ -48,7 +49,7 @@ jobs: uses: tj-actions/branch-names@v5 - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} diff --git a/.github/workflows/spelling.yaml b/.github/workflows/spelling.yaml index 84c3f950e..2f16bec3f 100644 --- a/.github/workflows/spelling.yaml +++ b/.github/workflows/spelling.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: concurrency: @@ -28,7 +29,7 @@ jobs: steps: - name: Checkout Code ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run Spellcheck ๐Ÿ‘Ÿ uses: insightsengineering/r-spellcheck-action@v2 diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index d9c0fbf75..1f1449bd0 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: concurrency: @@ -28,7 +29,7 @@ jobs: steps: - name: Checkout Code ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{ github.event.repository.name }} fetch-depth: 0 @@ -40,7 +41,7 @@ jobs: - name: Get changed files ๐Ÿ—ž id: changed-files - uses: tj-actions/changed-files@v17 + uses: tj-actions/changed-files@v20 with: path: ${{ github.event.repository.name }} separator: "," diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index c6aba54aa..f37886440 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: inputs: install-system-dependencies: @@ -63,7 +64,7 @@ jobs: uses: tj-actions/branch-names@v5 - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} diff --git a/.github/workflows/validation.yaml b/.github/workflows/validation.yaml index fd4f58e7d..f1d8f9787 100644 --- a/.github/workflows/validation.yaml +++ b/.github/workflows/validation.yaml @@ -11,6 +11,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: inputs: install-system-dependencies: @@ -50,7 +51,7 @@ jobs: deployments: write steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run Staged dependencies ๐ŸŽฆ uses: insightsengineering/staged-dependencies-action@v1 @@ -64,7 +65,7 @@ jobs: - name: Upload report for review โฌ† if: github.ref != 'refs/heads/main' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: validation_report.pdf path: validation_report.pdf @@ -75,17 +76,8 @@ jobs: runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') steps: - - name: Wait for release to succeed โณ - timeout-minutes: 2 - uses: lewagon/wait-on-check-action@v1.1.1 - with: - ref: "${{ github.ref }}" - check-name: "Release ๐Ÿš€" - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - - name: Download artifact โฌ - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: validation_report.pdf @@ -96,4 +88,4 @@ jobs: asset_name: validation-report.pdf repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} - overwrite: false + overwrite: true diff --git a/.github/workflows/version-bump.yaml b/.github/workflows/version-bump.yaml index 802c2f136..d9476f55d 100644 --- a/.github/workflows/version-bump.yaml +++ b/.github/workflows/version-bump.yaml @@ -6,6 +6,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: secrets: REPO_GITHUB_TOKEN: @@ -29,7 +30,7 @@ jobs: steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: token: ${{ secrets.REPO_GITHUB_TOKEN }} diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index 3c5d46100..7e08a8884 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -10,6 +10,7 @@ on: branches: - main - pre-release + workflow_dispatch: workflow_call: concurrency: @@ -25,7 +26,7 @@ jobs: && github.event.pull_request.draft == false steps: - name: Checkout repo ๐Ÿ›Ž - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: NEWS.md and DESCRIPTION Version check ๐Ÿ run: | diff --git a/.gitignore b/.gitignore index ef34c12c1..1db2087e3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ vignettes/*.html vignettes/*.md vignettes/*.R coverage.* +.vscode/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 6a6c47759..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,118 +0,0 @@ -# Contributor guide - -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! diff --git a/DESCRIPTION b/DESCRIPTION index 79cdce38f..88bee53be 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,3 +28,4 @@ Language: en-US LazyData: true Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.2 +Config/Needs/website: insightsengineering/nesttemplate diff --git a/init.sh b/init.sh index d0a3de99a..7deb73590 100755 --- a/init.sh +++ b/init.sh @@ -54,6 +54,7 @@ oecho "Replacing template references within files" grep -rl --exclude-dir=.git "r.pkg.template" . | \ xargs perl -p -i -e "s/r.pkg.template/${pkg}/g" perl -p -i -e "s/insightsengineering/${owner}/g" DESCRIPTION +perl -p -i -e "s/insightsengineering/${owner}/g" .github/ISSUE_TEMPLATE/*.yml perl -p -i -e "s/insightsengineering\/idr/${owner}/g" .github/CODEOWNERS perl -p -i -e "s/insightsengineering/${owner}/g" _pkgdown.yml perl -p -i -e "s/insightsengineering/${owner}/g" staged_dependencies.yaml