Skip to content

Commit f2abb2d

Browse files
author
Benedikt Artelt
committed
Merge commit '6e3641bc5025daee0fbd5e7cf4441d6ed82c3c3a' into codeocean-tuil
2 parents 4e5b916 + 6e3641b commit f2abb2d

File tree

272 files changed

+5134
-3108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+5134
-3108
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
2+
ARG RUBY_VERSION=3.3.5
3+
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION

.devcontainer/compose.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "codeocean"
2+
3+
services:
4+
rails-app:
5+
build:
6+
context: ..
7+
dockerfile: .devcontainer/Dockerfile
8+
9+
volumes:
10+
- ../..:/workspaces:cached
11+
12+
# Overrides default command so things don't shut down after the process ends.
13+
command: sleep infinity
14+
15+
# Uncomment the next line to use a non-root user for all processes.
16+
# user: vscode
17+
18+
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
19+
# (Adding the "ports" property to this file will not forward from a Codespace.)
20+
depends_on:
21+
- selenium
22+
- postgres
23+
24+
selenium:
25+
image: selenium/standalone-chromium
26+
restart: unless-stopped
27+
28+
postgres:
29+
image: postgres:17
30+
restart: unless-stopped
31+
networks:
32+
- default
33+
volumes:
34+
- postgres-data:/var/lib/postgresql/data
35+
environment:
36+
POSTGRES_USER: postgres
37+
POSTGRES_PASSWORD: postgres
38+
39+
volumes:
40+
postgres-data:

.devcontainer/devcontainer.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3+
{
4+
"name": "CodeOcean",
5+
"dockerComposeFile": "compose.yaml",
6+
"service": "rails-app",
7+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
"features": {
11+
"ghcr.io/devcontainers/features/git-lfs:1": {},
12+
"ghcr.io/devcontainers/features/github-cli:1": {},
13+
"ghcr.io/rails/devcontainer/features/activestorage": {},
14+
"ghcr.io/devcontainers/features/node:1": {
15+
"installYarnUsingApt": false
16+
},
17+
"ghcr.io/rails/devcontainer/features/postgres-client": {}
18+
},
19+
20+
"containerEnv": {
21+
"COREPACK_ENABLE_DOWNLOAD_PROMPT": "0",
22+
"CAPYBARA_SERVER_PORT": "45678",
23+
"SELENIUM_HOST": "selenium",
24+
"DB_HOST": "postgres"
25+
},
26+
27+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
28+
"forwardPorts": [3035, 7000],
29+
30+
"portsAttributes": {
31+
"3035": {
32+
"label": "webpack-dev-server"
33+
},
34+
"7000": {
35+
"label": "rails-server"
36+
}
37+
},
38+
39+
// Configure tool-specific properties.
40+
// "customizations": {},
41+
42+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
43+
// "remoteUser": "root",
44+
45+
46+
// Use 'postCreateCommand' to run commands after the container is created.
47+
"postCreateCommand": "bin/setup"
48+
}

.dockerignore

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2+
3+
# Ignore git directory.
4+
/.git/
5+
/.gitignore
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore all environment files (except templates).
11+
/.env*
12+
!/.env*.erb
13+
14+
# Ignore all default key files.
15+
/config/master.key
16+
/config/credentials/*.key
17+
18+
# Ignore all logfiles and tempfiles.
19+
/log/*
20+
/tmp/*
21+
!/log/.keep
22+
!/tmp/.keep
23+
24+
# Ignore pidfiles, but keep the directory.
25+
/tmp/pids/*
26+
!/tmp/pids/.keep
27+
28+
# Ignore storage (uploaded files in development and any SQLite databases).
29+
/storage/*
30+
!/storage/.keep
31+
/tmp/storage/*
32+
!/tmp/storage/.keep
33+
/public/uploads
34+
35+
# Ignore assets.
36+
/node_modules/
37+
/app/assets/builds/*
38+
!/app/assets/builds/.keep
39+
/public/packs
40+
/public/packs-test
41+
/public/assets
42+
43+
# Ignore CI service files.
44+
/.github
45+
46+
# Ignore development files
47+
/.devcontainer
48+
49+
# Ignore Docker-related files
50+
/.dockerignore
51+
/Dockerfile*
52+
53+
# Ignore temporary files
54+
/coverage
55+
/rubocop.html
56+
*.DS_Store
57+
58+
## Ignore editor-specific artifacts
59+
# Vagrant
60+
/.vagrant
61+
/vagrant
62+
# Sublime
63+
*.sublime-*
64+
# IntelliJ
65+
/.idea
66+
*.iml
67+
68+
# Ignore Byebug command history file.
69+
.byebug_history
70+
71+
# Ignore yarn files
72+
/yarn-error.log
73+
yarn-debug.log*
74+
.yarn-integrity
75+
# Ignore more Yarn files per documentation:
76+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
77+
.pnp.*
78+
.yarn/*
79+
!.yarn/patches
80+
!.yarn/plugins
81+
!.yarn/releases
82+
!.yarn/sdks
83+
!.yarn/versions

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
2+
3+
# Mark the database schema as having been generated.
4+
db/*schema.rb linguist-generated
5+
6+
# Mark any vendored files as having been vendored.
7+
vendor/* linguist-vendored
8+
config/credentials/*.yml.enc diff=rails_credentials
9+
config/credentials.yml.enc diff=rails_credentials

.github/dependabot.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ updates:
1010
labels:
1111
- dependencies
1212
- ruby
13-
ignore:
14-
- dependency-name: rubocop*
1513

1614
- package-ecosystem: npm
1715
directory: "/"
@@ -32,3 +30,23 @@ updates:
3230
labels:
3331
- dependencies
3432
- github-actions
33+
34+
- package-ecosystem: docker
35+
directory: "/"
36+
schedule:
37+
interval: daily
38+
time: "03:00"
39+
timezone: UTC
40+
labels:
41+
- dependencies
42+
- docker
43+
44+
- package-ecosystem: devcontainers
45+
directory: "/"
46+
schedule:
47+
interval: daily
48+
time: "03:00"
49+
timezone: UTC
50+
labels:
51+
- dependencies
52+
- devcontainers

.github/workflows/ci.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ jobs:
1919
--health-retries 5
2020
2121
steps:
22+
- name: Install packages
23+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips postgresql-client
24+
2225
- name: Checkout code
2326
uses: actions/checkout@v4
2427

2528
- name: Setup Ruby
2629
uses: ruby/setup-ruby@v1
2730
with:
28-
ruby-version: 3.3
31+
ruby-version: .ruby-version
2932
bundler-cache: true
3033

3134
- name: Setup Node
@@ -59,15 +62,14 @@ jobs:
5962
cp config/action_mailer.yml.ci config/action_mailer.yml
6063
cp config/code_ocean.yml.ci config/code_ocean.yml
6164
cp config/database.yml.ci config/database.yml
62-
cp config/secrets.yml.ci config/secrets.yml
6365
cp config/docker.yml.erb.ci config/docker.yml.erb
6466
cp config/mnemosyne.yml.ci config/mnemosyne.yml
6567
cp config/content_security_policy.yml.ci config/content_security_policy.yml
6668
67-
- name: Create database
69+
- name: Prepare database
6870
env:
6971
RAILS_ENV: test
70-
run: bundler exec rake db:schema:load
72+
run: bundler exec rake db:prepare
7173
- name: Precompile assets
7274
env:
7375
RAILS_ENV: test
@@ -84,6 +86,14 @@ jobs:
8486
with:
8587
token: ${{ secrets.CODECOV_TOKEN }}
8688

89+
- name: Keep screenshots from failed system specs
90+
uses: actions/upload-artifact@v4
91+
if: failure()
92+
with:
93+
name: screenshots
94+
path: ${{ github.workspace }}/tmp/screenshots
95+
if-no-files-found: ignore
96+
8797
lint:
8898
runs-on: ubuntu-latest
8999

@@ -94,7 +104,7 @@ jobs:
94104
- name: Setup Ruby
95105
uses: ruby/setup-ruby@v1
96106
with:
97-
ruby-version: 3.3
107+
ruby-version: .ruby-version
98108
bundler-cache: true
99109

100110
- name: Run rubocop
@@ -125,17 +135,39 @@ jobs:
125135
- name: Setup Ruby
126136
uses: ruby/setup-ruby@v1
127137
with:
128-
ruby-version: 3.3
138+
ruby-version: .ruby-version
129139
bundler-cache: true
130140

131141
- name: Run slim-lint
132142
run: bundle exec slim-lint app/views --reporter checkstyle > checkstyle-result.xml
133143

134144
- name: Upload slim-lint results as GitHub annotations
135-
uses: lcollins/checkstyle-github-action@v3.0.0
145+
uses: lcollins/checkstyle-github-action@v3.1.0
136146
# Only create GitHub annotations for the main repo (disable for forks):
137-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
147+
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository }}
138148
with:
139149
name: Slim-Lint Report
140150
title: Analyze Slim templates for linting issues
141151
path: checkstyle-result.xml
152+
153+
scan_ruby:
154+
runs-on: ubuntu-latest
155+
156+
steps:
157+
- name: Checkout code
158+
uses: actions/checkout@v4
159+
160+
- name: Set up Ruby
161+
uses: ruby/setup-ruby@v1
162+
with:
163+
ruby-version: .ruby-version
164+
bundler-cache: true
165+
166+
- name: Scan for common Rails security vulnerabilities using static analysis
167+
uses: reviewdog/action-brakeman@v2
168+
with:
169+
filter_mode: nofilter
170+
reporter: github-check
171+
skip_install: true
172+
use_bundler: true
173+
fail_on_error: true
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Create a Sentry release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
create-release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Create Sentry release
13+
uses: getsentry/action-release@v1
14+
with:
15+
projects: ${{ secrets.SENTRY_PROJECT }}
16+
env:
17+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
18+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}

0 commit comments

Comments
 (0)