Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous Release 1.14.0 #661

Merged
merged 17 commits into from
Aug 13, 2024
Merged

Continuous Release 1.14.0 #661

merged 17 commits into from
Aug 13, 2024

Conversation

Splines
Copy link
Member

@Splines Splines commented Jul 7, 2024

Finally, after a few months, this is a new release for MaMpf 🎉 With quite a few lines of code changed...

Splines added 3 commits June 1, 2024 15:20
…648)

* Don't just mount `spec` folder, but complete `app` folder for tests

This is to ensure that local changes in the `app` folder are reflected
in the Docker container such that newly written tests can be run through
without having to rebuild the whole Docker image.

* Exclude `public/` folder from mount

Also see: https://stackoverflow.com/a/56361190/

* Copy everything to `usr/src/app` for precompiling to work & fix `public/` folder mount

Also see https://stackoverflow.com/a/37898591/
#652)

* Setup X11 Cypress GUI forwarding

Also see my StackOverflow question:
https://stackoverflow.com/q/78639075

* Delete unnecessary Cypress sample files

* Simplify Cypress config setup

* Use internal docker host port

* Delete old cypress helper

* Remove e2e configuration

* Fix wrong network assignment in Docker

* Add cypress ESLint plugin back

* Copy up-to-date on-rails commands from GitHub

See this file:
https://github.com/shakacode/cypress-on-rails/blob/master/lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js

* Init dummy submission cypress test

* Clean up comments in cypress-interactive Dockerfile

* Outsource cypress docker setup in separate file

* Remove `run_tests.sh` file

* Add `createUserAndLogin` cypress command

Also updated the cypress user emails and passwords.

* Name cypress users more creatively

* Add own Cypress FactoryBot implementation

* Move cypress controller to subfolder

* Remove cypress-on-rails dependency

Note that at this point, some cypress commands don't work yet.

* Outsource js error parsing logic to its own file

* Add database cleaner and user creator for cypress

* Fix RuboCop errors and improve documentation

* Remove unnecessary `Cypress::` specifier

* Remove unnecessary `index.js` file

* Improve documentation for FactoryBot

* Start Cypress UI automatically with open browser

* Add Cypress tests to GitHub Actions CI/CD

* Pass ./cypress.yml file to docker & split lines

* Disable existing cypress tests for now

will bring them back in a subsequent PR

* Rename submissions spec

* Rename cypress route subjects

* Don't clear entrypoint for cypress tests

* Execute "cypress run" in entrypoint

* Rename archived tests and exclude them from ESLint

* Temporarily disable docker compose cache

* Disable old migrations stemming from globalize gem

Along side this, the schema was automatically updated and got rid of
old translation tables originally created by the globalize gem.
They were still in here as remnant of #609.

* Add back docker compose cache to cypress workflow

* Revert "Disable old migrations stemming from globalize gem"

This reverts commit 88f369e.

* Use `db:schema:load` instead of `db:migrate`

See https://github.com/rails/rails/blob/d43ee2088118425e493766aeb20575e9ce7159d1/actionmailbox/test/dummy/db/schema.rb#L5-L9

We also abort the script if it is called from the production
environment. It's only intended for usage in the dev/test environment.
For production, we have the respective master and worker entrypoints.

* Wait for MaMpf before opening cypress UI
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.64%. Comparing base (4ead9d5) to head (6bde35d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #661   +/-   ##
=======================================
  Coverage   66.63%   66.64%           
=======================================
  Files         309      308    -1     
  Lines        9384     9386    +2     
=======================================
+ Hits         6253     6255    +2     
  Misses       3131     3131           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* Improve some VSCode settings

* Remove custom Ruby LSP command
* Update codecov status check settings

* Modify random ruby lines for testing purposes

* Disable project and patch Codecov reports

* Fix path to codecov config file

* Add "**/*" to codecov paths

* Try out different syntax to disable project/patch

* Revert to new codecov syntax

* Try not to use relative path for codecov.yml

* Try to put codecov config back to root folder

* Add comment explaining situation

* Revert "Modify random ruby lines for testing purposes"

This reverts commit 23fffef.
* Init basic justfiles

* Improve docker and test commands

* Add Just VSCode extension to workspace recommendations

* Add npm script to install latest version of `just`

* Don't print help message in list

* Add more docker `just` commands

* Add more "open in browser" commands

* Improve just installation via yarn commands

* Add newline at end of `.justfile`
* Refactor db initialization file

* Use `bundle exec`

* Try db:migrate instead of db:schema:load

* Run db:schema:load in tests

* Perform SOLR indexing as last step and not in background

* Allow up-reseed to also work when container is not stopped

* Improve echo messages in initialize script

* Fix spelling
* Make lecture cards more reactive

* Fix card header border radius & use blue border color

* Add "hover to play" feature

* Use bootstrap icons for buttons

* Explicitly set footer background color

* Clean up card footer

* Use buttons for media card actions

* Add interactive hover to other sections as well

Also added a default empty screenshot

* Improve media grid breakpoints

* Add another horizontal line above card body

* Import necessary bootstrap files in `media.scss`

* Outline the buttons instead of filling them

* Use auto phrasing for card word break

* Let only lecture tags change color on hover

* Improve styling of header end icons

* Fix download button alignment

* Revert locale logic change

* Make default screenshot more subdued

* Reflect media card changes for watchlist cards

* Reuse medium card for watchlists

* Adjust card header talk people icon

* Wait for turbolinks:load (shining pointer)
* Scaffold annotation overview page

* Show all annotations in card list

* Only show annotations of current user

* Add links to annotations and fix empty comments

* Fix annotation caching issue by fixing initialization

This might fix #637

* Open annotation automatically on link click

* Group annotations by lecture

* Fix accordion header class naming

* Link to blog when no annotation is created yet

* Delete unnecessary whitespace

* Localize text in annotation overview

* Refactor annotations overview controller

* Init view to see students annotations as teacher/editor

* Use existing methods to grab media

* Improve description of student annotations

* Use links to feedback player for shared annotations

* Use same bootstrap button for "Create annotation"

* Only show students annotations if current user is teacher or editor

* Fix grammar mistake

* Refactor annotations overview controller

* Refactor accordion label assignment

* Color cards shared by students according to category

* Rename js file to "url_annotation_opener"

* Clarify color choices in user-facing text

* Get rid of turbolinks:load and apply directly

This is to avoid caching issues.

* Fix initial state of accordion buttons

* Show medium title and date

* Expose MaMpf to another port to avoid clashing with dev

* Add an endpoint to skip validation when creating factory

* Use local file system also in test environment

* Enable reloading in cypress tests

* Wrap value in `createUserAndLogin` (cypress)

* Init annotations factory for usage in cypress tests

* Customize title of lectures/lessons

* Test appearance of annotation overview cards

* Use parameterized tests and test timestamp

* Add back missing index variable in test

* Test annotation border color

* Add factorybot to known words

* Add i18n retrieval in Cypress tests

* Test annotation sections & improve i18n controller

* Test student annotation cards & more properties of cards

* Move annotation section test to the top

* Move "grouped by lecture" test up

* Test rendering of math content

* Move overview controller to existing annotation controller

(it is now called "index")

* Move annotation-retrieval to user model

* Move annotation_open_link to helper

* Make extraction method private in controller

Also removed the TODO note regarding nil values

* Remove TODO note as "Won't be done"

* Remove unnecessary long url helper calling

* Pass in medium instead of medium id

* Fix spelling mistake in media helper

* Use link_to Rails helper

* Don't use custom route name for annotations overview

It is now just the "index" and the route is called
"/annotations"

* Sort according to lecture.updated_at

* Extract "annotations by lecture" retrieval to own method

This is to avoid duplicated code.

* Add comment explaining transform keys

* Rename partial view to index_accordion

* Extract border color to helper method

* Open annotations with video in new tab

* Add number of annotations in accordion header

* Add default title to lecture factory with_title

* Fix ordering in cypress tests & sort according to creation date

* Fix cypress tests when anchor link opens new tab

* Fix ordering in math content test

* Fix ordering and new tab in feedback video test

* Fix border color test order

* Change default cypress viewport dimensions

* Place :index ability in other code block

* Use params instead of manually constructing url

* Use URI helper to construct annotation id link

* Use flat_map instead of map(...).flatten
* Add deletion_date to users in DB

* Set deletion date in user cleaner

* Remove old user cleaner code & add first unit test

* Don't just mount `spec` folder, but complete `app` folder for tests

This is to ensure that local changes in the `app` folder are reflected
in the Docker container such that newly written tests can be run through
without having to rebuild the whole Docker image.

* Revert "Don't just mount `spec` folder, but complete `app` folder for tests"

This reverts commit b3f3ec8.

* Add more unit tests for UserCleaner

* Improve tests for deletion of generic users only

* Split test for deletion of users

* Unset deletion date after successful user login

* Implement un-setting the deletion date & add tests

* Rewrite deletion unsetting to reuse existing method

* Send initial warning mail about deletion in 40 days

* Send additional warning mails when deletion date is near

* Add schema comment pointing to UserCleaner

* Test mail delivery

* Add "!" to unsafe method

* Use Rails logger to log info about deleted users

* Move UserCleaner from models to workers

* Setup user cleaner cron job to run daily

* Improve user cleaner doc strings & refactor

* Remove user ghost hash remnants

* Avoid unnecessary `to_date` conversion

* Improve comment for `after_authentication` hook

* Fix wording in comment

* Make better use of `let` RSpec keyword

* Limit the number of users deleted in one run

* Simplify unsetting deletion date logic

* Define `active_users` to reduce SQL operations

* Use `7.1` as Rails version specifier in migrations

* Explicitly set `INACTIVE_USER_THRESHOLD` in tests

* Make `MAX_DELETIONS_PER_RUN` an env variable

* Don't send deletion warning mails to non-generic users

* Send a final deletion mail once the user is deleted

* Move user cleaner file back to models folder

* Rename user cleaner files

* Count users without last_sign_in_at date as inactive

* Improve docstring for `inactive_users`

* Shorten user cleaner comment in docker.env

* Introduce `PRODUCTION_NAME` env variable

* Don't run user cleaner for mampf-experimental/dev

* Rewrite logic for when user cleaner is started

* Fix rubocop "where range"

* Try to use after instead of append_after

* Revert "Try to use after instead of append_after"

This reverts commit 90aa662.

* Try to not use cached docker in CI/CD unit tests

* Revert "Try to not use cached docker in CI/CD unit tests"

This reverts commit 069032b.

* Move transaction strategy to before each block

* Use around each in database cleaner config

* Use version 2.1.0 of database cleaner

* Revert "Use version 2.1.0 of database cleaner"

This reverts commit 6dfcd96.

* Add missing require "rails_helper"

* Try deletion strategy of database cleaner
@Splines Splines merged commit ca2e126 into main Aug 13, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants