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.15.0 #723

Merged
merged 32 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0d39b9e
Add `just` commands for docker logs (#681)
Splines Aug 20, 2024
6d09e9e
Fix lecture edit page if active term is not set (#683)
fosterfarrell9 Aug 21, 2024
dd0d68b
Clean up Gemfile & pin all gems (#680)
Splines Aug 22, 2024
d48e369
Remove unnecessary `with_teacher_by_id` trait (#687)
Splines Aug 23, 2024
78467de
Explicitly set locale to German in course specs (#692)
Splines Sep 8, 2024
c00ae31
Vouchers for user promotion - Part 1: Introduction of Vouchers (#670)
fosterfarrell9 Sep 9, 2024
7be8cab
Deal with registration edge cases in UserCleaner (#693)
Splines Sep 19, 2024
8486265
Update contribution guide & year in license file and footer (#689)
Splines Sep 19, 2024
5caf307
Update Gemfile dependencies (`bundle update`) (#688)
Splines Sep 19, 2024
73b0fc8
Fix annotation feedback not shown when share feature is disabled (#686)
Splines Sep 19, 2024
49cf16a
Apply Rails/RootPathnameMethods linting suggestion (RuboCop) (#695)
Splines Sep 21, 2024
76e3329
Allow dynamic instance method calls on FactoryBot objects in Cypress …
Splines Sep 25, 2024
af47a3f
Init support for entity-relationship-diagram creation (#697)
Splines Oct 4, 2024
7ba50e8
Vouchers for user promotion - Part 2: Redemption (#671)
fosterfarrell9 Nov 10, 2024
8d58aea
Add Ruby Test Explorer to recommended VSCode extensions (#705)
Splines Nov 23, 2024
ce83dc3
Init dependencies module in Just (#711)
Splines Nov 26, 2024
7dd3a33
Fix wrong radio button values (annotation status) (#708)
Splines Dec 1, 2024
e97ec8a
Update RuboCop & fix offenses by new lints (#714)
Splines Dec 1, 2024
2e4f26d
Update Gems (#712)
Splines Dec 1, 2024
eff6ce7
Update Node.js dependencies (#713)
Splines Dec 1, 2024
d5a0f09
Fix flaky user deletion & redemption cypress test (#718)
Splines Dec 3, 2024
8196e38
Disable Style/ArrayIntersect lint on one line (#720)
Splines Dec 3, 2024
79cb0b3
Add "no results" messages pointing to new voucher system (#707)
Splines Dec 3, 2024
8d83274
Redesign profile page (#706)
Splines Dec 8, 2024
1e19a40
Add `just docker rebuild` command (#719)
Splines Dec 8, 2024
bbe0833
Merge hotfixes of `main` into `dev` (#722)
Splines Dec 8, 2024
94000a8
Merge branch 'main' into dev
Splines Dec 8, 2024
34a99de
Fix flaky Cypress submission test (#725)
Splines Dec 9, 2024
6382fb5
Fix failing `just docker rebuild` script (#724)
Splines Dec 9, 2024
a53ef17
Fix flaky voucher redemption Cypress test (#726)
Splines Dec 9, 2024
9dcd2b9
Update security policy (#727)
Splines Dec 13, 2024
da59363
Remove obsolete tutorial name seacrh field (#728)
fosterfarrell9 Dec 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .config/.cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,35 @@ module.exports = {
// Base URL is set via Docker environment variable
viewportHeight: 1000,
viewportWidth: 1400,

// https://docs.cypress.io/api/plugins/browser-launch-api#Changing-browser-preferences
setupNodeEvents(on, _config) {
on("before:browser:launch", (browser, launchOptions) => {
if (browser.family === "chromium" && browser.name !== "electron") {
// auto open devtools
launchOptions.args.push("--auto-open-devtools-for-tabs");

// TODO (clipboard): We use the obsolete clipboard API from browsers, i.e.
// document.execCommand("copy"). There's a new Clipboard API that is supported
// by modern browsers. Once we switch to that API, use the following code
// to allow requesting permission (clipboard permission) in a non-secure
// context (http). Remaining TODO in this case: search for the equivalent
// flag in Firefox & Electron (if we also want to test them).
// launchOptions.args.push("--unsafely-treat-insecure-origin-as-secure=http://mampf:3000");
}

if (browser.family === "firefox") {
// auto open devtools
launchOptions.args.push("-devtools");
}

if (browser.name === "electron") {
// auto open devtools
launchOptions.preferences.devTools = true;
}

return launchOptions;
});
},
},
};
3 changes: 3 additions & 0 deletions .config/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ Style/MethodCallWithArgsParentheses:
Style/RedundantReturn:
AllowMultipleReturnValues: true

Style/SafeNavigationChainLength:
Max: 4

Style/StringLiterals:
EnforcedStyle: double_quotes

Expand Down
22 changes: 22 additions & 0 deletions .config/commands/deps.justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[private]
help:
@just --list --justfile {{source_file()}}

# Shows the Dependabot alerts on GitHub
alerts:
#!/usr/bin/env bash
xdg-open https://github.com/MaMpf-HD/mampf/security/dependabot

# Updates the Bundler package manager itself (NOT the Ruby gems)
update-bundler:
bundle update --bundler

# Updates Ruby gems
update-gems:
bundle update

# Updates Node.js packages
update-nodejs:
# You may have to run this command beforehand:
# sudo chown your_user_name -R ./node_modules/
yarn upgrade
33 changes: 32 additions & 1 deletion .config/commands/docker.justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Prints this help message
[private]
help:
@just --list --justfile {{source_file()}}
Expand All @@ -9,6 +8,19 @@ help:
cd {{justfile_directory()}}/docker/development/
docker compose up {{args}}

# Starts the dev docker containers (detached) & shows MaMpf logs
up-logs *args:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose up -d {{args}}
docker compose logs -f mampf

# Shows the log of the specified container
@logs name="mampf":
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose logs -f {{name}}

# Starts the dev docker containers and preseeds the database
[confirm("This will reset all your data in the database locally. Continue? (y/n)")]
up-reseed *args:
Expand Down Expand Up @@ -47,3 +59,22 @@ up-reseed *args:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose exec mampf bundle exec rails c

# Rebuilds the most essential containers in the dev or test environment
rebuild env="dev":
#!/usr/bin/env bash
environment={{ if env == "test" {"test"} else {"development"} }}
echo "Rebuilding in env: ${environment}"
cd {{justfile_directory()}}/docker/${environment}

# Remove
docker compose rm -s mampf
if [ "$environment" = "development" ]; then
docker compose rm -s webpacker
fi

# Rebuild
docker compose build mampf
if [ "$environment" = "development" ]; then
docker compose build webpacker
fi
1 change: 0 additions & 1 deletion .config/commands/test.justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Prints this help message
[private]
help:
@just --list --justfile {{source_file()}}
Expand Down
70 changes: 70 additions & 0 deletions .config/commands/utils.justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[private]
help:
@just --list --justfile {{source_file()}}

# Generates entity-relationship diagrams (ERD) of the database
erd:
#!/usr/bin/env bash

# Make sure the mampf dev container is running
cd {{justfile_directory()}}/docker/development/
if [ -z "$(docker compose ps --services --filter 'status=running' | grep mampf)" ]; then
echo "The mampf dev container is not running. Please start it first (use 'just docker')."
exit 1
fi

mkdir -p {{justfile_directory()}}/tmp/erd/

# ▶ Generate ERDs
# Customize it with options from here: https://voormedia.github.io/rails-erd/customise.html
# Also see the output from: 'bundle exec erd --help' (inside the dev container)

# Ignore some tables
ignored_thredded="Thredded::Post,Thredded::UserPostNotification,Thredded::PrivateUser,Thredded::UserPrivateTopicReadState,Thredded::PrivateTopic,Thredded::MessageboardUser,Thredded::PrivatePost,Thredded:UserDetail,Thredded::MessageboardGroup,Thredded::Messageboard,Thredded::Category,Thredded::TopicCategory,Thredded::Topic,Thredded::UserTopicReadState,Thredded::UserTopicFollow,Thredded::NotificationsForFollowedTopics,Thredded::MessageboardNotificationsForFollowedTopics,Thredded::UserPreference,Thredded::UserMessageboardPreference,Thredded::NotificationsForPrivateTopics,Thredded::PostModerationRecord,Thredded::UserDetail"
ignored_translation="Mobility::Backends::ActiveRecord::Table::Translation,Subject::Translation,Program::Translation,Division::Translation"
ignored_commontator="Commontable,Votable,Subscriber,Creator"
other_ignored="ActionMailbox::Record,ActionText::Record,ActiveStorage::Record,Sluggable,FriendlyId::Slug,ApplicationRecord,InteractionsRecord"
exclude_default="${ignored_thredded},${ignored_translation},${ignored_commontator},${other_ignored}"

# 🌟 Overview with attributes (warnings will be printed only here)
docker compose exec -it mampf rake erd \
title=false filename=/usr/src/app/tmp/erd/mampf-erd-overview-with-attributes \
inheritance=false polymorphism=true indirect=false attributes=content \
exclude="${exclude_default}"

# 🌟 Generic Overview
docker compose exec -it mampf rake erd warn=false \
title=false filename=/usr/src/app/tmp/erd/mampf-erd-overview \
inheritance=false polymorphism=true indirect=false attributes=false \
exclude="${exclude_default}"

# 🌟 Vouchers
docker compose exec -it mampf rake erd warn=false \
title="Vouchers" filename=/usr/src/app/tmp/erd/mampf-erd-vouchers \
inheritance=true polymorphism=true indirect=true attributes=content \
exclude="${exclude_default},Teachable,Editable" \
only="User,Claim,Voucher,Redemption,Lecture,Tutorial,Talk"

# 🌟 Tutorials
docker compose exec -it mampf rake erd warn=false \
title="Tutorials" filename=/usr/src/app/tmp/erd/mampf-erd-tutorials \
inheritance=true polymorphism=true indirect=true attributes=content \
exclude="${exclude_default},Claimable,Editable,Teachable" \
only="User,Lecture,Tutorial,Submission,Assignment,TutorTutorialJoin,UserSubmissionJoin"

# 🌟 Courses
docker compose exec -it mampf rake erd warn=false \
title="Courses" filename=/usr/src/app/tmp/erd/mampf-erd-courses \
inheritance=true polymorphism=true indirect=true attributes=content \
exclude="${exclude_default},Claimable,Editable" \
only="Subject,Program,Division,DivisionCourseJoin,Course,Lecture,CourseSelfJoin,Lesson"

# 🌟 Lectures
docker compose exec -it mampf rake erd warn=false \
title="Lectures" filename=/usr/src/app/tmp/erd/mampf-erd-lectures \
inheritance=true polymorphism=true indirect=true attributes=content \
exclude="${exclude_default},Claimable,Editable,Teachable" \
only="Lecture,Lesson,Chapter,Section,Item,LessonSectionJoin,Term"

echo "📂 Diagrams are ready for you in the folder {{justfile_directory()}}/tmp/erd/"
echo "🔀 For the meanings of the arrows, refer to https://voormedia.github.io/rails-erd/gallery.html#notations"
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
/db/csv/*
/db/backups/*
!/backups/.gitkeep
Expand Down
11 changes: 8 additions & 3 deletions .justfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Documentation: https://just.systems/man/en/

# Prints this help message
[private]
help:
@just --list

# Test-related commands
# Commands to test the MaMpf codebase
mod test ".config/commands/test.justfile"
# see https://github.com/casey/just/issues/2216
# alias t := test

# Docker-related commands
# Commands to manage the docker containers
mod docker ".config/commands/docker.justfile"

# Commands to manage dependencies
mod deps ".config/commands/deps.justfile"

# Some utils, e.g. ERD-generation etc.
mod utils ".config/commands/utils.justfile"

# Opens the MaMpf wiki in the default browser
wiki:
#!/usr/bin/env bash
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-german",
"nefrob.vscode-just-syntax"
"nefrob.vscode-just-syntax",
"connorshea.vscode-ruby-test-adapter"
]
}
25 changes: 23 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,33 @@
//////////////////////////////////////
// Spell Checker
//////////////////////////////////////
"cSpell.enabled": true,
"cSpell.ignorePaths": [
"node_modules",
".git"
],
"cSpell.language": "en,de",
"cSpell.words": [
"activerecord",
"ajax",
"commontator",
"cospeaker",
"cospeakers",
"datetime",
"factorybot",
"helpdesk",
"katex",
"preselection",
"selectize",
"Timecop",
"turbolinks",
"Unsets"
]
"Unsets",
"uncached",
"whitespaces"
],
"cSpell.enableFiletypes": [
"ruby"
// Other filetypes are handled by the default spell checker
],
"cSpell.maxNumberOfProblems": 10000
}
42 changes: 8 additions & 34 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
# Contributing

To ensure a smooth experience for contributions, please first open an issue about the change you wish to make or contact
an active developer in some other way before making a change.
We are a small dev team centered around [Denis Vogel](https://www.mathi.uni-heidelberg.de/~vogel/), the creator of MaMpf. He started the project on June 4, 2017 out of frustration with the existing tools and their shortcomings when it comes to teaching mathematics and uploading recorded lectures to the web. He has since been the main developer and maintainer of the project and added tons of functionality throughout the years. MaMpf is now used every day by the mathematics department at Heidelberg University to host their lectures. It is constantly being improved and extended.

## Braches
We have the following branches:
- *production*
- *main*
- *mampf-next*
- feature-branches (names vary)
- *experimental*
Denis Vogel was joined by many students along the way working on the project in the role of a payed HiWis (German abbreviation for "Hilsfwissenschaftler", research assistants) at Heidelberg University. They have contributed to the project in various ways, such as implementing new features, fixing bugs, testing the software and improving the documentation.

### *production*
contains the actual version deployed on [mampf](mampf.mathi.uni-heidelberg.de).
The idea of MaMpf is to provide free material online to the whole world. In that spirit, the source code for MaMpf is open-source and licensed under the very permissive MIT license, so your university can host their own instance of MaMpf if they want to.

### *main*
is usually equal to *production*. Hotfixes are tested here before being merged to *production*.
---

### *mampf-next*
is the next intended version for mampf. This version is automatically deployed on
[mampf-dev](mampf-dev.mathi.uni-heidelberg.de). Features should be developed in feature branches and merged here.
**While we welcome contributions from everyone, please keep in mind that we are a very small team and currently cannot provide extensive mentoring or guidance to new external contributors.** If you are a HiWi at Heidelberg University, that's of course a different story, but unfortunately, right now we don't have too much time to onboard new developers form the outside. Knowledge transfer is often easier in persona than having to write down everything online. We have done such efforts in our [Wiki](https://github.com/MaMpf-HD/mampf/wiki) and continue to improve it as living document but don't expect it to be fully self-contained.
Also note that due to MaMpf being very specific to our needs at Heidelberg University, we might reject contributions that are not in line with our vision for the project or too general (or too specific to another university) to be useful for us. Therefore, **please open an issue before starting to work on a pull request to discuss your idea with us**.

### feature branches
Collaborators may create a branch for each improvement they would like to integrate in *mampf-next*. If you do not have
collaborator access yet, feel free to instead fork this repository and open a pull request targeted on the *mampf-next*
branch.

### *experimental*
is used as a playground and for test deployments. Do **not** put important work here. This branch is intended to be
force-pushed by any collaborator. If you ever want to deploy a version in a production-like environment, feel free to
do

> git checkout experimental
>
> git reset --hard <version>
>
> git push -f

If you are not a collaborator, feel free to open a pull-request on experimental with a note, that you are aware of this
policy and would just like to try out a change.
> [!tip]
> Check out our [**Wiki**](https://github.com/MaMpf-HD/mampf/wiki) if you are a new MaMpf developer and want to get started with setting up your own local Docker instance and get to know our development workflow and the code structure.
Loading
Loading