diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 9534cbe7..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,89 +0,0 @@ -version: 2.1 - -steps: &steps_spec - - checkout - - run: - name: Installing ruby dependencies - command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle - - run: - command: bundle exec rake - - when: - condition: << parameters.benchmark >> - steps: - - run: - command: bundle exec rake benchmarks - -jobs: - ruby-2_2: - parameters: - benchmark: - type: boolean - default: false - steps: *steps_spec - docker: - - image: ruby:2.2 - ruby-2_3: - parameters: - benchmark: - type: boolean - default: true - steps: *steps_spec - docker: - - image: ruby:2.3 - ruby-2_4: - parameters: - benchmark: - type: boolean - default: true - steps: *steps_spec - docker: - - image: ruby:2.4 - ruby-2_5: - parameters: - benchmark: - type: boolean - default: true - steps: *steps_spec - docker: - - image: ruby:2.5 - release-gem: - steps: - - checkout - - run: - name: Installing ruby dependencies - command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle - - run: - name: Sign in to Github as CircleCI Bot - command: | - git config --global user.email "$CIRCLECI_GIT_BOT_GIT_EMAIL" - git config --global user.name "$CIRCLECI_GIT_BOT_NAME" - - run: - name: Auth RubyGems - command: | - mkdir ~/.gem - install -m 0600 /dev/null ~/.gem/credentials - echo -e "---\n:rubygems_api_key: $RUBY_GEMS_API_KEY" > ~/.gem/credentials - - deploy: - name: Release New Gem Version - command: | - GEM_VERSION=$(ruby -r "./lib/blueprinter/version.rb" -e "puts Blueprinter::VERSION") - echo "Attempting to release version '$GEM_VERSION' of Blueprinter..." - bundle exec rake release || true # Don't fail when deploy does not take place - docker: - - image: ruby:2.5 - -workflows: - version: 2 - test: - jobs: - - ruby-2_2 - - ruby-2_3 - - ruby-2_4 - - ruby-2_5 - release: - jobs: - - release-gem: - filters: - branches: - only: - - master diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..aefab238 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ + + +Checklist: + +* [ ] I have bumped any necessary versions according to this project +* [ ] I have updated the necessary documentation +* [ ] I have updated the changelog, if necessary +* [ ] I have signed off all my commits as required by [DCO](../CONTRIBUTING.md#legal) +* [ ] My build is green diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..413909e8 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: / + schedule: + interval: "weekly" + timezone: "America/Los_Angeles" + labels: + - "dependabot" + - "docker" + - "dependencies" diff --git a/.github/workflows/auto-assign-author.yaml b/.github/workflows/auto-assign-author.yaml new file mode 100644 index 00000000..db221728 --- /dev/null +++ b/.github/workflows/auto-assign-author.yaml @@ -0,0 +1,13 @@ +name: 'Auto Author Assign' + +on: + pull_request_target: + types: [opened, reopened] + +jobs: + assign-author: + runs-on: ubuntu-latest + steps: + - uses: toshimaru/auto-author-assign@0fd2847dd52b3cb103d743049dcfb7f17d39c51f # (latest, untagged) + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..0665694a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,28 @@ +name: Release +on: + workflow_run: + workflows: [Test] + types: [completed] + branches: [master, main] +jobs: + release: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 # (latest, untagged) + - name: Installing ruby dependencies + run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle + - name: Sign in to Github as Bot + run: | + git config --global user.email "$GIT_BOT_EMAIL" + git config --global user.name "$GIT_BOT_NAME" + - name: Auth RubyGems + run: | + mkdir ~/.gem + install -m 0600 /dev/null ~/.gem/credentials + echo -e "---\n:rubygems_api_key: $RUBY_GEMS_API_KEY" > ~/.gem/credentials + - name: Release New Gem Version + run: | + GEM_VERSION=$(ruby -r "./lib/blueprinter/version.rb" -e "puts Blueprinter::VERSION") + echo "Attempting to release version '$GEM_VERSION' of Blueprinter..." + bundle exec rake release || true # Don't fail when deploy does not take place diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 00000000..2e3aa5fc --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,39 @@ +name: 'Close stale issues and PR' +on: + workflow_dispatch: + schedule: + - cron: '30 1 * * *' # https://crontab.guru/#30_1_*_*_* (everyday at 0130) + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@02989dcb65055c8fd08a5dec9332c1279c8e2639 # (latest, untagged) + with: + operations-per-run: 200 + ascending: true + delete-branch: true + stale-issue-message: > + This issue is stale because it has been open 10 days with no activity. + Replace the `no-issue-activity` label with a `work-in-progress` label or comment or + this will be closed in 5 days. + close-issue-message: > + This issue was closed because it has been stalled for 5 days with no activity. + days-before-issue-stale: 10 + days-before-issue-close: 5 + stale-issue-label: 'no-issue-activity' + exempt-issue-labels: 'awaiting-approval,work-in-progress' + stale-pr-message: > + This PR is stale because it has been open 20 days with no activity. + Replace the `no-pr-activity` label with a `work-in-progress` label or comment or + this will be closed in 5 days. + close-pr-message: > + This PR was closed because it has been stalled for 5 days with no activity. + days-before-pr-stale: 20 + days-before-pr-close: 5 + stale-pr-label: 'no-pr-activity' + exempt-pr-labels: 'awaiting-approval,work-in-progress,dependencies' diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..5d395dc0 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,25 @@ +name: Test +on: + push: + branches: [master, main] + pull_request: + branches: [master, main] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: ['2.7', '3.0'] + steps: + - uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 # (latest, untagged) + - name: Set up Ruby ${{ matrix.ruby }} + uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Installing dependencies + run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle + - name: Run tests + run: bundle exec rake + - name: Benchmarks + run: bundle exec rake benchmarks diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..f56f7f72 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,130 @@ +# 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 +* Spam or other deceptive practices that take advantage of the community +* 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 +. +All complaints will be reviewed and investigated promptly and fairly by +the [Procore Open Source Program Office (OSPO)](docs/contact.md) + +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 +. + +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 +. Translations are available at +. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d5b8ff26 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,37 @@ +# Contributing to Procore Projects + +This document explains the common procedures expected by contributors while submitting code to Procore open source projects. + +## Code of Conduct + +Please read and abide by the [Code of Conduct](CODE_OF_CONDUCT.md) + +## General workflow + +Once a GitHub issue is accepted and assigned to you, please follow general workflow in order to submit your contribution: + +1. Fork the target repository under your GitHub username. +2. Create a branch in your forked repository for the changes you are about to make. +3. Commit your changes in the branch you created in step 2. All commits need to be signed-off. Check the [legal](#legal) section bellow for more details. +4. Push your commits to your remote fork. +5. Create a Pull Request from your remote fork pointing to the HEAD branch (usually `main` branch) of the target repository. +6. Check the GitHub build and ensure that all checks are green. + +## Legal + +Procore projects use Developer Certificate of Origin ([DCO](https://github.com/apps/dco/)). + +Please sign-off your contributions by doing ONE of the following: + +* Use `git commit -s ...` with each commit to add the sign-off or +* Manually add a `Signed-off-by: Your Name ` to each commit message. + +The email address must match your primary GitHub email. You do NOT need cryptographic (e.g. gpg) signing. + +* Use `git commit -s --amend ...` to add a sign-off to the latest commit, if you forgot. + +*Note*: Some projects will provide specific configuration to ensure all commits are signed-off. Please check the project's documentation for more details. + +## Tests + +Make sure your changes are properly covered by automated tests. We aim to build an efficient test suite that is low cost to maintain and bring value to project. Prefer writing unit-tests over heavy end-to-end (e2e) tests. However, sometimes e2e tests are necessary. If you aren't sure, ask one of the maintainers about the requirements for your pull-request. diff --git a/README.md b/README.md index c257d894..3eb42221 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![CircleCI](https://circleci.com/gh/procore/blueprinter.svg?style=svg)](https://circleci.com/gh/procore/blueprinter) +![Tests](https://github.com/procore/blueprinter/actions/workflows/test.yml/badge.svg?branch=master) [![Gem Version](https://badge.fury.io/rb/blueprinter.svg)](https://badge.fury.io/rb/blueprinter) [![Gitter chat](https://badges.gitter.im/procore/blueprinter.svg)](https://gitter.im/blueprinter-gem/community)