diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..de3b4a6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,31 @@ +### [Pivotal Tracker Link][tracker] + + +[tracker]: https://www.pivotaltracker.com/story/show/your-story-id + +## What this PR does: + + +This pull request fixes|implements (pick one...) ______. + +### Include screenshots, videos, etc. + +#### Who authored this PR? + + + +### How should this PR be tested? + +* Is there a deploy we can view? +* What do the specs/features test? +* Are there edge cases to watch out for? + +#### Are there any complications to deploying this? + + + +### Checklist: + +- [ ] Has this been deployed to a staging environment or reviewed by a customer? +- [ ] Tag someone for code review (either a coach / team member) +- [ ] I have renamed the branch to match PivotTracker's suggested one (necessary for BlueJay) (e.g. `michael/12345-add-new-feature` Any branch name will do as long as the story ID is there. You can use `git checkout -b [new-branch-name]`) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5cc1a98 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install Ruby 3.0.0 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0.0 + + - name: Set up Code Climate test-reporter + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + ./cc-test-reporter before-build + + - name: Install bundler + run: | + gem install bundler + - name: Install Dependencies + run: bundle install + - name: Set up test database + env: + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + bundle exec rake db:setup + bundle exec rake db:create db:migrate + - name: run Cucumber tests and capture coverage + env: + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + bundle exec cucumber + ./cc-test-reporter format-coverage --output coverage/codeclimate.$SUITE.json --input-type simplecov + - name: run RSpec tests + env: + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + bundle exec rspec + ./cc-test-reporter format-coverage --output coverage/codeclimate.$SUITE.json --input-type simplecov + - name: Publish code coverage + run: | + export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" + ./cc-test-reporter sum-coverage coverage/codeclimate.*.json + ./cc-test-reporter upload-coverage --id ${{ secrets.CC_TEST_REPORTER_ID }} + ./cc-test-reporter after-build --id ${{ secrets.CC_TEST_REPORTER_ID }} + diff --git a/Gemfile b/Gemfile index dde17bc..ea3b649 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,8 @@ gem 'jbuilder', '~> 2.7' # gem 'image_processing', '~> 1.2' gem 'omniauth' +gem "omniauth-github" +gem "omniauth-rails_csrf_protection" gem 'octokit', '~> 4.0' # Reduces boot times through caching; required in config/boot.rb @@ -45,11 +47,13 @@ end group :test do gem 'rspec-rails' gem 'guard-rspec' - gem 'simplecov', :require => false + gem 'simplecov', '~> 0.22.0', :require => false + gem 'simplecov_json_formatter', :require => false gem 'cucumber-rails', :require => false gem 'cucumber-rails-training-wheels' # basic imperative step defs like "Then I should see..." gem 'database_cleaner' # required by Cucumber - gem 'simplecov', require: false + gem 'codeclimate-test-reporter', require: false + # gem 'capybara-webkit' end # make sure the following gems are in your production group: @@ -61,6 +65,16 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] -gem "omniauth-github" gem "active_type", "= 1.3.2" + +gem 'faraday-retry' + +gem "font-awesome-sass", "~> 6.4.0" + +# gem 'jquery-rails' + +gem 'jquery-rails', '~> 4.3', '>= 4.3.3' +gem 'rails-ujs', '~> 0.1.0' +gem 'database_cleaner' +gem "selenium-webdriver" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 4fcb77d..7eb4ea0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,149 +1,151 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.3) - actionpack (= 6.1.3) - activesupport (= 6.1.3) + actioncable (6.1.7.2) + actionpack (= 6.1.7.2) + activesupport (= 6.1.7.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.3) - actionpack (= 6.1.3) - activejob (= 6.1.3) - activerecord (= 6.1.3) - activestorage (= 6.1.3) - activesupport (= 6.1.3) + actionmailbox (6.1.7.2) + actionpack (= 6.1.7.2) + activejob (= 6.1.7.2) + activerecord (= 6.1.7.2) + activestorage (= 6.1.7.2) + activesupport (= 6.1.7.2) mail (>= 2.7.1) - actionmailer (6.1.3) - actionpack (= 6.1.3) - actionview (= 6.1.3) - activejob (= 6.1.3) - activesupport (= 6.1.3) + actionmailer (6.1.7.2) + actionpack (= 6.1.7.2) + actionview (= 6.1.7.2) + activejob (= 6.1.7.2) + activesupport (= 6.1.7.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.3) - actionview (= 6.1.3) - activesupport (= 6.1.3) + actionpack (6.1.7.2) + actionview (= 6.1.7.2) + activesupport (= 6.1.7.2) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.3) - actionpack (= 6.1.3) - activerecord (= 6.1.3) - activestorage (= 6.1.3) - activesupport (= 6.1.3) + actiontext (6.1.7.2) + actionpack (= 6.1.7.2) + activerecord (= 6.1.7.2) + activestorage (= 6.1.7.2) + activesupport (= 6.1.7.2) nokogiri (>= 1.8.5) - actionview (6.1.3) - activesupport (= 6.1.3) + actionview (6.1.7.2) + activesupport (= 6.1.7.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_type (1.3.2) activerecord (>= 3.2) - activejob (6.1.3) - activesupport (= 6.1.3) + activejob (6.1.7.2) + activesupport (= 6.1.7.2) globalid (>= 0.3.6) - activemodel (6.1.3) - activesupport (= 6.1.3) - activerecord (6.1.3) - activemodel (= 6.1.3) - activesupport (= 6.1.3) - activestorage (6.1.3) - actionpack (= 6.1.3) - activejob (= 6.1.3) - activerecord (= 6.1.3) - activesupport (= 6.1.3) - marcel (~> 0.3.1) - mimemagic (~> 0.3.2) - activesupport (6.1.3) + activemodel (6.1.7.2) + activesupport (= 6.1.7.2) + activerecord (6.1.7.2) + activemodel (= 6.1.7.2) + activesupport (= 6.1.7.2) + activestorage (6.1.7.2) + actionpack (= 6.1.7.2) + activejob (= 6.1.7.2) + activerecord (= 6.1.7.2) + activesupport (= 6.1.7.2) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) bindex (0.8.1) - bootsnap (1.7.2) - msgpack (~> 1.0) + bootsnap (1.16.0) + msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) - capybara (3.35.3) + capybara (3.38.0) addressable + matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) + codeclimate-test-reporter (1.0.7) + simplecov coderay (1.1.3) - concurrent-ruby (1.1.8) + concurrent-ruby (1.2.2) crass (1.0.6) - cucumber (5.3.0) + cucumber (8.0.0) builder (~> 3.2, >= 3.2.4) - cucumber-core (~> 8.0, >= 8.0.1) - cucumber-create-meta (~> 2.0, >= 2.0.2) - cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) - cucumber-gherkin (~> 15.0, >= 15.0.2) - cucumber-html-formatter (~> 9.0, >= 9.0.0) - cucumber-messages (~> 13.1, >= 13.1.0) - cucumber-wire (~> 4.0, >= 4.0.1) - diff-lcs (~> 1.4, >= 1.4.4) - multi_test (~> 0.1, >= 0.1.2) - sys-uname (~> 1.2, >= 1.2.1) - cucumber-core (8.0.1) - cucumber-gherkin (~> 15.0, >= 15.0.2) - cucumber-messages (~> 13.0, >= 13.0.1) - cucumber-tag-expressions (~> 2.0, >= 2.0.4) - cucumber-create-meta (2.0.4) - cucumber-messages (~> 13.1, >= 13.1.0) - sys-uname (~> 1.2, >= 1.2.1) - cucumber-cucumber-expressions (10.3.0) - cucumber-gherkin (15.0.2) - cucumber-messages (~> 13.0, >= 13.0.1) - cucumber-html-formatter (9.0.0) - cucumber-messages (~> 13.0, >= 13.0.1) - cucumber-messages (13.2.1) - protobuf-cucumber (~> 3.10, >= 3.10.8) - cucumber-rails (2.2.0) + cucumber-ci-environment (~> 9.0, >= 9.0.4) + cucumber-core (~> 11.0, >= 11.0.0) + cucumber-cucumber-expressions (~> 15.1, >= 15.1.1) + cucumber-gherkin (~> 23.0, >= 23.0.1) + cucumber-html-formatter (~> 19.1, >= 19.1.0) + cucumber-messages (~> 18.0, >= 18.0.0) + diff-lcs (~> 1.5, >= 1.5.0) + mime-types (~> 3.4, >= 3.4.1) + multi_test (~> 1.1, >= 1.1.0) + sys-uname (~> 1.2, >= 1.2.2) + cucumber-ci-environment (9.1.0) + cucumber-core (11.0.0) + cucumber-gherkin (~> 23.0, >= 23.0.1) + cucumber-messages (~> 18.0, >= 18.0.0) + cucumber-tag-expressions (~> 4.1, >= 4.1.0) + cucumber-cucumber-expressions (15.2.0) + cucumber-gherkin (23.0.1) + cucumber-messages (~> 18.0, >= 18.0.0) + cucumber-html-formatter (19.2.0) + cucumber-messages (~> 18.0, >= 18.0.0) + cucumber-messages (18.0.0) + cucumber-rails (2.6.1) capybara (>= 2.18, < 4) - cucumber (>= 3.0.2, < 6) - mime-types (~> 3.2) - nokogiri (~> 1.8) - rails (>= 5.0, < 7) + cucumber (>= 3.2, < 9) + mime-types (~> 3.3) + nokogiri (~> 1.10) + railties (>= 5.0, < 8) + rexml (~> 3.0) + webrick (~> 1.7) cucumber-rails-training-wheels (1.0.0) cucumber-rails (>= 1.1.1) - cucumber-tag-expressions (2.0.4) - cucumber-wire (4.0.1) - cucumber-core (~> 8.0, >= 8.0.1) - cucumber-cucumber-expressions (~> 10.3, >= 10.3.0) - cucumber-messages (~> 13.0, >= 13.0.1) + cucumber-tag-expressions (4.1.0) database_cleaner (2.0.1) database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.0) + database_cleaner-active_record (2.0.1) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - diff-lcs (1.4.4) - docile (1.3.5) - erubi (1.10.0) - faraday (1.3.0) - faraday-net_http (~> 1.0) - multipart-post (>= 1.2, < 3) - ruby2_keywords - faraday-net_http (1.0.1) - ffi (1.14.2) - formatador (0.2.5) - globalid (0.4.2) - activesupport (>= 4.2.0) - guard (2.16.2) + date (3.3.3) + diff-lcs (1.5.0) + docile (1.4.0) + erubi (1.12.0) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-net_http (3.0.2) + faraday-retry (2.1.0) + faraday (~> 2.0) + ffi (1.15.5) + font-awesome-sass (6.4.0) + sassc (~> 2.0) + formatador (1.1.0) + globalid (1.1.0) + activesupport (>= 5.0) + guard (2.18.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) - pry (>= 0.9.12) + pry (>= 0.13.0) shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) @@ -151,138 +153,158 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - hashie (4.1.0) - i18n (1.8.9) + hashie (5.0.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) - jbuilder (2.11.2) + jbuilder (2.11.5) + actionview (>= 5.0.0) activesupport (>= 5.0.0) - jwt (2.2.2) - listen (3.4.1) + jquery-rails (4.5.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jwt (2.7.0) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.9.0) + loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.8) - mail (2.7.1) + mail (2.8.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) + net-imap + net-pop + net-smtp + marcel (1.0.2) + matrix (0.4.2) method_source (1.0.0) - middleware (0.1.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0212) - mini_mime (1.0.2) - minitest (5.14.3) - msgpack (1.4.2) - multi_json (1.15.0) - multi_test (0.1.2) + mime-types-data (3.2023.0218.1) + mini_mime (1.1.2) + minitest (5.18.0) + msgpack (1.6.1) + multi_test (1.1.0) multi_xml (0.6.0) - multipart-post (2.1.1) nenv (0.3.0) - nio4r (2.5.5) - nokogiri (1.11.1-x86_64-darwin) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.8) + nokogiri (1.14.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.11.1-x86_64-linux) + nokogiri (1.14.2-x86_64-linux) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - oauth2 (1.4.4) - faraday (>= 0.8, < 2.0) + oauth2 (2.0.9) + faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) - multi_json (~> 1.3) multi_xml (~> 0.5) - rack (>= 1.2, < 3) - octokit (4.20.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - omniauth (1.9.1) + rack (>= 1.2, < 4) + snaky_hash (~> 2.0) + version_gem (~> 1.1) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + omniauth (2.1.1) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) - omniauth-github (1.4.0) - omniauth (~> 1.5) - omniauth-oauth2 (>= 1.4.0, < 2.0) - omniauth-oauth2 (1.7.1) - oauth2 (~> 1.4) - omniauth (>= 1.9, < 3) - pg (1.2.3) - protobuf-cucumber (3.10.8) - activesupport (>= 3.2) - middleware - thor - thread_safe - pry (0.14.0) + rack (>= 2.2.3) + rack-protection + omniauth-github (2.0.1) + omniauth (~> 2.0) + omniauth-oauth2 (~> 1.8) + omniauth-oauth2 (1.8.0) + oauth2 (>= 1.4, < 3) + omniauth (~> 2.0) + omniauth-rails_csrf_protection (1.0.1) + actionpack (>= 4.2) + omniauth (~> 2.0) + pg (1.4.6) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.6) - puma (5.2.1) + public_suffix (5.0.1) + puma (5.6.5) nio4r (~> 2.0) - racc (1.5.2) - rack (2.2.3) - rack-mini-profiler (2.3.1) + racc (1.6.2) + rack (2.2.6.3) + rack-mini-profiler (2.3.4) rack (>= 1.2.0) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (6.1.3) - actioncable (= 6.1.3) - actionmailbox (= 6.1.3) - actionmailer (= 6.1.3) - actionpack (= 6.1.3) - actiontext (= 6.1.3) - actionview (= 6.1.3) - activejob (= 6.1.3) - activemodel (= 6.1.3) - activerecord (= 6.1.3) - activestorage (= 6.1.3) - activesupport (= 6.1.3) + rack-protection (3.0.5) + rack + rack-test (2.0.2) + rack (>= 1.3) + rails (6.1.7.2) + actioncable (= 6.1.7.2) + actionmailbox (= 6.1.7.2) + actionmailer (= 6.1.7.2) + actionpack (= 6.1.7.2) + actiontext (= 6.1.7.2) + actionview (= 6.1.7.2) + activejob (= 6.1.7.2) + activemodel (= 6.1.7.2) + activerecord (= 6.1.7.2) + activestorage (= 6.1.7.2) + activesupport (= 6.1.7.2) bundler (>= 1.15.0) - railties (= 6.1.3) + railties (= 6.1.7.2) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) + rails-ujs (0.1.0) + railties (>= 3.1) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (6.1.3) - actionpack (= 6.1.3) - activesupport (= 6.1.3) + railties (6.1.7.2) + actionpack (= 6.1.7.2) + activesupport (= 6.1.7.2) method_source - rake (>= 0.8.7) + rake (>= 12.2) thor (~> 1.0) - rake (13.0.3) - rb-fsevent (0.10.4) + rake (13.0.6) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (2.0.3) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + regexp_parser (2.7.0) + rexml (3.2.5) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.1) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (4.0.2) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.10.2) - ruby2_keywords (0.0.4) + rspec-support (~> 3.12.0) + rspec-rails (6.0.1) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.11) + rspec-expectations (~> 3.11) + rspec-mocks (~> 3.11) + rspec-support (~> 3.11) + rspec-support (3.12.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) @@ -293,69 +315,87 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sawyer (0.8.2) + sawyer (0.9.2) addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) + faraday (>= 0.17.3, < 3) + selenium-webdriver (4.9.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) shellany (0.0.1) - simplecov (0.21.2) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) - simplecov_json_formatter (0.1.2) - sprockets (4.0.2) + simplecov_json_formatter (0.1.4) + snaky_hash (2.0.1) + hashie + version_gem (~> 1.1, >= 1.1.1) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.4.2) + sqlite3 (1.6.1-arm64-darwin) + sqlite3 (1.6.1-x86_64-linux) sys-uname (1.2.2) ffi (~> 1.1) - thor (1.1.0) - thread_safe (0.3.6) - tilt (2.0.10) - tzinfo (2.0.4) + thor (1.2.1) + tilt (2.1.0) + timeout (0.3.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - web-console (4.1.0) + version_gem (1.1.1) + web-console (4.2.0) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - websocket-driver (0.7.3) + webrick (1.8.1) + websocket (1.2.9) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.4.2) + zeitwerk (2.6.7) PLATFORMS - x86_64-darwin-19 - x86_64-darwin-20 + arm64-darwin-21 x86_64-linux DEPENDENCIES active_type (= 1.3.2) bootsnap (>= 1.4.4) byebug + codeclimate-test-reporter cucumber-rails cucumber-rails-training-wheels database_cleaner + faraday-retry + font-awesome-sass (~> 6.4.0) guard-rspec jbuilder (~> 2.7) + jquery-rails (~> 4.3, >= 4.3.3) listen (~> 3.3) octokit (~> 4.0) omniauth omniauth-github + omniauth-rails_csrf_protection pg puma (~> 5.0) rack-mini-profiler (~> 2.0) rails (~> 6.1.2, >= 6.1.2.1) + rails-ujs (~> 0.1.0) rails_12factor rspec-rails sass-rails (>= 6) - simplecov + selenium-webdriver + simplecov (~> 0.22.0) + simplecov_json_formatter sqlite3 (~> 1.4) tzinfo-data web-console (>= 4.1.0) diff --git a/README.md b/README.md index 79c7716..c77b5c5 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,13 @@ [![Bluejay Dashboard](https://img.shields.io/badge/Bluejay-Dashboard_9-blue.svg)](http://dashboard.bluejay.governify.io/dashboard/script/dashboardLoader.js?dashboardURL=https://reporter.bluejay.governify.io/api/v4/dashboards/tpa-CS169L-GH-fshamji_PrairieLearn-EECS/main) +#sp23 + + + +![build](https://github.com/cs169/PrairieLearn-EECS/actions/workflows/ci.yml/badge.svg) + +[![Bluejay Dashboard](https://img.shields.io/badge/Bluejay-Dashboard_01-blue.svg)](http://dashboard.bluejay.governify.io/dashboard/script/dashboardLoader.js?dashboardURL=https://reporter.bluejay.governify.io/api/v4/dashboards/tpa-CS169L-23-GH-cs169_PrairieLearn-EECS/main) --- ## Description @@ -63,13 +70,16 @@ For more information regarding PrairieLearn, go to https://prairielearn.readthed - Go to https://prairielearn-eecs.herokuapp.com - Login to GitHub via 3rd party authentication -- Select a repository you would like to synchronize from the list and click 'Synchronize'; This might take a couple minutes so sit back and relax +- Select a repository you would like to synchronize from the list (only private repositories will show up). Also, make sure there is a directory called 'questions' in your repo that contains all of the questions subdirectories. Then click 'Synchronize'; This might take a couple minutes so sit back and relax - Configure your assessment via the column on the right with all its metadata +- The left column shows all of the questions in the user's repo. +- User can search for a question using the keywords they remember. +- Click +Zone to create a Zone of questions. Enter the zone title and zone comment at the top of the zone. +- Click +Pool to create a pool of questions inside the zone, user can add comments at the entry box to remind them about the function of the questions. - Drag-and-drop questions from the left column to the middle column and set the points for each questions. - Click 'Export' to download your JSON file - Logout when you are done using the application -(Video explaining this will be added soon) --- @@ -93,6 +103,13 @@ For more information regarding PrairieLearn, go to https://prairielearn.readthed - Move JavaScript out of .erb files - Consider using AWS and modify API calls to use 'git pull' to create a traversable file directory instead of making API calls per folder +### Spring 2023: + +- Zones and pools are available for users to use. +- Can search for questinos using the search bar on the top left. +- The questions shown now are shown using descriptive titles. + + --- ## Steps to Deploy to Heroku: @@ -124,5 +141,8 @@ The application is making a single API calls for every directory in a repository - Haolin Zhu (haolinz@berkeley.edu) - Sanwu Luo (sanwuluo35@berkeley.edu) - Timotius Vincent (timotiusvincent@berkeley.edu) - +- Yuhan Dong (ydong19@berkeley.edu) +- Guobin Liang (a544266477@berkeley.edu) +- Fernanda Pisconte (fpisconte@berkeley.edu) +- Chithra Anand (chithra.rajan@berkeley.edu) --- diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..deacb7a --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,4 @@ +//= require jquery +//= require jquery_ujs +//= require bootstrap +//= require_tree . \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.scss similarity index 96% rename from app/assets/stylesheets/application.css rename to app/assets/stylesheets/application.scss index d05ea0f..4f3aee9 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.scss @@ -13,3 +13,4 @@ *= require_tree . *= require_self */ + @import "font-awesome"; diff --git a/app/assets/stylesheets/questions.css b/app/assets/stylesheets/questions.css index 82be0e0..81da859 100644 --- a/app/assets/stylesheets/questions.css +++ b/app/assets/stylesheets/questions.css @@ -18,7 +18,6 @@ nav { } .qcol { - margin-top: 2%; float: right; } @@ -39,6 +38,7 @@ nav { border-right: 1px solid gray; margin-left: 5px; margin-right: 5px; + height: 90%; } .rightcol { @@ -48,7 +48,7 @@ nav { } .configs { - height: calc(100vh - 17rem); + height: auto; overflow-y: auto; overflow-x: hidden; } @@ -79,7 +79,9 @@ input, select { .mcontainer { margin: 2%; - height: calc(100vh - 17rem); + min-height: 15vh; + max-height: 100vh; + height: auto; overflow: auto; } @@ -112,3 +114,27 @@ input, select { float: right; margin-right: 1rem; } + +.zone { + display: flex; + height: auto; + flex-direction: column; + margin: 2%; + overflow-y: auto; + overflow-x: hidden; +} + +.sqcontainer { + margin: 2%; + height: 80vh; + overflow: auto; +} + +.gutter-2.row { + margin-right: -1px; + margin-left: -1px; +} +.gutter-2 > [class^="col-"], .gutter-2 > [class^=" col-"] { + padding-right: 2px; + padding-left: 2px; +} diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index 6a4411b..4c6bce6 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -2,9 +2,6 @@ class LoginController < ApplicationController before_action :already_logged_in, except: [:logout] - # Commenting this out since it is not used. Delete later. - # def login; end - def github create_session(:create_github_user) end diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index d65f612..6e10015 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -1,13 +1,29 @@ class QuestionsController < ApplicationController # Display all questions pulled from the synced repo def index + @questions = find_user_repo + end + + def search + @questions = find_user_repo + @search_terms = params[:search] + @questions = @questions.where("title LIKE :search_terms OR descriptivetitle LIKE :search_terms", search_terms: "%" + Question.sanitize_sql_like(params[:search]) + "%") + respond_to do |format| + format.html { render partial: 'search_questions' } + end + end + + private + + def find_user_repo if session[:current_user_id].present? and session[:selected_repo].present? current_user = User.find(session[:current_user_id]) if current_user != nil and current_user.repo == session[:selected_repo] - @questions = Question.where(repo: session[:selected_repo]) + questions = Question.where(repo: session[:selected_repo]) end else - @questions = Question.where(repo: "0") + questions = Question.where(repo: "0") end + questions end -end \ No newline at end of file +end diff --git a/app/controllers/repo_controller.rb b/app/controllers/repo_controller.rb index 469e37e..a00d466 100644 --- a/app/controllers/repo_controller.rb +++ b/app/controllers/repo_controller.rb @@ -1,5 +1,7 @@ # controller to get a list of repos and questions from repo require 'octokit' +require 'json' +require "base64" class RepoController < ApplicationController # All method require authenticated user @@ -78,7 +80,14 @@ def addQuestions(client, repo, path) # If .JSON file is found, keep the path if file.name == "info.json" question_name = file.path.partition('/')[2].rpartition('/')[0] - Question.create(title: question_name, repo: repo) + + path_str = path+"/info.json" + + contentsJsonInfobase64 = client.contents(repo, path: path_str) + + descriptive_title = JSON.parse(Base64.decode64(contentsJsonInfobase64[:content]))["title"] + + Question.create(title: question_name, descriptivetitle: descriptive_title, repo: repo) end # Recursively call the helper method if current file is a folder if file.type == 'dir' diff --git a/app/views/login/home.html.erb b/app/views/login/home.html.erb index c085a20..78e2896 100644 --- a/app/views/login/home.html.erb +++ b/app/views/login/home.html.erb @@ -25,13 +25,14 @@
-Welcome!
To start creating a new assessment, please login.
- <%= link_to 'Login to Github', :github_login, :class => 'btn btn-primary' %> + <%= form_tag('/auth/github', method: 'post', data: {turbo: false}) do %> + + <% end %>