From e0b61c0a840a565ace3bb9281b55c988c5f9dd1b Mon Sep 17 00:00:00 2001
From: Matteo Bronkhorst <32799956+DrumsnChocolate@users.noreply.github.com>
Date: Thu, 9 Jan 2025 15:23:03 +0100
Subject: [PATCH 01/13] add default seed for sofia application (#478)
---
db/seeds/application.rb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/db/seeds/application.rb b/db/seeds/application.rb
index 1afa8953..92f24f2d 100644
--- a/db/seeds/application.rb
+++ b/db/seeds/application.rb
@@ -6,3 +6,12 @@
scopes: 'public',
confidential: false
)
+
+FactoryBot.create(
+ :application,
+ name: 'SOFIA - Streepsysteem der C.S.V. Alpha',
+ uid: '987654321',
+ redirect_uri: 'http://localhost:5000/users/auth/amber_oauth2/callback',
+ scopes: 'public sofia',
+ confidential: false
+)
From 4066ff52e28cfb2de2b9e1ba61bb8e8427ed3e5c Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 9 Jan 2025 15:23:35 +0100
Subject: [PATCH 02/13] chore(deps): update dependency rhysd/actionlint to
v1.7.6 (#409)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/continuous-integration.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 7d18e0a6..2e2ed6bd 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -68,7 +68,7 @@ jobs:
- name: Download actionlint
run: |
- bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.26
+ bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.6
- name: Load test image
uses: guidojw/actions/load-docker-image@ec8c080252c6b8903a4431211b78c543609f5f89 # v1.4.6
From 6ee4b7eb4025933dcd2ae68d7532184a3caa8024 Mon Sep 17 00:00:00 2001
From: Matteo Bronkhorst <32799956+DrumsnChocolate@users.noreply.github.com>
Date: Thu, 9 Jan 2025 21:44:59 +0100
Subject: [PATCH 03/13] Camofy html image sources (#467)
* write a regex for html images. might not be perfect
* linter was annoying
* I'm not used to how ruby deals with returns
* running the linter is a pain
* rename variable
* improve regex to be more acommodating to general whitespace
---
app/helpers/markdown_helper.rb | 34 ++++++++++++++++++++++---
spec/helpers/markdown_helper_spec.rb | 37 ++++++++++++++++++++++++++++
2 files changed, 68 insertions(+), 3 deletions(-)
diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb
index bd20938b..8adbbac9 100644
--- a/app/helpers/markdown_helper.rb
+++ b/app/helpers/markdown_helper.rb
@@ -1,16 +1,44 @@
module MarkdownHelper
include CamoHelper
- def camofy(markdown)
- return unless markdown
+ def camofy(text)
+ return unless text
- markdown.gsub(markdown_img_regex) do
+ text = sub_markdown(text)
+ sub_html(text)
+ end
+
+ def sub_markdown(text)
+ text.gsub(markdown_img_regex) do
"![#{Regexp.last_match(1)}](#{camo(Regexp.last_match(2))}#{Regexp.last_match(3)})"
end
end
+ def sub_html(text)
+ text.gsub(html_img_regex) do
+ preceding_src = Regexp.last_match(1)
+ quote_mark = Regexp.last_match(2)
+ url = Regexp.last_match(3)
+ ending = Regexp.last_match(4)
+ " or />
+ # note that we don't allow mismatched quotes like 'url" or shenanigans like that
+ # This regex contains two particularly useful features:
+ # capturing groups, and lazy matching.
+ %r{]*\s)src=(["']?)(.+?)\2(\s|>|/)}
+ end
end
diff --git a/spec/helpers/markdown_helper_spec.rb b/spec/helpers/markdown_helper_spec.rb
index 2ecaa637..aeb958b7 100644
--- a/spec/helpers/markdown_helper_spec.rb
+++ b/spec/helpers/markdown_helper_spec.rb
@@ -29,6 +29,43 @@
'![](https://example.org/c7125941763fc18c9d8977ed19028ca5f9378070/687474703a2f2f6578616d706c652e6f72672f696d6167652e6a7067 =100x* "Image title")'
)
end
+
+ it do
+ expect(camofy('')).to eq(
+ ''
+ )
+ end
+
+ it do
+ expect(camofy("")).to eq(
+ ""
+ )
+ end
+
+ it do
+ expect(camofy('')).to eq(
+ ''
+ )
+ end
+
+ it do
+ expect(camofy('')).to eq(
+ ''
+ )
+ end
+
+ it do
+ expect(camofy('')).to eq(
+ ''
+ )
+ end
+
+ it do
+ expect(camofy('')).to eq(
+ ''
+ )
+ end
+
# rubocop:enable Layout/LineLength
end
end
From bddcd8eb24f204f03106f9ecad432c169ca95c4f Mon Sep 17 00:00:00 2001
From: lodewiges <131907615+lodewiges@users.noreply.github.com>
Date: Tue, 14 Jan 2025 13:23:29 +0100
Subject: [PATCH 04/13] Fix for automatic mails being broken (#481)
* intial commit
* edited .env file
---
.env.example | 5 +++++
config/application.rb | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/.env.example b/.env.example
index 30290fe4..085673e9 100644
--- a/.env.example
+++ b/.env.example
@@ -11,3 +11,8 @@ POSTGRES_PASSWORD=
HOST=csvalpha.nl
NGROK_HOST=.ngrok.io
+
+NOREPLY_EMAIL=no-reply@development.csvalpha.nl
+ICT_EMAIL=ict@development.csvalpha.nl
+PRIVACY_EMAIL=privacy@development.csvalpha.nl
+MAILADMIN_EMAIL=mailbeheer@development.csvalpha.nl
diff --git a/config/application.rb b/config/application.rb
index 7158b5ae..60de7231 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -82,9 +82,9 @@ class Application < Rails::Application
config.x.healthcheck_ids = credentials.dig(Rails.env.to_sym, :healthcheck_ids)
- config.x.noreply_email = ENV.fetch('NOREPLY_EMAIL', 'no-reply@csvalpha.com')
- config.x.ict_email = ENV.fetch('ICT_EMAIL', 'ict@csvalpha.com')
- config.x.privacy_email = ENV.fetch('PRIVACY_EMAIL', 'privacy@csvalpha.com')
- config.x.mailbeheer_email = ENV.fetch('PRIVACY_EMAIL', 'mailbeheer@csvalpha.com')
+ config.x.noreply_email = ENV.fetch('NOREPLY_EMAIL', 'no-reply@csvalpha.nl')
+ config.x.ict_email = ENV.fetch('ICT_EMAIL', 'ict@csvalpha.nl')
+ config.x.privacy_email = ENV.fetch('PRIVACY_EMAIL', 'privacy@csvalpha.nl')
+ config.x.mailbeheer_email = ENV.fetch('MAILADMIN_EMAIL', 'mailbeheer@csvalpha.nl')
end
end
From cb3fc15592e53e2ad335bca5bc61e8fb7c15a469 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 19 Jan 2025 14:47:57 +0100
Subject: [PATCH 05/13] chore(deps): update dependency rhysd/actionlint to
v1.7.7 (#482)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/continuous-integration.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 2e2ed6bd..d5c907c1 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -68,7 +68,7 @@ jobs:
- name: Download actionlint
run: |
- bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.6
+ bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.7
- name: Load test image
uses: guidojw/actions/load-docker-image@ec8c080252c6b8903a4431211b78c543609f5f89 # v1.4.6
From ea5ca5994a054e68c737017f04572b24b4abe0ca Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 19 Jan 2025 16:25:22 +0100
Subject: [PATCH 06/13] chore(deps): update dependency sidekiq to v7 (#445)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
Gemfile | 2 +-
Gemfile.lock | 16 ++++++++++------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/Gemfile b/Gemfile
index 3d9c3724..45bbd95b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -40,7 +40,7 @@ gem 'ruby-filemagic', '~> 0.7', '>= 0.7.3'
gem 'rubyzip', '~> 2.3', '>= 2.3.2'
gem 'sentry-raven', '~> 3.1', '>= 3.1.2'
gem 'sepa_king', '~> 0.14'
-gem 'sidekiq', '~> 6.5', '>= 6.5.12'
+gem 'sidekiq', '~> 7.3', '>= 7.3.7'
gem 'sidekiq-scheduler', '~> 5.0', '>= 5.0.6'
gem 'slack-notifier', '~> 2.4'
gem 'validates_timeliness', '~> 7.0.0.beta2'
diff --git a/Gemfile.lock b/Gemfile.lock
index 30cd6549..c508d849 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -129,7 +129,7 @@ GEM
coderay (1.1.3)
colorize (0.8.1)
concurrent-ruby (1.3.4)
- connection_pool (2.3.0)
+ connection_pool (2.4.1)
consistency_fail (0.3.7)
counter_culture (3.8.2)
activerecord (>= 4.2)
@@ -245,6 +245,7 @@ GEM
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
+ logger (1.6.3)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
@@ -370,6 +371,8 @@ GEM
ffi (~> 1.0)
rb-readline (0.5.5)
redis (4.8.1)
+ redis-client (0.23.0)
+ connection_pool
regexp_parser (2.2.1)
request_store (1.5.1)
rack (>= 1.4)
@@ -458,10 +461,11 @@ GEM
iban-tools
nokogiri
shellany (0.0.1)
- sidekiq (6.5.12)
- connection_pool (>= 2.2.5, < 3)
- rack (~> 2.0)
- redis (>= 4.5.0, < 5)
+ sidekiq (7.3.7)
+ connection_pool (>= 2.3.0)
+ logger
+ rack (>= 2.2.4)
+ redis-client (>= 0.22.2)
sidekiq-scheduler (5.0.6)
rufus-scheduler (~> 3.2)
sidekiq (>= 6, < 8)
@@ -592,7 +596,7 @@ DEPENDENCIES
rubyzip (~> 2.3, >= 2.3.2)
sentry-raven (~> 3.1, >= 3.1.2)
sepa_king (~> 0.14)
- sidekiq (~> 6.5, >= 6.5.12)
+ sidekiq (~> 7.3, >= 7.3.7)
sidekiq-scheduler (~> 5.0, >= 5.0.6)
simplecov
simplecov-lcov (~> 0.8.0)
From cbc8e0a61373ba908fa41c448d32754433342cc7 Mon Sep 17 00:00:00 2001
From: lodewiges <131907615+lodewiges@users.noreply.github.com>
Date: Sun, 19 Jan 2025 19:21:51 +0100
Subject: [PATCH 07/13] Refractor banaan to meeting (#484)
---
app/models/study_room_presence.rb | 2 +-
spec/factories/study_room_presences.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/study_room_presence.rb b/app/models/study_room_presence.rb
index a6ae4ecc..0313fecb 100644
--- a/app/models/study_room_presence.rb
+++ b/app/models/study_room_presence.rb
@@ -4,7 +4,7 @@ class StudyRoomPresence < ApplicationRecord
validates :start_time, presence: true
validates :end_time, presence: true
validates_datetime :end_time, after: :start_time
- validates :status, inclusion: { in: %w[chilling studying banaan] }
+ validates :status, inclusion: { in: %w[chilling studying vergaderen] }
scope :current, (lambda {
where('start_time <= :current_time AND end_time >= :current_time',
diff --git a/spec/factories/study_room_presences.rb b/spec/factories/study_room_presences.rb
index 31bc0d4b..4db1fa7f 100644
--- a/spec/factories/study_room_presences.rb
+++ b/spec/factories/study_room_presences.rb
@@ -2,7 +2,7 @@
factory :study_room_presence do
start_time { Faker::Time.between(from: 3.days.ago, to: 5.days.ago) }
end_time { Faker::Time.between(from: 10.days.from_now, to: 5.days.from_now) }
- status { %w[chilling studying banaan].sample }
+ status { %w[chilling studying vergaderen].sample }
user
trait(:future) { start_time { Faker::Time.between(from: 1.day.from_now, to: 4.days.from_now) } }
From d73a1010904db085a2cf824177ff807e73bed3e0 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 19 Jan 2025 20:00:00 +0100
Subject: [PATCH 08/13] chore(deps): update all actions (#475)
* chore(deps): update all actions
* replace guidojw with louisbrunner check action
* Fixed lint
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorai Geertsema
---
.github/workflows/continuous-delivery.yml | 9 +++++----
.github/workflows/continuous-integration.yml | 14 +++++++-------
.github/workflows/publish-image.yml | 13 +++++++------
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml
index bd9f8856..d5f47ac7 100644
--- a/.github/workflows/continuous-delivery.yml
+++ b/.github/workflows/continuous-delivery.yml
@@ -127,6 +127,8 @@ jobs:
(github.ref_name == 'staging' || github.ref_name == 'master') && ((github.ref_name == 'master' &&
github.event.inputs.merge == 'y' && fromJSON(needs.metadata.outputs.has_diff) && success()) ||
((github.event.inputs.merge != 'y' || !fromJSON(needs.metadata.outputs.has_diff)) && !cancelled()))
+ permissions:
+ checks: write
steps:
- name: Get environment URL
id: get_url
@@ -165,7 +167,7 @@ jobs:
docker-compose up -d
- name: Finalize Sentry release
- uses: getsentry/action-release@e769183448303de84c5a06aaaddf9da7be26d6c7 # v1.7.0
+ uses: getsentry/action-release@f6dfa3d84a1c740b94aa45255c5e032b744a095d # v1.9.0
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ vars.SENTRY_ORG_NAME }}
@@ -205,11 +207,10 @@ jobs:
done
- name: Update Continuous Delivery check run
- uses: guidojw/actions/update-check-run@ec8c080252c6b8903a4431211b78c543609f5f89 # v1.4.6
+ uses: LouisBrunner/checks-action@6b626ffbad7cc56fd58627f774b9067e6118af23 # v2.0.0
with:
- app_id: ${{ vars.GH_APP_ID }}
- private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
sha: ${{ needs.merge.outputs.sha }}
+ token: ${{ github.token }}
name: Continuous Delivery
conclusion: ${{ steps.get_conclusion.outputs.conclusion }}
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index d5c907c1..1ffde851 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -31,7 +31,7 @@ jobs:
ref: ${{ inputs.sha }}
- name: Build test image
- uses: guidojw/actions/build-docker-image@ec8c080252c6b8903a4431211b78c543609f5f89 # v1.4.6
+ uses: guidojw/actions/build-docker-image@3ad963828827110a6b716a011f242bf01fdf1db4 # v1.4.7
with:
file: Dockerfile
build-args: |
@@ -71,7 +71,7 @@ jobs:
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.7
- name: Load test image
- uses: guidojw/actions/load-docker-image@ec8c080252c6b8903a4431211b78c543609f5f89 # v1.4.6
+ uses: guidojw/actions/load-docker-image@3ad963828827110a6b716a011f242bf01fdf1db4 # v1.4.7
with:
name: app
@@ -80,8 +80,8 @@ jobs:
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: |
EXIT_STATUS=0
- ./actionlint -ignore 'property "gh_app_private_key" is not defined' -ignore 'SC2153:' \
- -ignore 'property "sha" is not defined in object type {}' || EXIT_STATUS=$?
+ ./actionlint -ignore 'SC2153:' -ignore 'property "sha" is not defined in object type {}' || \
+ EXIT_STATUS=$?
docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \
RAILS_MASTER_KEY --network=host app bin/ci.sh lint || EXIT_STATUS=$?
exit $EXIT_STATUS
@@ -114,7 +114,7 @@ jobs:
echo '::add-matcher::.github/problem-matchers/rspec.json'
- name: Load test image
- uses: guidojw/actions/load-docker-image@ec8c080252c6b8903a4431211b78c543609f5f89 # v1.4.6
+ uses: guidojw/actions/load-docker-image@3ad963828827110a6b716a011f242bf01fdf1db4 # v1.4.7
with:
name: app
@@ -128,14 +128,14 @@ jobs:
- name: Upload coverage report to Codecov
if: ${{ !cancelled() }}
- uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
+ uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage report artifact
if: ${{ !cancelled() }}
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
+ uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: coverage
path: coverage/
diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml
index 11ac7bb1..6f53debc 100644
--- a/.github/workflows/publish-image.yml
+++ b/.github/workflows/publish-image.yml
@@ -54,7 +54,7 @@ jobs:
fetch-depth: 0
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
+ uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
@@ -64,7 +64,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
- uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
+ uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
with:
push: true
context: .
@@ -77,7 +77,7 @@ jobs:
- name: Create Sentry release
if: ${{ !(github.event_name == 'workflow_dispatch' && github.workflow == 'Publish Image') }}
- uses: getsentry/action-release@e769183448303de84c5a06aaaddf9da7be26d6c7 # v1.7.0
+ uses: getsentry/action-release@f6dfa3d84a1c740b94aa45255c5e032b744a095d # v1.9.0
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ vars.SENTRY_ORG_NAME }}
@@ -91,6 +91,8 @@ jobs:
runs-on: ubuntu-latest
needs: [metadata, publish]
if: github.event_name == 'workflow_dispatch' && github.workflow == 'Publish Image' && always()
+ permissions:
+ checks: write
steps:
- name: Get conclusion
id: get_conclusion
@@ -106,10 +108,9 @@ jobs:
done
- name: Update Publish Image check run
- uses: guidojw/actions/update-check-run@ec8c080252c6b8903a4431211b78c543609f5f89 # v1.4.6
+ uses: LouisBrunner/checks-action@6b626ffbad7cc56fd58627f774b9067e6118af23 # v2.0.0
with:
- app_id: ${{ vars.GH_APP_ID }}
- private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
+ token: ${{ github.token }}
name: Publish Image
conclusion: ${{ steps.get_conclusion.outputs.conclusion }}
details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
From 8e7034e67b0189c98182ea7b6af694e1f1f36cf5 Mon Sep 17 00:00:00 2001
From: Matteo Bronkhorst <32799956+DrumsnChocolate@users.noreply.github.com>
Date: Sun, 19 Jan 2025 21:23:06 +0100
Subject: [PATCH 09/13] allow fetching of articles that a group has published
(#377)
* allow fetching of articles that a group has published
* this was probably redundant
* undo schema changes?
* fix schema by resetting db and rerunning db:migrate
* fix tests by adding attribute
* Fixed lint
* Fixed lint v2.rb
---------
Co-authored-by: lodewiges <131907615+lodewiges@users.noreply.github.com>
---
app/models/group.rb | 1 +
app/resources/v1/group_resource.rb | 1 +
db/schema.rb | 1 -
spec/resources/v1/group_resource_spec.rb | 4 ++--
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/app/models/group.rb b/app/models/group.rb
index c442cf52..9296fc00 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -12,6 +12,7 @@ class Group < ApplicationRecord
has_many :groups_permissions, class_name: 'GroupsPermissions', dependent: :destroy
has_many :permissions, through: :groups_permissions
has_many :mail_aliases
+ has_many :articles
scope :active, (lambda {
joins(:memberships).merge(Membership.active).distinct
diff --git a/app/resources/v1/group_resource.rb b/app/resources/v1/group_resource.rb
index 119784e0..976e5fd6 100644
--- a/app/resources/v1/group_resource.rb
+++ b/app/resources/v1/group_resource.rb
@@ -18,6 +18,7 @@ def description_camofied
has_many :memberships
has_many :mail_aliases
has_many :permissions
+ has_many :articles
filter :active, apply: ->(records, _value, _options) { records.active }
filter :kind
diff --git a/db/schema.rb b/db/schema.rb
index 3c73c96e..e3514de9 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,7 +9,6 @@
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
-
ActiveRecord::Schema[7.0].define(version: 2024_11_13_091607) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
diff --git a/spec/resources/v1/group_resource_spec.rb b/spec/resources/v1/group_resource_spec.rb
index bd5f18d5..606e0f1b 100644
--- a/spec/resources/v1/group_resource_spec.rb
+++ b/spec/resources/v1/group_resource_spec.rb
@@ -7,8 +7,8 @@
describe '#fetchable_fields' do
let(:basic_fields) do
- %i[id name avatar_url avatar_thumb_url created_at updated_at mail_aliases memberships users
- permissions]
+ %i[id name articles avatar_url avatar_thumb_url created_at updated_at mail_aliases
+ memberships users permissions]
end
let(:authenticated_fields) do
%i[description description_camofied kind recognized_at_gma rejected_at_gma administrative]
From 8387882bc29700477221b0e9b52cc58b256dd184 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 19 Jan 2025 20:39:42 +0000
Subject: [PATCH 10/13] chore(deps): update all non-major bundler dependencies
(#474)
* chore(deps): update all non-major bundler dependencies
* fixed artifact
* Update Gemfile
* update gemfile.lock
* Revert "update gemfile.lock"
This reverts commit a272942e0e9d00f7a5061f52fd3e908add81bf96.
* update gemfile.lock
* set default settings to rails 7
* Fixed lint
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: lodewiges <131907615+lodewiges@users.noreply.github.com>
Co-authored-by: Jorai Geertsema
---
.rubocop.yml | 7 +-
Gemfile | 10 +--
Gemfile.lock | 146 +++++++++++++++++++++---------------------
app/models/user.rb | 4 +-
config/application.rb | 2 +-
5 files changed, 87 insertions(+), 82 deletions(-)
diff --git a/.rubocop.yml b/.rubocop.yml
index 5d4f292d..b1f2a4e0 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -4,7 +4,8 @@ require:
- rubocop-rails
AllCops:
- TargetRailsVersion: 5.1
+ TargetRailsVersion: 7.0
+ TargetRubyVersion: 3.1
Exclude:
- 'db/schema.rb'
- 'config/initializers/secret_token.rb'
@@ -124,9 +125,11 @@ Style/HashTransformValues:
Lint/RaiseException:
Enabled: true
-
Lint/StructNewOverride:
Enabled: true
Naming/InclusiveLanguage:
Enabled: false
+
+Rails/BulkChangeTable:
+ Enabled: false
diff --git a/Gemfile b/Gemfile
index 45bbd95b..31dc829d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,13 +5,13 @@ gem 'dav4rack', git: 'https://github.com/csvalpha/dav4rack.git', ref: '8541e53'
gem 'bcrypt', '~> 3.1', '>= 3.1.20'
gem 'bootsnap', '~> 1.18', '>= 1.18.4'
-gem 'carrierwave', '~> 2.1'
+gem 'carrierwave', '~> 2.2', '>= 2.2.6'
gem 'carrierwave-base64', '~> 2.11'
gem 'carrierwave-bombshelter', '~> 0.2', '>= 0.2.2'
gem 'case_transform', '~> 0.2'
gem 'counter_culture', '~> 3.8', '>= 3.8.2'
gem 'dav4rack_ext', '~> 1.0'
-gem 'doorkeeper', '~> 5.2'
+gem 'doorkeeper', '~> 5.8', '>= 5.8.1'
gem 'doorkeeper-i18n', '~> 5.2', '>= 5.2.7'
gem 'exifr', '~> 1.4'
gem 'friendly_id', '~> 5.5', '>= 5.5.1'
@@ -28,11 +28,11 @@ gem 'paper_trail', '~> 14.0'
gem 'paranoia', '~> 3.0'
gem 'pg', '~> 1.5', '>= 1.5.9'
gem 'phonelib'
-gem 'puma', '~> 6.0'
+gem 'puma', '~> 6.5'
gem 'pundit', '~> 2.4'
gem 'rack-attack', '~> 6.7'
gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors'
-gem 'rails', '~> 7.0', '>= 7.0.4.3'
+gem 'rails', '~> 7.0.0', '>= 7.0.8.7'
gem 'rails-i18n', '~> 7.0', '>= 7.0.10'
gem 'redis', '~> 4.8', '>= 4.8.1'
gem 'roo', '~> 2.10', '>= 2.10.1'
@@ -43,7 +43,7 @@ gem 'sepa_king', '~> 0.14'
gem 'sidekiq', '~> 7.3', '>= 7.3.7'
gem 'sidekiq-scheduler', '~> 5.0', '>= 5.0.6'
gem 'slack-notifier', '~> 2.4'
-gem 'validates_timeliness', '~> 7.0.0.beta2'
+gem 'validates_timeliness', '~> 7.0.0'
gem 'vpim', '~> 24.2', '>= 24.2.20'
group :development, :test do
diff --git a/Gemfile.lock b/Gemfile.lock
index c508d849..3c0f32b0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -22,67 +22,67 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actioncable (7.0.8.6)
- actionpack (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ actioncable (7.0.8.7)
+ actionpack (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailbox (7.0.8.6)
- actionpack (= 7.0.8.6)
- activejob (= 7.0.8.6)
- activerecord (= 7.0.8.6)
- activestorage (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ actionmailbox (7.0.8.7)
+ actionpack (= 7.0.8.7)
+ activejob (= 7.0.8.7)
+ activerecord (= 7.0.8.7)
+ activestorage (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
- actionmailer (7.0.8.6)
- actionpack (= 7.0.8.6)
- actionview (= 7.0.8.6)
- activejob (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ actionmailer (7.0.8.7)
+ actionpack (= 7.0.8.7)
+ actionview (= 7.0.8.7)
+ activejob (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
- actionpack (7.0.8.6)
- actionview (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ actionpack (7.0.8.7)
+ actionview (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
- actiontext (7.0.8.6)
- actionpack (= 7.0.8.6)
- activerecord (= 7.0.8.6)
- activestorage (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ actiontext (7.0.8.7)
+ actionpack (= 7.0.8.7)
+ activerecord (= 7.0.8.7)
+ activestorage (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
- actionview (7.0.8.6)
- activesupport (= 7.0.8.6)
+ actionview (7.0.8.7)
+ activesupport (= 7.0.8.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
- activejob (7.0.8.6)
- activesupport (= 7.0.8.6)
+ activejob (7.0.8.7)
+ activesupport (= 7.0.8.7)
globalid (>= 0.3.6)
- activemodel (7.0.8.6)
- activesupport (= 7.0.8.6)
- activerecord (7.0.8.6)
- activemodel (= 7.0.8.6)
- activesupport (= 7.0.8.6)
- activestorage (7.0.8.6)
- actionpack (= 7.0.8.6)
- activejob (= 7.0.8.6)
- activerecord (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ activemodel (7.0.8.7)
+ activesupport (= 7.0.8.7)
+ activerecord (7.0.8.7)
+ activemodel (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
+ activestorage (7.0.8.7)
+ actionpack (= 7.0.8.7)
+ activejob (= 7.0.8.7)
+ activerecord (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
- activesupport (7.0.8.6)
+ activesupport (7.0.8.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -137,8 +137,8 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
- date (3.3.4)
- date (3.3.4-java)
+ date (3.4.1)
+ date (3.4.1-java)
dav4rack_ext (1.0.0)
dav4rack
http_router
@@ -148,7 +148,7 @@ GEM
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
- doorkeeper (5.8.0)
+ doorkeeper (5.8.1)
railties (>= 5)
doorkeeper-i18n (5.2.7)
doorkeeper (>= 5.2)
@@ -188,8 +188,8 @@ GEM
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
- globalid (1.1.0)
- activesupport (>= 5.0)
+ globalid (1.2.1)
+ activesupport (>= 6.1)
guard (2.18.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
@@ -272,14 +272,14 @@ GEM
msgpack (1.7.5)
msgpack (1.7.5-java)
nenv (0.3.0)
- net-imap (0.3.7)
+ net-imap (0.5.5)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
- net-smtp (0.3.4)
+ net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
nio4r (2.7.4)
@@ -315,9 +315,9 @@ GEM
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.7)
- puma (6.4.3)
+ puma (6.5.0)
nio4r (~> 2.0)
- puma (6.4.3-java)
+ puma (6.5.0-java)
nio4r (~> 2.0)
pundit (2.4.0)
activesupport (>= 3.0.0)
@@ -333,20 +333,20 @@ GEM
rack (>= 1.2.0)
rack-test (2.1.0)
rack (>= 1.3)
- rails (7.0.8.6)
- actioncable (= 7.0.8.6)
- actionmailbox (= 7.0.8.6)
- actionmailer (= 7.0.8.6)
- actionpack (= 7.0.8.6)
- actiontext (= 7.0.8.6)
- actionview (= 7.0.8.6)
- activejob (= 7.0.8.6)
- activemodel (= 7.0.8.6)
- activerecord (= 7.0.8.6)
- activestorage (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ rails (7.0.8.7)
+ actioncable (= 7.0.8.7)
+ actionmailbox (= 7.0.8.7)
+ actionmailer (= 7.0.8.7)
+ actionpack (= 7.0.8.7)
+ actiontext (= 7.0.8.7)
+ actionview (= 7.0.8.7)
+ activejob (= 7.0.8.7)
+ activemodel (= 7.0.8.7)
+ activerecord (= 7.0.8.7)
+ activestorage (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
bundler (>= 1.15.0)
- railties (= 7.0.8.6)
+ railties (= 7.0.8.7)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
@@ -357,9 +357,9 @@ GEM
rails-i18n (7.0.10)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
- railties (7.0.8.6)
- actionpack (= 7.0.8.6)
- activesupport (= 7.0.8.6)
+ railties (7.0.8.7)
+ actionpack (= 7.0.8.7)
+ activesupport (= 7.0.8.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
@@ -491,8 +491,8 @@ GEM
thor (1.3.2)
tilt (2.4.0)
timecop (0.9.5)
- timeliness (0.4.5)
- timeout (0.3.2)
+ timeliness (0.5.1)
+ timeout (0.4.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2022.1)
@@ -508,7 +508,7 @@ GEM
url_mount (0.2.1)
rack
uuidtools (2.2.0)
- validates_timeliness (7.0.0.beta2)
+ validates_timeliness (7.0.0)
activemodel (>= 7.0.0, < 8)
timeliness (>= 0.3.10, < 1)
vcard_parser (0.0.9)
@@ -519,9 +519,11 @@ GEM
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
- websocket-driver (0.7.6)
+ websocket-driver (0.7.7)
+ base64
websocket-extensions (>= 0.1.0)
- websocket-driver (0.7.6-java)
+ websocket-driver (0.7.7-java)
+ base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.18)
@@ -542,7 +544,7 @@ DEPENDENCIES
bootsnap (~> 1.18, >= 1.18.4)
brakeman
bullet
- carrierwave (~> 2.1)
+ carrierwave (~> 2.2, >= 2.2.6)
carrierwave-base64 (~> 2.11)
carrierwave-bombshelter (~> 0.2, >= 0.2.2)
case_transform (~> 0.2)
@@ -551,7 +553,7 @@ DEPENDENCIES
counter_culture (~> 3.8, >= 3.8.2)
dav4rack!
dav4rack_ext (~> 1.0)
- doorkeeper (~> 5.2)
+ doorkeeper (~> 5.8, >= 5.8.1)
doorkeeper-i18n (~> 5.2, >= 5.2.7)
dotenv-rails
exifr (~> 1.4)
@@ -577,12 +579,12 @@ DEPENDENCIES
phonelib
pry-byebug
pry-rails
- puma (~> 6.0)
+ puma (~> 6.5)
pundit (~> 2.4)
rack-attack (~> 6.7)
rack-cors (~> 2.0, >= 2.0.2)
rack-mini-profiler
- rails (~> 7.0, >= 7.0.4.3)
+ rails (~> 7.0.0, >= 7.0.8.7)
rails-i18n (~> 7.0, >= 7.0.10)
rb-readline
redis (~> 4.8, >= 4.8.1)
@@ -607,7 +609,7 @@ DEPENDENCIES
terminal-notifier-guard
timecop
tzinfo-data
- validates_timeliness (~> 7.0.0.beta2)
+ validates_timeliness (~> 7.0.0)
vcr
vpim (~> 24.2, >= 24.2.20)
webmock
diff --git a/app/models/user.rb b/app/models/user.rb
index d5029281..ac38cfc1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -103,7 +103,7 @@ class User < ApplicationRecord # rubocop:disable Metrics/ClassLength
})
def full_name
- [first_name, last_name_prefix, last_name].reject(&:blank?).join(' ')
+ [first_name, last_name_prefix, last_name].compact_blank.join(' ')
end
alias to_s full_name
@@ -114,7 +114,7 @@ def username=(value)
def generate_username
value = [first_name, '.', last_name_prefix, last_name]
- .reject(&:blank?).join.gsub(/\s|-/, '')
+ .compact_blank.join.gsub(/\s|-/, '')
.parameterize.tr('-', '.')
usernames_like = User.where('username LIKE ?', "#{value}%")
value = "#{value}#{usernames_like.size}" if usernames_like.any?
diff --git a/config/application.rb b/config/application.rb
index 60de7231..7e03261f 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -21,7 +21,7 @@
module Amber
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 6.0
+ config.load_defaults 7.0
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
From 3ae5992a365c151234bc36ba64de9eea70a07671 Mon Sep 17 00:00:00 2001
From: lodewiges <131907615+lodewiges@users.noreply.github.com>
Date: Sun, 19 Jan 2025 22:20:50 +0100
Subject: [PATCH 11/13] Made a mistake that broke CD
---
.github/workflows/continuous-delivery.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml
index d5f47ac7..0579b40d 100644
--- a/.github/workflows/continuous-delivery.yml
+++ b/.github/workflows/continuous-delivery.yml
@@ -127,8 +127,6 @@ jobs:
(github.ref_name == 'staging' || github.ref_name == 'master') && ((github.ref_name == 'master' &&
github.event.inputs.merge == 'y' && fromJSON(needs.metadata.outputs.has_diff) && success()) ||
((github.event.inputs.merge != 'y' || !fromJSON(needs.metadata.outputs.has_diff)) && !cancelled()))
- permissions:
- checks: write
steps:
- name: Get environment URL
id: get_url
@@ -192,6 +190,8 @@ jobs:
runs-on: ubuntu-latest
needs: [branch_check, metadata, merge, continuous_integration, publish_image, deploy]
if: (github.ref_name == 'staging' || github.ref_name == 'master') && always()
+ permissions:
+ checks: write
steps:
- name: Get conclusion
id: get_conclusion
From fbe3b224dfbca5ea3da949bc1ea46f6479e18ffd Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 20 Jan 2025 21:37:01 +0000
Subject: [PATCH 12/13] chore(deps): update all non-major bundler dependencies
---
Gemfile | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Gemfile b/Gemfile
index 31dc829d..8baca2b6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -13,7 +13,7 @@ gem 'counter_culture', '~> 3.8', '>= 3.8.2'
gem 'dav4rack_ext', '~> 1.0'
gem 'doorkeeper', '~> 5.8', '>= 5.8.1'
gem 'doorkeeper-i18n', '~> 5.2', '>= 5.2.7'
-gem 'exifr', '~> 1.4'
+gem 'exifr', '~> 1.4', '>= 1.4.1'
gem 'friendly_id', '~> 5.5', '>= 5.5.1'
gem 'http', '~> 5.2'
gem 'iban-tools', '~> 1.2.1'
@@ -21,29 +21,29 @@ gem 'icalendar', '~> 2.10', '>= 2.10.3'
gem 'improvmx', '~> 0.2.1'
gem 'isbn_validation', '~> 1.2', '>= 1.2.2'
gem 'jsonapi-authorization', '~> 3.0', '>= 3.0.2'
-gem 'jsonapi-resources', '~> 0.9.1'
+gem 'jsonapi-resources', '~> 0.10.7'
gem 'message_bus', '~> 4.3', '>= 4.3.8'
gem 'mini_magick', '~> 4.13', '>= 4.13.2'
gem 'paper_trail', '~> 14.0'
-gem 'paranoia', '~> 3.0'
+gem 'paranoia', '~> 3.0', '>= 3.0.1'
gem 'pg', '~> 1.5', '>= 1.5.9'
gem 'phonelib'
gem 'puma', '~> 6.5'
gem 'pundit', '~> 2.4'
gem 'rack-attack', '~> 6.7'
gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors'
-gem 'rails', '~> 7.0.0', '>= 7.0.8.7'
+gem 'rails', '~> 7.2.2', '>= 7.2.2.1'
gem 'rails-i18n', '~> 7.0', '>= 7.0.10'
gem 'redis', '~> 4.8', '>= 4.8.1'
gem 'roo', '~> 2.10', '>= 2.10.1'
gem 'ruby-filemagic', '~> 0.7', '>= 0.7.3'
-gem 'rubyzip', '~> 2.3', '>= 2.3.2'
+gem 'rubyzip', '~> 2.4', '>= 2.4.1'
gem 'sentry-raven', '~> 3.1', '>= 3.1.2'
gem 'sepa_king', '~> 0.14'
-gem 'sidekiq', '~> 7.3', '>= 7.3.7'
+gem 'sidekiq', '~> 7.3', '>= 7.3.8'
gem 'sidekiq-scheduler', '~> 5.0', '>= 5.0.6'
gem 'slack-notifier', '~> 2.4'
-gem 'validates_timeliness', '~> 7.0.0'
+gem 'validates_timeliness', '~> 7.1.0'
gem 'vpim', '~> 24.2', '>= 24.2.20'
group :development, :test do
From 22762d7e4bc2fcec29f260f99f964a093417753f Mon Sep 17 00:00:00 2001
From: lodewiges <131907615+lodewiges@users.noreply.github.com>
Date: Tue, 21 Jan 2025 16:27:19 +0100
Subject: [PATCH 13/13] Update Gemfile
---
Gemfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Gemfile b/Gemfile
index 8baca2b6..e768dc9b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -21,7 +21,7 @@ gem 'icalendar', '~> 2.10', '>= 2.10.3'
gem 'improvmx', '~> 0.2.1'
gem 'isbn_validation', '~> 1.2', '>= 1.2.2'
gem 'jsonapi-authorization', '~> 3.0', '>= 3.0.2'
-gem 'jsonapi-resources', '~> 0.10.7'
+gem 'jsonapi-resources', '~> 0.9.1'
gem 'message_bus', '~> 4.3', '>= 4.3.8'
gem 'mini_magick', '~> 4.13', '>= 4.13.2'
gem 'paper_trail', '~> 14.0'
@@ -32,7 +32,7 @@ gem 'puma', '~> 6.5'
gem 'pundit', '~> 2.4'
gem 'rack-attack', '~> 6.7'
gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors'
-gem 'rails', '~> 7.2.2', '>= 7.2.2.1'
+gem 'rails', '~> 7.1.5', '>= 7.1.5'
gem 'rails-i18n', '~> 7.0', '>= 7.0.10'
gem 'redis', '~> 4.8', '>= 4.8.1'
gem 'roo', '~> 2.10', '>= 2.10.1'