diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 313e9e7261032..e69de29bb2d1d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,28 +0,0 @@ -# CODEOWNERS lists which teams are largely responsible for areas of code in the repository -# see https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners -# for further details - -**/*.md @forem/oss -/app/assets/ @forem/frontend -/app/controllers/async_info_controller.rb @forem/sre -/app/javascript/ @forem/frontend -/app/services/search/ @forem/sre -/app/workers/ @forem/sre -/config/ @forem/sre -/config/locales -/db/ @forem/sre @forem/backend -/lib/data_update_scripts/ @forem/sre -/lib/sidekiq/ @forem/sre -/spec/rails_helper.rb @forem/sre @forem/backend -/spec/support/ @forem/sre -.buildkite/ @forem/systems @forem/sre -.travis.yml @forem/sre -Containerfile @forem/systems -docker-compose.yml @forem/systems -Dockerfile @forem/systems -Gemfile @forem/sre @forem/backend -Gemfile.lock @forem/sre @forem/backend -package.json @forem/frontend -podman-compose.yml @forem/systems -scripts/ @forem/systems -yarn.lock @forem/frontend diff --git a/.github/workflows/buildkite.yml b/.github/workflows/buildkite.yml deleted file mode 100644 index 3cd4df2db4904..0000000000000 --- a/.github/workflows/buildkite.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Buildkite -on: - issue_comment: - types: [created] -jobs: - add_ci_label: - name: "Add CI label to pull request" - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/ci') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'CONTRIBUTOR') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-ecosystem/action-add-labels@v1 - with: - github_token: ${{ secrets.github_token }} - labels: ci - - build_containers: - name: "Run forem/build-containers pipeline" - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/ci') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'CONTRIBUTOR') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: ./scripts/create_buildkite_pr_build.sh - env: - BUILDKITE_API_ACCESS_TOKEN: ${{ secrets.buildkite_api_access_token }} - PIPELINE: "forem/build-containers" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULL_REQUEST_ID: ${{ github.event.issue.number }} diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml deleted file mode 100644 index 45de07eca2b7e..0000000000000 --- a/.github/workflows/issue.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow posts an automated comment on every new issue -# https://github.com/marketplace/actions/create-or-update-comment (https://github.com/peter-evans/create-or-update-comment) - -name: Automatic Comment -on: - issues: - types: [opened] -jobs: - comment: - name: Comment - runs-on: ubuntu-latest - steps: - - name: Automatic Comment - uses: peter-evans/create-or-update-comment@v1.4.5 - with: - issue-number: ${{ github.event.issue.number }} - body: | - Thanks for the issue, we will take it into consideration! Our team of engineers is busy working on many types of features, please give us time to get back to you. - - Feature requests that require more discussion may be closed. Read more about our [feature request process](https://forem.dev/foremteam/internal-rfc-process-and-forem-dev-discussions-3gl4) on forem.dev. - - To our amazing contributors: issues labeled `type: bug` are always up for grabs, but for feature requests, please wait until we add a `ready for dev` before starting to work on it. - - To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss. The OSS Community Manager or the engineers on OSS rotation will follow up. - - For full info on how to contribute, please check out our [contributors guide](https://github.com/forem/forem/blob/main/CONTRIBUTING.md). diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000000..2df50f497b7e1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,85 @@ +name: CI +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] +jobs: + test: + runs-on: ubuntu-latest + services: + redis: + image: redis + ports: + - 6379:6379 + options: --entrypoint redis-server + db: + image: postgres:11 + env: + POSTGRES_PASSWORD: password + ports: ['5432:5432'] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Set up timezone + run: | + sudo timedatectl set-timezone America/Mexico_City + - name: Install required apt packages + run: | + sudo apt-get -y install libpq-dev + - name: Bundle install + run: | + gem install bundler + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: 12.19.0 + - name: Find yarn cache location + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: JS package cache + uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install packages + run: | + yarn install --pure-lockfile + - name: Webpack Assets compile + env: + RAILS_ENV: test + NODE_ENV: test + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + bundle exec rails webpacker:compile + - name: Yarn test + run: | + yarn test + - name: Setup test database + env: + RAILS_ENV: test + DATABASE_URL: postgres://postgres:password@localhost:5432/hackathon-on-rails_test + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + bundle exec rails db:test:prepare + - name: Run tests + env: + RAILS_ENV: test + DATABASE_URL: postgres://postgres:password@localhost:5432/hackathon-on-rails_test + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + bundle exec rspec diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 07b63414a9860..0000000000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Pull Request -on: - pull_request_target: - types: [opened] -jobs: - pull_request_comment: - name: Notify third-party contributor - if: github.event.pull_request.head.repo.full_name != github.repository - runs-on: ubuntu-latest - steps: - - name: Add comment to PR if coming from third-party fork - uses: mshick/add-pr-comment@v1 - with: - message: | - Thank you for opening this PR! We appreciate you! - - For all pull requests coming from third-party forks we will need to - review the PR before we can process it through our CI pipelines. - - A Forem Team member will review this contribution and get back to - you as soon as possible! - repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: 'github-actions[bot]' diff --git a/package.json b/package.json index d5ea44b675a86..20e7e507e0279 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "clipboard-polyfill": "^3.0.3", "core-js": "3", "file-loader": "^6.2.0", - "focus-trap": "^6.7.1", + "focus-trap": "^6.7.2", "focus-visible": "^5.2.0", "he": "^1.2.0", "honeybadger-js": "2.3.0", diff --git a/yarn.lock b/yarn.lock index 2b55062e79704..811fc014532be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7551,10 +7551,10 @@ focus-lock@^0.9.1: dependencies: tslib "^2.0.3" -focus-trap@^6.7.1: - version "6.7.1" - resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-6.7.1.tgz#d474f86dbaf3c7fbf0d53cf0b12295f4f4068d10" - integrity sha512-a6czHbT9twVpy2RpkWQA9vIgwQgB9Nx1PIxNNUxQT4nugG/3QibwxO+tWTh9i+zSY2SFiX4pnYhTaFaQF/6ZAg== +focus-trap@^6.7.2: + version "6.7.2" + resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-6.7.2.tgz#02e63b12f4d4b3d00bfac4309cfd223e9b4ed44e" + integrity sha512-mRVv9QPCXITaDreu+pNXiPk1Rpn0WQtGvGrDo3Z/s2kdwtzFw/WOPfbLkdxWWvcahoInm9eRztuQOr1RNyQGrw== dependencies: tabbable "^5.2.1"