diff --git a/.circleci/config.yml b/.circleci/config.yml index 83612d465..8f821ca0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,213 +1,15 @@ version: 2.1 -orbs: - browser-tools: circleci/browser-tools@1.4.0 - -executors: - ruby: - docker: - - image: cimg/ruby:2.7.8-browsers - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - working_directory: ~/spot - environment: - BUNDLE_PATH: vendor/bundle - - application: - docker: - - image: cimg/ruby:2.7.8-browsers - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - - image: cimg/redis:6.2 - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - - image: postgres:13-alpine - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - environment: - POSTGRES_USER: spot_dev_user - POSTGRES_PASSWORD: password - POSTGRES_DB: spot_test - - image: samvera/fcrepo4:4.7.5 - environment: - CATALINA_OPTS: '-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC' - - image: solr:8.11.2 - environment: - SOLR_AUTH_TYPE: basic - SOLR_AUTHENTICATION_OPTS: "-Dbasicauth=solr:SolrRocks" - command: | - bash -c 'bin/solr start -cloud -p 8983 && bin/solr auth enable -credentials solr:SolrRocks && bin/solr stop && solr-foreground -cloud -p 8983' - working_directory: ~/spot - environment: - BUNDLE_PATH: vendor/bundle - CAS_BASE_URL: http://localhost - CI: 1 - FEDORA_TEST_URL: http://localhost:8080/rest - IIIF_BASE_URL: http://localhost/iiif/2 - RAILS_ENV: test - NOKOGIRI_USE_SYSTEM_LIBRARIES: true - PSQL_DATABASE: spot_test - PSQL_USER: spot_dev_user - PSQL_PASSWORD: password - SOLR_TEST_URL: http://solr:SolrRocks@localhost:8983/solr/spot-test - URL_HOST: http://localhost jobs: - bundle: - executor: ruby - steps: - - checkout - - restore_cache: - name: Restore cached bundle - key: spot-gems-{{ checksum "Gemfile.lock" }} - - restore_cache: - name: Restore cached node_modules - key: spot-node_modules-{{ checksum "yarn.lock" }} - - run: - name: Install dependencies (ruby) - command: bundle check || bundle install - - run: - name: Install dependencies (js) - command: yarn install - - save_cache: - name: Store cache of bundle - key: spot-gems-{{ checksum "Gemfile.lock" }} - paths: - - vendor/bundle - - save_cache: - name: Store cache of node_modules - key: spot-node_modules-{{ checksum "yarn.lock" }} - paths: - - node_modules - - persist_to_workspace: - root: ~/ - paths: - - spot/* - - spot/**/* - - lint: - executor: ruby - steps: - - attach_workspace: - at: ~/ - - run: - name: Fine, we'll install bundler again - command: gem install bundler - - run: - name: Get 'em Rubocop! - command: (bundle check || bundle install) && bundle exec rubocop - - test: - executor: application - parallelism: 4 - steps: - - attach_workspace: - at: ~/ - - # install dependencies - - run: - name: Install Postgres 13 - command: | - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - - sudo apt-get update - sudo apt-get -y install postgresql-13 - - - browser-tools/install-firefox - - browser-tools/install-geckodriver - - # start firefox - - run: - name: Start headless Firefox browser - command: firefox --headless --remote-debugging-port=9222 http://localhost & - - - run: - name: Make sure dependencies are valid - command: | - gem install bundler:1.16.1 - bundle check || bundle install - - - run: - name: Load config into Solr - command: | - cd docker/solr/config - zip -1 spot_solr_config.zip ./* - curl --user solr:SolrRocks -H "Content-type: application/octet-stream" --data-binary @spot_solr_config.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=spot" - curl --user solr:SolrRocks -H "Content-type: application/json" http://localhost:8983/api/collections/ -d "{create: {name: spot-test, config: spot, numShards: 1}}" - - - run: - name: Install Code Climate Test Reporter - command: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - - - run: - name: Run RSpec tests - command: | - bundle exec rake db:migrate - mkdir /tmp/test-results - ./cc-test-reporter before-build - bundle exec rspec \ - --backtrace \ - --format RspecJunitFormatter \ - --out /tmp/test-results/rspec.xml \ - --format progress\ - -- \ - $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) - - - run: - name: Code Climate test coverate - command: | - ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json" - - - persist_to_workspace: - root: coverage - paths: - - codeclimate.*.json - - - store_test_results: - path: /tmp/test-results - - - store_artifacts: - path: /tmp/test-results - destination: test-results - - upload-coverage: - executor: ruby + echo_skip: + docker: + - image: cimg/base:current steps: - - attach_workspace: - at: ~/spot - - run: - name: Install Code Climate Test Reporter - command: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - run: - command: | - ./cc-test-reporter sum-coverage --output - codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input - + command: echo "skipping circleci tests" workflows: version: 2 - ci: + noop: jobs: - - bundle: - context: - - dss-docker-auth - - lint: - context: - - dss-docker-auth - requires: - - bundle - - test: - context: - - dss-docker-auth - requires: - - lint - - upload-coverage: - context: - - dss-docker-auth - requires: - - test + - echo_skip diff --git a/.dockerignore b/.dockerignore index 5f05731a1..c90cc372b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,6 +17,11 @@ !/vendor/.keep # allow files @ app root +!.env.development +!.rspec +!.rubocop.yml +!.rubocop_todo.yml +!.scss-lint.yml !config.ru !Gemfile !Gemfile.lock diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0ca7a7882..000000000 --- a/.eslintrc +++ /dev/null @@ -1,213 +0,0 @@ -parserOptions: - sourceType: module - ecmaFeatures: - jsx: true - -env: - amd: true - browser: true - es6: true - jquery: true - node: true - -# http://eslint.org/docs/rules/ -rules: - # Possible Errors - comma-dangle: [2, never] - no-cond-assign: 2 - no-console: 0 - no-constant-condition: 2 - no-control-regex: 2 - no-debugger: 2 - no-dupe-args: 2 - no-dupe-keys: 2 - no-duplicate-case: 2 - no-empty: 2 - no-empty-character-class: 2 - no-ex-assign: 2 - no-extra-boolean-cast: 2 - no-extra-parens: 0 - no-extra-semi: 2 - no-func-assign: 2 - no-inner-declarations: [2, functions] - no-invalid-regexp: 2 - no-irregular-whitespace: 2 - no-negated-in-lhs: 2 - no-obj-calls: 2 - no-regex-spaces: 2 - no-sparse-arrays: 2 - no-unexpected-multiline: 2 - no-unreachable: 2 - use-isnan: 2 - valid-jsdoc: 0 - valid-typeof: 2 - - # Best Practices - accessor-pairs: 2 - block-scoped-var: 0 - complexity: [2, 6] - consistent-return: 0 - curly: 0 - default-case: 0 - dot-location: 0 - dot-notation: 0 - eqeqeq: 2 - guard-for-in: 2 - no-alert: 2 - no-caller: 2 - no-case-declarations: 2 - no-div-regex: 2 - no-else-return: 0 - no-labels: 2 - no-empty-pattern: 2 - no-eq-null: 2 - no-eval: 2 - no-extend-native: 1 - no-extra-bind: 2 - no-fallthrough: 2 - no-floating-decimal: 0 - no-implicit-coercion: 0 - no-implied-eval: 2 - no-invalid-this: 0 - no-iterator: 2 - no-lone-blocks: 2 - no-loop-func: 2 - no-magic-number: 0 - no-multi-spaces: 0 - no-multi-str: 0 - no-native-reassign: 2 - no-new-func: 2 - no-new-wrappers: 2 - no-new: 1 - no-octal-escape: 2 - no-octal: 2 - no-proto: 2 - no-redeclare: 2 - no-return-assign: 2 - no-script-url: 2 - no-self-compare: 2 - no-sequences: 0 - no-throw-literal: 0 - no-unused-expressions: 2 - no-useless-call: 2 - no-useless-concat: 2 - no-void: 2 - no-warning-comments: 0 - no-with: 2 - radix: 2 - vars-on-top: 0 - wrap-iife: 2 - yoda: 0 - - # Strict - strict: 0 - - # Variables - init-declarations: 0 - no-catch-shadow: 2 - no-delete-var: 2 - no-label-var: 2 - no-shadow-restricted-names: 2 - no-shadow: 0 - no-undef-init: 2 - no-undef: 0 - no-undefined: 0 - no-unused-vars: 0 - no-use-before-define: 0 - - # Node.js and CommonJS - callback-return: 2 - global-require: 2 - handle-callback-err: 2 - no-mixed-requires: 0 - no-new-require: 0 - no-path-concat: 2 - no-process-exit: 2 - no-restricted-modules: 0 - no-sync: 0 - - # Stylistic Issues - array-bracket-spacing: 0 - block-spacing: 0 - brace-style: 0 - camelcase: 0 - comma-spacing: 0 - comma-style: 0 - computed-property-spacing: 0 - consistent-this: 0 - eol-last: 0 - func-names: 0 - func-style: 0 - id-length: 0 - id-match: 0 - indent: 0 - jsx-quotes: 0 - key-spacing: 0 - linebreak-style: 0 - lines-around-comment: 0 - max-depth: 0 - max-len: 0 - max-nested-callbacks: 0 - max-params: 0 - max-statements: [2, 30] - new-cap: 0 - new-parens: 0 - newline-after-var: 0 - no-array-constructor: 0 - no-bitwise: 0 - no-continue: 0 - no-inline-comments: 0 - no-lonely-if: 0 - no-mixed-spaces-and-tabs: 0 - no-multiple-empty-lines: 0 - no-negated-condition: 0 - no-nested-ternary: 0 - no-new-object: 0 - no-plusplus: 0 - no-restricted-syntax: 0 - no-spaced-func: 0 - no-ternary: 0 - no-trailing-spaces: 0 - no-underscore-dangle: 0 - no-unneeded-ternary: 0 - object-curly-spacing: 0 - one-var: 0 - operator-assignment: 0 - operator-linebreak: 0 - padded-blocks: 0 - quote-props: 0 - quotes: 0 - require-jsdoc: 0 - semi-spacing: 0 - semi: 0 - sort-vars: 0 - space-after-keywords: 0 - space-before-blocks: 0 - space-before-function-paren: 0 - space-before-keywords: 0 - space-in-parens: 0 - space-infix-ops: 0 - space-return-throw-case: 0 - space-unary-ops: 0 - spaced-comment: 0 - wrap-regex: 0 - - # ECMAScript 6 - arrow-body-style: 0 - arrow-parens: 0 - arrow-spacing: 0 - constructor-super: 0 - generator-star-spacing: 0 - no-arrow-condition: 0 - no-class-assign: 0 - no-const-assign: 0 - no-dupe-class-members: 0 - no-this-before-super: 0 - no-var: 0 - object-shorthand: 0 - prefer-arrow-callback: 0 - prefer-const: 0 - prefer-reflect: 0 - prefer-spread: 0 - prefer-template: 0 - require-yield: 0 \ No newline at end of file diff --git a/.github/workflows/build-ondemand.yml b/.github/workflows/build-ondemand.yml index bfa384fed..afa36ae14 100644 --- a/.github/workflows/build-ondemand.yml +++ b/.github/workflows/build-ondemand.yml @@ -22,6 +22,10 @@ on: - stage - production jobs: + lint_and_test: + name: Lint + Test + uses: ./.github/workflows/lint-and-test.yml + build_all: if: ${{ inputs.service == 'All' }} strategy: @@ -29,6 +33,7 @@ jobs: environment: ${{ inputs.environment == 'both' && fromJSON('["stage","production"]') || fromJSON(format('["{0}"]', inputs.environment)) }} runs-on: ubuntu-latest environment: ${{ matrix.environment }} + needs: [lint_and_test] steps: - name: Check out repository @@ -58,6 +63,7 @@ jobs: environment: ${{ inputs.environment == 'both' && fromJSON('["stage","production"]') || fromJSON(format('["{0}"]', inputs.environment)) }} runs-on: ubuntu-latest environment: ${{ matrix.environment }} + needs: [lint_and_test] steps: - name: Check out repository diff --git a/.github/workflows/build-prerelease.yml b/.github/workflows/build-prerelease.yml index f032a1aad..5c9b74444 100644 --- a/.github/workflows/build-prerelease.yml +++ b/.github/workflows/build-prerelease.yml @@ -1,13 +1,22 @@ name: Build prerelease containers on: + push: + branches: + - develop + release: types: - prereleased jobs: + lint_and_test: + name: Lint + Test + uses: ./.github/workflows/lint-and-test.yml + publish_prerelease_containers: runs-on: ubuntu-latest environment: stage + needs: [lint_and_test] steps: - name: Check out repo diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6743f2d96..8905f0b86 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -5,12 +5,17 @@ on: - released jobs: + lint_and_test: + name: Lint + Test + uses: ./.github/workflows/lint-and-test.yml + publish_release_containers: strategy: matrix: environment: [stage, production] runs-on: ubuntu-latest environment: ${{ matrix.environment }} + needs: [lint_and_test] steps: - name: Check out repo diff --git a/.github/workflows/closed-branch-cleanup.yml b/.github/workflows/closed-branch-cleanup.yml new file mode 100644 index 000000000..757fdba55 --- /dev/null +++ b/.github/workflows/closed-branch-cleanup.yml @@ -0,0 +1,27 @@ +# @see https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#managing-caches +name: Clean up after a deleted branch +on: + delete: + +jobs: + cleanup_branch_cache: + name: Clean up branch caches + runs-on: ubuntu-latest + steps: + - + name: Delete caches for ${{ github.ref_name }} + env: + REPO: ${{ github.repository }} + BRANCH: ${{ github.ref_name }} + run: | + gh extension install actions/gh-actions-cache + + echo "Getting cache names" + cacheKeys=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1) + + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeys + do + gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + done diff --git a/.github/workflows/lint-and-test-on-push.yml b/.github/workflows/lint-and-test-on-push.yml new file mode 100644 index 000000000..d2b4c2298 --- /dev/null +++ b/.github/workflows/lint-and-test-on-push.yml @@ -0,0 +1,11 @@ +name: Lint and Test (on push) +on: + push: + +permissions: + checks: write + +jobs: + lint_and_test: + name: Lint + Test + uses: ./.github/workflows/lint-and-test.yml \ No newline at end of file diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml new file mode 100644 index 000000000..032a79d3f --- /dev/null +++ b/.github/workflows/lint-and-test.yml @@ -0,0 +1,173 @@ +name: Lint + Test +on: + workflow_call: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + env: + BUNDLE_PATH: vendor/bundle + BUNDLE_WITH: test + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - + name: Run Rubocop + run: bundle exec rubocop --format github + + test: + name: Test + runs-on: ubuntu-latest + container: ruby:2.7.8-slim-bullseye + needs: lint + services: + database: + image: postgres:13-alpine + ports: + - 5432:5432 + env: + POSTGRES_DB: spot_test + POSTGRES_USER: spot_test_user + POSTGRES_PASSWORD: spot_test_pw + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + fedora: + image: samvera/fcrepo4:4.7.5 + ports: + - 8080:8080 + env: + CATALINA_OPTS: '-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC' + redis: + image: redis:6.2-alpine + ports: + - 6379:6379 + zookeeper: + image: bitnami/zookeeper:3.9 + ports: + - 2181:2181 + env: + ZOO_SERVER_ID: 1 + ALLOW_ANONYMOUS_LOGIN: yes + ZOO_SERVERS: zookeeper:2888:3888 + ZOO_4LW_COMMANDS_WHITELIST: srvr,mntr,conf,ruok + solr: + image: bitnami/solr:8.11.2 + ports: + - 8983:8983 + env: + SOLR_ADMIN_USERNAME: solr_admin + SOLR_ADMIN_PASSWORD: solr_password + SOLR_CLOUD_BOOTSTRAP: yes + SOLR_ENABLE_AUTHENTICATION: yes + SOLR_ENABLE_CLOUD_MODE: yes + SOLR_HOST: solr + SOLR_ZK_HOSTS: zookeeper:2181 + env: + BUNDLE_PATH: vendor/bundle + BUNDLE_WITH: test + CAS_BASE_URL: '' + CI: 1 + FEDORA_TEST_URL: http://fedora:8080/rest + IIIF_BASE_URL: http://localhost/iiif/2 + NOKOGIRI_USE_SYSTEM_LIBRARIES: true + PSQL_PASSWORD: spot_test_pw + PSQL_USER: spot_test_user + PSQL_DATABASE: spot_test + PSQL_HOST: database + RAILS_ENV: test + SOLR_TEST_URL: http://solr_admin:solr_password@solr:8983/solr/spot-test + URL_HOST: http://localhost:3000 + + steps: + - + name: Install system dependencies from Dockerfile + run: | + apt-get update -y && apt-get install -y --no-install-recommends ca-certificates curl gnupg && \ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ + apt-get update -y && apt-get install -y \ + build-essential coreutils curl git libxml2 libxml2-dev libxslt-dev \ + netcat-openbsd nodejs openssl postgresql-13 ruby-dev tzdata zip \ + libasound2 libdbus-glib-1-dev libgtk-3-0 libpq-dev unzip libx11-xcb1 + - + name: Setup Firefox + uses: browser-actions/setup-firefox@v1 + id: setup-firefox + env: + HOME: /root + with: + firefox-version: latest-esr + - + name: Setup Geckodriver + uses: browser-actions/setup-geckodriver@latest + id: setup-geckodriver + env: + HOME: /root + with: + token: ${{ secrets.GITHUB_TOKEN }} + geckodriver-version: latest + - + name: Checkout code + uses: actions/checkout@v4 + - + name: Restore Solr config.zip from cache + id: solr-config-cache + uses: actions/cache@v4 + with: + path: /tmp/spot_solr_config.zip + key: spot-solr-${{ hashFiles('docker/solr/config') }} + - + name: Build Solr config.zip + if: steps.solr-config-cache.outputs.cache-hit != 'true' + run: | + cd docker/solr/config + zip -1 /tmp/spot_solr_config.zip ./* + - + name: Setup Solr core with local configs + run: | + curl --user solr_admin:solr_password -H "Content-type: application/octet-stream" --data-binary @/tmp/spot_solr_config.zip "http://solr:8983/solr/admin/configs?action=UPLOAD&name=spot" + curl --user solr_admin:solr_password -H "Content-type: application/json" http://solr:8983/api/collections/ -d "{create: {name: spot-test, config: spot, numShards: 1}}" + - + name: Restore installed Gems + uses: actions/cache@v4 + with: + path: vendor/bundle + key: spot-bundle-${{ hashFiles('Gemfile.lock') }} + - + name: Install gem dependencies + run: | + gem install bundler:$(tail -n 1 Gemfile.lock | sed -e "s/ *//") + bundle install + - + name: Run migrations + run: bundle exec rake db:migrate + - + name: Run tests + env: + FIREFOX_BINARY_PATH: ${{ steps.setup-firefox.outputs.firefox-path }} + HOME: /root + run: | + export PATH="$(dirname $(which geckodriver)):${PATH}" + mkdir /tmp/test-results + bundle exec rspec --backtrace --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml + - + name: Publish RSpec report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + check_name: Test summary + report_paths: /tmp/test-results/*.xml + - + name: Publish coverage + uses: joshmfrankel/simplecov-check-action@main + with: + check_job_name: Test coverage + minimum_suite_coverage: 95 + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index 02f4216a0..000000000 --- a/.hound.yml +++ /dev/null @@ -1,14 +0,0 @@ -# since we can't use external gems for config w/ hound's rubocop -# we'll skip this and continue to use rubo in our ci tasks -rubocop: - enabled: false - -erblint: - enabled: true - -scss: - config_file: .scss-lint.yml - -eslint: - enabled: true - config_file: .eslintrc diff --git a/.scss-lint.yml b/.scss-lint.yml deleted file mode 100644 index 78e35684c..000000000 --- a/.scss-lint.yml +++ /dev/null @@ -1,253 +0,0 @@ -# Default application configuration that all configurations inherit from. - -scss_files: "**/*.scss" -plugin_directories: ['.scss-linters'] - -# List of gem names to load custom linters from (make sure they are already -# installed) -plugin_gems: [] - -# Default severity of all linters. -severity: warning - -linters: - BangFormat: - enabled: true - space_before_bang: true - space_after_bang: false - - BemDepth: - enabled: false - max_elements: 1 - - BorderZero: - enabled: true - convention: zero # or `none` - - ChainedClasses: - enabled: false - - ColorKeyword: - enabled: true - - ColorVariable: - enabled: false - - Comment: - enabled: true - style: silent - - DebugStatement: - enabled: true - - DeclarationOrder: - enabled: true - - DisableLinterReason: - enabled: false - - DuplicateProperty: - enabled: true - - ElsePlacement: - enabled: true - style: same_line # or 'new_line' - - EmptyLineBetweenBlocks: - enabled: true - ignore_single_line_blocks: true - - EmptyRule: - enabled: true - - ExtendDirective: - enabled: false - - FinalNewline: - enabled: true - present: true - - HexLength: - enabled: false - style: short # or 'long' - - HexNotation: - enabled: true - style: lowercase # or 'uppercase' - - HexValidation: - enabled: true - - IdSelector: - enabled: true - - ImportantRule: - enabled: true - - ImportPath: - enabled: true - leading_underscore: false - filename_extension: false - - Indentation: - enabled: true - allow_non_nested_indentation: false - character: space # or 'tab' - width: 2 - - LeadingZero: - enabled: true - style: include_zero # or 'exclude_zero' - - MergeableSelector: - enabled: true - force_nesting: true - - NameFormat: - enabled: false - allow_leading_underscore: true - convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern - - NestingDepth: - enabled: true - max_depth: 4 - ignore_parent_selectors: false - - PlaceholderInExtend: - enabled: false - - PrivateNamingConvention: - enabled: false - prefix: _ - - PropertyCount: - enabled: true - include_nested: false - max_properties: 10 - - PropertySortOrder: - enabled: true - ignore_unspecified: false - min_properties: 2 - separate_groups: false - - PropertySpelling: - enabled: true - extra_properties: [] - disabled_properties: [] - - PropertyUnits: - enabled: true - global: [ - 'ch', 'em', 'ex', 'rem', # Font-relative lengths - 'cm', 'in', 'mm', 'pc', 'pt', 'px', 'q', # Absolute lengths - 'vh', 'vw', 'vmin', 'vmax', # Viewport-percentage lengths - 'deg', 'grad', 'rad', 'turn', # Angle - 'ms', 's', # Duration - 'Hz', 'kHz', # Frequency - 'dpi', 'dpcm', 'dppx', # Resolution - '%'] # Other - properties: {} - - PseudoElement: - enabled: true - - QualifyingElement: - enabled: true - allow_element_with_attribute: false - allow_element_with_class: false - allow_element_with_id: false - - SelectorDepth: - enabled: true - max_depth: 4 - - SelectorFormat: - enabled: true - convention: hyphenated_lowercase # or 'strict_BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern - - Shorthand: - enabled: true - allowed_shorthands: [1, 2, 3] - - SingleLinePerProperty: - enabled: true - allow_single_line_rule_sets: true - - SingleLinePerSelector: - enabled: true - - SpaceAfterComma: - enabled: true - style: one_space # or 'no_space', or 'at_least_one_space' - - SpaceAfterPropertyColon: - enabled: true - style: at_least_one_space # or 'no_space', or 'one_space', or 'aligned' - - SpaceAfterPropertyName: - enabled: true - - SpaceAfterVariableColon: - enabled: false - style: one_space # or 'no_space', 'at_least_one_space' or 'one_space_or_newline' - - SpaceAfterVariableName: - enabled: true - - SpaceAroundOperator: - enabled: true - style: one_space # or 'at_least_one_space', or 'no_space' - - SpaceBeforeBrace: - enabled: true - style: space # or 'new_line' - allow_single_line_padding: false - - SpaceBetweenParens: - enabled: true - spaces: 0 - - StringQuotes: - enabled: false - style: double_quotes # or single_quotes - - TrailingSemicolon: - enabled: true - - TrailingWhitespace: - enabled: true - - TrailingZero: - enabled: false - - TransitionAll: - enabled: false - - UnnecessaryMantissa: - enabled: true - - UnnecessaryParentReference: - enabled: true - - UrlFormat: - enabled: true - - UrlQuotes: - enabled: true - - VariableForProperty: - enabled: false - properties: [] - - VendorPrefix: - enabled: false - identifier_list: base - additional_identifiers: [] - excluded_identifiers: [] - - ZeroUnit: - enabled: true - - Compass::*: - enabled: false diff --git a/Gemfile b/Gemfile index fba33158a..1837b3160 100644 --- a/Gemfile +++ b/Gemfile @@ -145,7 +145,7 @@ gem 'simple_form', '< 5.2' # development dependencies (not as necessary to lock down versions here) group :development do # Seed data - gem 'ldr-development-seeds', github: 'LafayetteCollegeLibraries/ldr-development-seeds', branch: 'main' + # gem 'ldr-development-seeds', github: 'LafayetteCollegeLibraries/ldr-development-seeds', branch: 'main' gem 'listen', '>= 3.0.5', '< 3.8' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring diff --git a/Gemfile.lock b/Gemfile.lock index 8a278f1b5..ee471dcfe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,3 @@ -GIT - remote: https://github.com/LafayetteCollegeLibraries/ldr-development-seeds.git - revision: 0341725c91de6ddea377f15a046467fe6cec215f - branch: main - specs: - ldr-development-seeds (0.0.0) - bulkrax (~> 5) - hyrax (~> 3) - GEM remote: https://rubygems.org/ specs: @@ -1077,10 +1068,6 @@ GEM rexml (~> 3.0) warden (1.2.9) rack (>= 2.0.9) - webdrivers (5.3.1) - nokogiri (~> 1.6) - rubyzip (>= 1.3.0) - selenium-webdriver (~> 4.0, < 4.11) webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -1131,7 +1118,6 @@ DEPENDENCIES jbuilder (~> 2.11.5) jquery-rails (~> 4.6.0) kaminari (~> 1.2.2) - ldr-development-seeds! linkeddata (~> 3.1.6) listen (>= 3.0.5, < 3.8) mini_magick (~> 4.11) @@ -1163,7 +1149,6 @@ DEPENDENCIES stub_env (~> 1.0.4) turbolinks (~> 5.2.1) uglifier (~> 4.2.0) - webdrivers (~> 5) webmock (~> 3.8) BUNDLED WITH diff --git a/config/environments/development.rb b/config/environments/development.rb index 5efd2adf2..96b75861b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -39,7 +39,9 @@ config.action_mailer.perform_caching = false # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log + config.active_support.deprecation = begin + ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_SILENCE_DEPRECATIONS', false)) ? :silence : :log + end # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load diff --git a/config/environments/test.rb b/config/environments/test.rb index 0cff60ba4..61e69e5bb 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -35,9 +35,7 @@ # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr config.active_job.queue_adapter = :test - config.exceptions_app = ->(env) { ErrorController.action(:show).call(env) } end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f07fdd218..a2d3df155 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -36,6 +36,7 @@ Capybara.register_driver :selenium_firefox_headless do |app| browser_options = ::Selenium::WebDriver::Firefox::Options.new + browser_options.binary = ENV['FIREFOX_BINARY_PATH'] if ENV['FIREFOX_BINARY_PATH'].present? browser_options.args << '--headless' Capybara::Selenium::Driver.new(app, browser: :firefox, options: browser_options) end