From da02f370699bd3c7e502576010b609d4e82daa3d Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:06:24 +0100 Subject: [PATCH 01/34] Extract rubocop to a separate job in CI --- .gitea/workflows/tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 886fce3..877a794 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -24,7 +24,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - - run: bundle exec rubocop --force-exclusion --parallel - name: Wait until Postgres is ready to accept connections run: | apt-get update && apt-get install -f -y postgresql-client @@ -42,3 +41,12 @@ jobs: - name: Clean up containers generated by this flow if: failure() run: docker ps --filter network=$JOB_CONTAINER_NAME-$GITHUB_JOB-network --filter name=$JOB_CONTAINER_NAME-* --format "{{.ID}}" | xargs docker rm -f + rubocop: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: ruby/setup-ruby@v1.207.0 + - run: bundle install + - run: bundle exec rubocop --force-exclusion --parallel \ No newline at end of file -- 2.47.1 From f681f8d2f9e0ce556978ee4fe8795480c731abdb Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:12:25 +0100 Subject: [PATCH 02/34] Add a new step redoing the last migration --- .gitea/workflows/tests.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 877a794..5aaaff8 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -10,7 +10,7 @@ concurrency: jobs: unit_tests: runs-on: ubuntu-latest - services: + services: &services postgres: image: postgres env: @@ -49,4 +49,23 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - - run: bundle exec rubocop --force-exclusion --parallel \ No newline at end of file + - run: bundle exec rubocop --force-exclusion --parallel + reversible_migrations: + runs-on: ubuntu-latest + services: *services + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: ruby/setup-ruby@v1.207.0 + - run: bundle install + - name: Wait until Postgres is ready to accept connections + run: | + apt-get update && apt-get install -f -y postgresql-client + until pg_isready -h postgres -U postgres -d postgres + do + sleep 1 + echo "Trying again" + done + - run: bundle exec rake db:schema:load + - run: bundle exec rake db:migrate:redo \ No newline at end of file -- 2.47.1 From db55bafea120464812ec804ec328b1cb7f28ff2e Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:21:46 +0100 Subject: [PATCH 03/34] Reuse code to wait for Postgres to be active --- .gitea/workflows/tests.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 5aaaff8..7be8b5d 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -24,7 +24,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - - name: Wait until Postgres is ready to accept connections + - &postgres_wait + name: Wait until Postgres is ready to accept connections run: | apt-get update && apt-get install -f -y postgresql-client until pg_isready -h postgres -U postgres -d postgres @@ -59,13 +60,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - - name: Wait until Postgres is ready to accept connections - run: | - apt-get update && apt-get install -f -y postgresql-client - until pg_isready -h postgres -U postgres -d postgres - do - sleep 1 - echo "Trying again" - done + - *postgres_wait - run: bundle exec rake db:schema:load - run: bundle exec rake db:migrate:redo \ No newline at end of file -- 2.47.1 From e612cf9936c4d8bce3a71cc57f8562dcf72d9743 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:24:35 +0100 Subject: [PATCH 04/34] Move docker build into the same workflow --- .gitea/workflows/build.yml | 46 -------------------------------------- .gitea/workflows/tests.yml | 42 +++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 47 deletions(-) delete mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml deleted file mode 100644 index 5748059..0000000 --- a/.gitea/workflows/build.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Build Nginx-based docker image -on: - push: - branches: - - main - pull_request: -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true -jobs: - build-static-assets: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to the private Docker registry - uses: docker/login-action@v3 - with: - registry: ${{ secrets.PRIVATE_REGISTRY_HOST }} - username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }} - password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }} - - - name: Build and push intermediate stages (build) - uses: docker/build-push-action@v6 - with: - context: . - target: build - push: ${{ github.ref == 'refs/heads/main' }} - tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build - cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build - cache-to: type=inline - - - name: Build and push (final) - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ github.ref == 'refs/heads/main' }} - tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest - cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest - cache-to: type=inline \ No newline at end of file diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 7be8b5d..cdf1022 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -62,4 +62,44 @@ jobs: - run: bundle install - *postgres_wait - run: bundle exec rake db:schema:load - - run: bundle exec rake db:migrate:redo \ No newline at end of file + - run: bundle exec rake db:migrate:redo + build-static-assets: + runs-on: ubuntu-latest + timeout-minutes: 30 + needs: + - unit_tests + - rubocop + - reversible_migrations + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to the private Docker registry + uses: docker/login-action@v3 + with: + registry: ${{ secrets.PRIVATE_REGISTRY_HOST }} + username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }} + password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }} + + - name: Build and push intermediate stages (build) + uses: docker/build-push-action@v6 + with: + context: . + target: build + push: ${{ github.ref == 'refs/heads/main' }} + tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build + cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build + cache-to: type=inline + + - name: Build and push (final) + uses: docker/build-push-action@v6 + with: + context: . + push: ${{ github.ref == 'refs/heads/main' }} + tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest + cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest + cache-to: type=inline \ No newline at end of file -- 2.47.1 From 798cf564b4f2a28d77ec700173f25ffff8b26a29 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:36:01 +0100 Subject: [PATCH 05/34] Redo last 5 migrations before running specs --- .gitea/workflows/tests.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index cdf1022..4772fd8 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -35,6 +35,8 @@ jobs: done - run: | bundle exec rake db:schema:load + bundle exec rake db:migrate:redo STEP=5 + - run: | bundle exec rspec env: RAILS_ENV: test @@ -51,25 +53,12 @@ jobs: - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - run: bundle exec rubocop --force-exclusion --parallel - reversible_migrations: - runs-on: ubuntu-latest - services: *services - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: ruby/setup-ruby@v1.207.0 - - run: bundle install - - *postgres_wait - - run: bundle exec rake db:schema:load - - run: bundle exec rake db:migrate:redo build-static-assets: runs-on: ubuntu-latest timeout-minutes: 30 needs: - unit_tests - rubocop - - reversible_migrations steps: - uses: actions/checkout@v4 with: -- 2.47.1 From fe456a3e526f413ef6f76c6f763d028707e8fb53 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:38:07 +0100 Subject: [PATCH 06/34] Check licenses as part of the same workflow --- .gitea/workflows/license_finder.yml | 21 --------------------- .gitea/workflows/tests.yml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 .gitea/workflows/license_finder.yml diff --git a/.gitea/workflows/license_finder.yml b/.gitea/workflows/license_finder.yml deleted file mode 100644 index 6e21f6e..0000000 --- a/.gitea/workflows/license_finder.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Check usage of free licenses -on: - push: - branches: - - main - pull_request: -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true -jobs: - check-licenses: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: ruby/setup-ruby@v1.207.0 - - name: Install project dependencies - run: bundle install --jobs `getconf _NPROCESSORS_ONLN` - - name: Run license finder - run: license_finder diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 4772fd8..e5a9869 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -53,12 +53,25 @@ jobs: - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - run: bundle exec rubocop --force-exclusion --parallel + check-licenses: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: ruby/setup-ruby@v1.207.0 + - name: Install project dependencies + run: bundle install --jobs `getconf _NPROCESSORS_ONLN` + - name: Run license finder + run: license_finder + build-static-assets: runs-on: ubuntu-latest timeout-minutes: 30 needs: - unit_tests - rubocop + - check-licenses steps: - uses: actions/checkout@v4 with: -- 2.47.1 From fec7efe10a684791243867e2108a8d5b85f5a974 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:39:50 +0100 Subject: [PATCH 07/34] Add copyright notice as part of the same workflow --- .gitea/workflows/copyright_notice.yml | 39 --------------------------- .gitea/workflows/tests.yml | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 39 deletions(-) delete mode 100644 .gitea/workflows/copyright_notice.yml diff --git a/.gitea/workflows/copyright_notice.yml b/.gitea/workflows/copyright_notice.yml deleted file mode 100644 index 35d8b8d..0000000 --- a/.gitea/workflows/copyright_notice.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Add copyright notice -on: - pull_request: -permissions: - contents: write -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true -jobs: - copyright_notice: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.ACTIONS_TOKEN }} - ref: ${{ github.head_ref }} - - uses: VinnyBabuManjaly/copyright-action@v1.0.0 - with: - CopyrightString: '# Copyright (C) 2024 Manuel Bustillo\n\n' - FileType: '.rb' - Path: 'app/, config/, db/, spec/' - - uses: VinnyBabuManjaly/copyright-action@v1.0.0 - with: - CopyrightString: '<%# Copyright (C) 2024 Manuel Bustillo %>\n\n' - FileType: '.erb' - Path: 'app/' - - name: Commit changes - run: | - git config --local user.email "bustikiller@bustikiller.com" - git config --local user.name "Manuel Bustillo" - git add . - - if [ -n "$(git status --porcelain)" ]; then - echo "there are changes"; - git commit -m "Add copyright notice" - git push - else - echo "no changes"; - fi diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index e5a9869..ccd21b0 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -64,6 +64,37 @@ jobs: run: bundle install --jobs `getconf _NPROCESSORS_ONLN` - name: Run license finder run: license_finder + copyright_notice: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.ACTIONS_TOKEN }} + ref: ${{ github.head_ref }} + - uses: VinnyBabuManjaly/copyright-action@v1.0.0 + with: + CopyrightString: '# Copyright (C) 2024 Manuel Bustillo\n\n' + FileType: '.rb' + Path: 'app/, config/, db/, spec/' + - uses: VinnyBabuManjaly/copyright-action@v1.0.0 + with: + CopyrightString: '<%# Copyright (C) 2024 Manuel Bustillo %>\n\n' + FileType: '.erb' + Path: 'app/' + - name: Commit changes + run: | + git config --local user.email "bustikiller@bustikiller.com" + git config --local user.name "Manuel Bustillo" + git add . + + if [ -n "$(git status --porcelain)" ]; then + echo "there are changes"; + git commit -m "Add copyright notice" + git push + exit 1 + else + echo "no changes"; + fi build-static-assets: runs-on: ubuntu-latest @@ -72,6 +103,7 @@ jobs: - unit_tests - rubocop - check-licenses + - copyright_notice steps: - uses: actions/checkout@v4 with: -- 2.47.1 From bb7d7cbf49435b30782c0b51fae83bcc9371c5e9 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:43:27 +0100 Subject: [PATCH 08/34] Display last 10 migrations --- .gitea/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index ccd21b0..f1dc18f 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,8 +34,8 @@ jobs: echo "Trying again" done - run: | - bundle exec rake db:schema:load - bundle exec rake db:migrate:redo STEP=5 + bundle exec rake db:schema:load db:migrate:status | tail -10 + # bundle exec rake db:migrate:redo STEP=5 - run: | bundle exec rspec env: -- 2.47.1 From 540ba0d59d9f0bb71236850ed101c7c9005692ec Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 22:46:22 +0100 Subject: [PATCH 09/34] Restore working version --- .gitea/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index f1dc18f..b412a2c 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,9 +34,7 @@ jobs: echo "Trying again" done - run: | - bundle exec rake db:schema:load db:migrate:status | tail -10 - # bundle exec rake db:migrate:redo STEP=5 - - run: | + bundle exec rake db:schema:load bundle exec rspec env: RAILS_ENV: test -- 2.47.1 From d5173baca29ecdc5072450e824cc5907ad268a1e Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:13:07 +0100 Subject: [PATCH 10/34] Redo last migration --- .gitea/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index b412a2c..7770abc 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: echo "Trying again" done - run: | - bundle exec rake db:schema:load + bundle exec rake db:schema:load db:migrate:redo bundle exec rspec env: RAILS_ENV: test -- 2.47.1 From 7a2feec3cb42921f3b9fe3ecd15d010b3848702d Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:16:08 +0100 Subject: [PATCH 11/34] Display list of migrations --- .gitea/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 7770abc..6cb3de3 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: echo "Trying again" done - run: | - bundle exec rake db:schema:load db:migrate:redo + bundle exec rake db:schema:load db:migrate:status db:migrate:redo bundle exec rspec env: RAILS_ENV: test -- 2.47.1 From c8f221614a956b3f5b852ec3724f64913711fb47 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:19:15 +0100 Subject: [PATCH 12/34] Fix previous migration to make it reversible --- db/migrate/20241216231415_create_group_affinities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20241216231415_create_group_affinities.rb b/db/migrate/20241216231415_create_group_affinities.rb index 113d026..31104af 100644 --- a/db/migrate/20241216231415_create_group_affinities.rb +++ b/db/migrate/20241216231415_create_group_affinities.rb @@ -14,7 +14,7 @@ class CreateGroupAffinities < ActiveRecord::Migration[8.0] end add_check_constraint :group_affinities, 'group_a_id != group_b_id', name: :check_distinct_groups, if_not_exists: true - add_check_constraint :group_affinities, 'discomfort >= 0 AND discomfort <= 2', if_not_exists: true + add_check_constraint :group_affinities, 'discomfort >= 0 AND discomfort <= 2', name: :check_valid_discomfort, if_not_exists: true reversible do |dir| dir.up do -- 2.47.1 From d35c0353fcb73713ddcd963595031ce7327648cb Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:26:02 +0100 Subject: [PATCH 13/34] Exit if reapplying last migration generates schema changes --- .gitea/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 6cb3de3..0ed65d9 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -35,6 +35,7 @@ jobs: done - run: | bundle exec rake db:schema:load db:migrate:status db:migrate:redo + git diff --exit-code db/schema.rb bundle exec rspec env: RAILS_ENV: test -- 2.47.1 From 1306a33e8aa30fe36a77e4672a9a381322f1660d Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:29:29 +0100 Subject: [PATCH 14/34] Fix schema --- db/schema.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index cfc1383..10ab0cd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,7 +1,3 @@ -# Copyright (C) 2024 Manuel Bustillo - -# Copyright (C) 2024-2025 LibreWeddingPlanner contributors - # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. @@ -41,7 +37,7 @@ ActiveRecord::Schema[8.0].define(version: 2024_12_16_231415) do t.index "LEAST(group_a_id, group_b_id), GREATEST(group_a_id, group_b_id)", name: "uindex_group_pair", unique: true t.index ["group_a_id"], name: "index_group_affinities_on_group_a_id" t.index ["group_b_id"], name: "index_group_affinities_on_group_b_id" - t.check_constraint "discomfort >= 0::double precision AND discomfort <= 2::double precision" + t.check_constraint "discomfort >= 0::double precision AND discomfort <= 2::double precision", name: "check_valid_discomfort" t.check_constraint "group_a_id <> group_b_id", name: "check_distinct_groups" end -- 2.47.1 From 89bc7fa1426e6913a17ae2d43a5e0a1e294916ed Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 23 Jan 2025 23:30:49 +0000 Subject: [PATCH 15/34] Add copyright notice --- db/schema.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/schema.rb b/db/schema.rb index 10ab0cd..9f2c050 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. -- 2.47.1 From 966998e6c8ff0b9030e2aa2b6c5768c6aa906571 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:31:16 +0100 Subject: [PATCH 16/34] Display the number of migrations added --- .gitea/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 0ed65d9..e4af66f 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -21,6 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + depth: 2 token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1.207.0 - run: bundle install @@ -34,6 +35,8 @@ jobs: echo "Trying again" done - run: | + migrations_added=$(git diff origin/main --name-only db/migrate/ | wc -l) + echo "Migrations added: $migrations_added" bundle exec rake db:schema:load db:migrate:status db:migrate:redo git diff --exit-code db/schema.rb bundle exec rspec -- 2.47.1 From 66c5b3a5262b25bbd1b2d25fed1392faa2951a44 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:37:15 +0100 Subject: [PATCH 17/34] Compare number of migrations against base ref --- .gitea/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index e4af66f..0dc280e 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -35,7 +35,7 @@ jobs: echo "Trying again" done - run: | - migrations_added=$(git diff origin/main --name-only db/migrate/ | wc -l) + migrations_added=$(git diff ${{ github.base_ref }} --name-only db/migrate/ | wc -l) echo "Migrations added: $migrations_added" bundle exec rake db:schema:load db:migrate:status db:migrate:redo git diff --exit-code db/schema.rb -- 2.47.1 From 44590e68895df821090141cb5cd7ef4862cc720a Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:43:46 +0100 Subject: [PATCH 18/34] Fetch branch before comparison --- .gitea/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 0dc280e..6624d4f 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -35,7 +35,8 @@ jobs: echo "Trying again" done - run: | - migrations_added=$(git diff ${{ github.base_ref }} --name-only db/migrate/ | wc -l) + git fetch + migrations_added=$(git diff origin/${{ github.base_ref }} --name-only db/migrate/ | wc -l) echo "Migrations added: $migrations_added" bundle exec rake db:schema:load db:migrate:status db:migrate:redo git diff --exit-code db/schema.rb -- 2.47.1 From a12d60e7cb6dbbc79f1327909f505bce97935cf2 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:48:00 +0100 Subject: [PATCH 19/34] Use PR base SHA --- .gitea/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 6624d4f..93c67ae 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -35,8 +35,7 @@ jobs: echo "Trying again" done - run: | - git fetch - migrations_added=$(git diff origin/${{ github.base_ref }} --name-only db/migrate/ | wc -l) + migrations_added=$(git diff ${{ github.event.pull_request.base.sha }} --name-only db/migrate/ | wc -l) echo "Migrations added: $migrations_added" bundle exec rake db:schema:load db:migrate:status db:migrate:redo git diff --exit-code db/schema.rb -- 2.47.1 From 3651176bbdaddcc28a602728a9824504e7800196 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 00:50:12 +0100 Subject: [PATCH 20/34] Fetch before diff --- .gitea/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 93c67ae..8b1f5a2 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -35,6 +35,7 @@ jobs: echo "Trying again" done - run: | + git fetch origin ${{ github.event.pull_request.base.sha }} migrations_added=$(git diff ${{ github.event.pull_request.base.sha }} --name-only db/migrate/ | wc -l) echo "Migrations added: $migrations_added" bundle exec rake db:schema:load db:migrate:status db:migrate:redo -- 2.47.1 From f08082fb3b8c008409325ab0ef541f156f4169f6 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 08:39:00 +0100 Subject: [PATCH 21/34] Checkout the commit as is in the PR, not if merged into the base --- .gitea/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 8b1f5a2..8c05e89 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -21,8 +21,8 @@ jobs: steps: - uses: actions/checkout@v4 with: - depth: 2 token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.head_ref }} # Checkout the actual branch, not the result if merged into the base - uses: ruby/setup-ruby@v1.207.0 - run: bundle install - &postgres_wait -- 2.47.1 From 644f35c57f5396d586571896b0d9fa500fcdd1b4 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 08:45:57 +0100 Subject: [PATCH 22/34] Add a separate action to list changed migrations --- .gitea/workflows/tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 8c05e89..dc34a3f 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,6 +34,20 @@ jobs: sleep 1 echo "Trying again" done + - name: Get all migrations added + id: changed-migration-files + uses: tj-actions/changed-files@v45 + with: + files: | + db/migrate/**.rb + - name: List all migrations added + if: steps.changed-migration-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-migration-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done - run: | git fetch origin ${{ github.event.pull_request.base.sha }} migrations_added=$(git diff ${{ github.event.pull_request.base.sha }} --name-only db/migrate/ | wc -l) -- 2.47.1 From 139502c69ad97cb92a405617f1884be377b38b1d Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 08:51:02 +0100 Subject: [PATCH 23/34] Show number of migrations added --- .gitea/workflows/tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index dc34a3f..b155160 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -45,13 +45,12 @@ jobs: env: ALL_CHANGED_FILES: ${{ steps.changed-migration-files.outputs.all_changed_files }} run: | + echo ${#ALL_CHANGED_FILES[@]} for file in ${ALL_CHANGED_FILES}; do echo "$file was changed" done - run: | - git fetch origin ${{ github.event.pull_request.base.sha }} - migrations_added=$(git diff ${{ github.event.pull_request.base.sha }} --name-only db/migrate/ | wc -l) - echo "Migrations added: $migrations_added" + exit 1 bundle exec rake db:schema:load db:migrate:status db:migrate:redo git diff --exit-code db/schema.rb bundle exec rspec -- 2.47.1 From ac470a802b6dcf59bab7e495fabf9a81d7b42f11 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 08:55:26 +0100 Subject: [PATCH 24/34] Redo migrations after running specs --- .gitea/workflows/tests.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index b155160..cb929e0 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,6 +34,12 @@ jobs: sleep 1 echo "Trying again" done + - run: | + bundle exec rake db:schema:load + bundle exec rspec + env: + RAILS_ENV: test + DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres - name: Get all migrations added id: changed-migration-files uses: tj-actions/changed-files@v45 @@ -45,18 +51,13 @@ jobs: env: ALL_CHANGED_FILES: ${{ steps.changed-migration-files.outputs.all_changed_files }} run: | - echo ${#ALL_CHANGED_FILES[@]} + echo ${#ALL_CHANGED_FILES[@]} migrations changed: for file in ${ALL_CHANGED_FILES}; do echo "$file was changed" done - - run: | - exit 1 - bundle exec rake db:schema:load db:migrate:status db:migrate:redo + + bundle exec rake db:migrate:redo STEP=${#ALL_CHANGED_FILES[@]} git diff --exit-code db/schema.rb - bundle exec rspec - env: - RAILS_ENV: test - DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres - name: Clean up containers generated by this flow if: failure() run: docker ps --filter network=$JOB_CONTAINER_NAME-$GITHUB_JOB-network --filter name=$JOB_CONTAINER_NAME-* --format "{{.ID}}" | xargs docker rm -f -- 2.47.1 From 494431eea645312d7ccabc30b696ba6075e2baf5 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 08:58:14 +0100 Subject: [PATCH 25/34] Add missing variable --- .gitea/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index cb929e0..c08f486 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -50,6 +50,8 @@ jobs: if: steps.changed-migration-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-migration-files.outputs.all_changed_files }} + RAILS_ENV: test + DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres run: | echo ${#ALL_CHANGED_FILES[@]} migrations changed: for file in ${ALL_CHANGED_FILES}; do -- 2.47.1 From c30b6df0a496e614637f9283d0c4a0478a7b0a78 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 09:02:46 +0100 Subject: [PATCH 26/34] Exclude db/schema.rb from copyright notice --- .gitea/workflows/tests.yml | 3 ++- db/schema.rb | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index c08f486..afee52c 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: run: | echo ${#ALL_CHANGED_FILES[@]} migrations changed: for file in ${ALL_CHANGED_FILES}; do - echo "$file was changed" + echo "$file" done bundle exec rake db:migrate:redo STEP=${#ALL_CHANGED_FILES[@]} @@ -95,6 +95,7 @@ jobs: CopyrightString: '# Copyright (C) 2024 Manuel Bustillo\n\n' FileType: '.rb' Path: 'app/, config/, db/, spec/' + IgnorePath: 'db/schema.rb' - uses: VinnyBabuManjaly/copyright-action@v1.0.0 with: CopyrightString: '<%# Copyright (C) 2024 Manuel Bustillo %>\n\n' diff --git a/db/schema.rb b/db/schema.rb index 9f2c050..10ab0cd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,5 +1,3 @@ -# Copyright (C) 2024 Manuel Bustillo - # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. -- 2.47.1 From c714a49a04206a142f69328e70320e86fc0fc871 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 09:05:24 +0100 Subject: [PATCH 27/34] Ignore the full db directory --- .gitea/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index afee52c..b2bf73a 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -95,7 +95,7 @@ jobs: CopyrightString: '# Copyright (C) 2024 Manuel Bustillo\n\n' FileType: '.rb' Path: 'app/, config/, db/, spec/' - IgnorePath: 'db/schema.rb' + IgnorePath: 'db' - uses: VinnyBabuManjaly/copyright-action@v1.0.0 with: CopyrightString: '<%# Copyright (C) 2024 Manuel Bustillo %>\n\n' -- 2.47.1 From 9724e1995455b8b16c0225510edb7b57c6125fb8 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 09:08:28 +0100 Subject: [PATCH 28/34] Restore original version of the migration --- db/migrate/20241216231415_create_group_affinities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20241216231415_create_group_affinities.rb b/db/migrate/20241216231415_create_group_affinities.rb index 31104af..113d026 100644 --- a/db/migrate/20241216231415_create_group_affinities.rb +++ b/db/migrate/20241216231415_create_group_affinities.rb @@ -14,7 +14,7 @@ class CreateGroupAffinities < ActiveRecord::Migration[8.0] end add_check_constraint :group_affinities, 'group_a_id != group_b_id', name: :check_distinct_groups, if_not_exists: true - add_check_constraint :group_affinities, 'discomfort >= 0 AND discomfort <= 2', name: :check_valid_discomfort, if_not_exists: true + add_check_constraint :group_affinities, 'discomfort >= 0 AND discomfort <= 2', if_not_exists: true reversible do |dir| dir.up do -- 2.47.1 From 140555ed68883dc1c7b0c3a67df5097d6f8892fb Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 09:08:49 +0100 Subject: [PATCH 29/34] Do not fail job if there are new copyright assignments --- .gitea/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index b2bf73a..4b8e5e4 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -111,7 +111,6 @@ jobs: echo "there are changes"; git commit -m "Add copyright notice" git push - exit 1 else echo "no changes"; fi -- 2.47.1 From 5b6082fad6edb47509cc466a9d35e7d5eacaffe2 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 09:10:32 +0100 Subject: [PATCH 30/34] Refine names in CI steps --- .gitea/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 4b8e5e4..e0fb70e 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,7 +34,8 @@ jobs: sleep 1 echo "Trying again" done - - run: | + - name: Load schema and run unit tests + run: | bundle exec rake db:schema:load bundle exec rspec env: @@ -46,7 +47,7 @@ jobs: with: files: | db/migrate/**.rb - - name: List all migrations added + - name: Redo all migrations and check there are no schema changes if: steps.changed-migration-files.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-migration-files.outputs.all_changed_files }} -- 2.47.1 From d4b95c9c55309774f196662bec36673b64dee5dc Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 25 Jan 2025 09:52:17 +0100 Subject: [PATCH 31/34] Redo migrations after running specs --- .gitea/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 6248ea1..9c53589 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -93,13 +93,13 @@ jobs: ref: ${{ github.head_ref }} - uses: VinnyBabuManjaly/copyright-action@v1.0.0 with: - CopyrightString: '# Copyright (C) 2024 - 2025 LibreWeddingPlanner contributors\n\n' + CopyrightString: '# Copyright (C) 2024-2025 LibreWeddingPlanner contributors\n\n' FileType: '.rb' Path: 'app/, config/, db/, spec/' IgnorePath: 'db' - uses: VinnyBabuManjaly/copyright-action@v1.0.0 with: - CopyrightString: '<%# Copyright (C) 2024 - 2025 LibreWeddingPlanner contributors %>\n\n' + CopyrightString: '<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>\n\n' FileType: '.erb' Path: 'app/' - name: Commit changes -- 2.47.1 From 744b13ecb83fecc264aee96d0d419a8d80432b13 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 25 Jan 2025 10:11:03 +0100 Subject: [PATCH 32/34] Remove incorrect copyright notice --- app/views/layouts/mailer.html.erb | 2 -- app/views/layouts/mailer.text.erb | 2 -- app/views/users/mailer/confirmation_instructions.html.erb | 2 -- app/views/users/mailer/email_changed.html.erb | 2 -- app/views/users/mailer/password_change.html.erb | 2 -- app/views/users/mailer/reset_password_instructions.html.erb | 2 -- app/views/users/mailer/unlock_instructions.html.erb | 2 -- 7 files changed, 14 deletions(-) diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index a8eafc7..b3f319f 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,5 +1,3 @@ -<%# Copyright (C) 22024-2025 LibreWeddingPlanner contributors %> - <%<%<% diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb index 0769757..8404d89 100644 --- a/app/views/layouts/mailer.text.erb +++ b/app/views/layouts/mailer.text.erb @@ -1,3 +1 @@ -<%# Copyright (C) 22024-2025 LibreWeddingPlanner contributors %> - <%<%<%<%= yield %> diff --git a/app/views/users/mailer/confirmation_instructions.html.erb b/app/views/users/mailer/confirmation_instructions.html.erb index f477218..26dc9ed 100644 --- a/app/views/users/mailer/confirmation_instructions.html.erb +++ b/app/views/users/mailer/confirmation_instructions.html.erb @@ -1,5 +1,3 @@ -<%# Copyright (C) 22024-2025 LibreWeddingPlanner contributors %> - <%<%<%

Welcome <%= @email %>!

You can confirm your account email through the link below:

diff --git a/app/views/users/mailer/email_changed.html.erb b/app/views/users/mailer/email_changed.html.erb index 0e68a0a..7c3a50f 100644 --- a/app/views/users/mailer/email_changed.html.erb +++ b/app/views/users/mailer/email_changed.html.erb @@ -1,5 +1,3 @@ -<%# Copyright (C) 22024-2025 LibreWeddingPlanner contributors %> - <%<%<%

Hello <%= @email %>!

<% if @resource.try(:unconfirmed_email?) %> diff --git a/app/views/users/mailer/password_change.html.erb b/app/views/users/mailer/password_change.html.erb index bf4de87..7bca9b7 100644 --- a/app/views/users/mailer/password_change.html.erb +++ b/app/views/users/mailer/password_change.html.erb @@ -1,5 +1,3 @@ -<%# Copyright (C) 22024-2025 LibreWeddingPlanner contributors %> - <%<%<%

Hello <%= @resource.email %>!

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/users/mailer/reset_password_instructions.html.erb b/app/views/users/mailer/reset_password_instructions.html.erb index 0499866..a2e70db 100644 --- a/app/views/users/mailer/reset_password_instructions.html.erb +++ b/app/views/users/mailer/reset_password_instructions.html.erb @@ -1,5 +1,3 @@ -<%# Copyright (C) 22024-2025 LibreWeddingPlanner contributors %> - <%<%<%

Hello <%= @resource.email %>!

Someone has requested a link to change your password. You can do this through the link below.

diff --git a/app/views/users/mailer/unlock_instructions.html.erb b/app/views/users/mailer/unlock_instructions.html.erb index b59cb33..86d82c0 100644 --- a/app/views/users/mailer/unlock_instructions.html.erb +++ b/app/views/users/mailer/unlock_instructions.html.erb @@ -1,5 +1,3 @@ -<%# Copyright (C) 22024-2025 LibreWeddingPlanner contributors %> - <%<%<%

Hello <%= @resource.email %>!

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

-- 2.47.1 From 60cfbd1a40502d4f064e8e5f382617f0ce01c1e8 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 25 Jan 2025 10:12:36 +0100 Subject: [PATCH 33/34] Fix markup errors --- app/views/layouts/mailer.html.erb | 2 +- app/views/layouts/mailer.text.erb | 2 +- app/views/users/mailer/confirmation_instructions.html.erb | 2 +- app/views/users/mailer/email_changed.html.erb | 2 +- app/views/users/mailer/password_change.html.erb | 2 +- app/views/users/mailer/reset_password_instructions.html.erb | 2 +- app/views/users/mailer/unlock_instructions.html.erb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index b3f319f..3aac900 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,4 +1,4 @@ -<%<%<% + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb index 8404d89..37f0bdd 100644 --- a/app/views/layouts/mailer.text.erb +++ b/app/views/layouts/mailer.text.erb @@ -1 +1 @@ -<%<%<%<%= yield %> +<%= yield %> diff --git a/app/views/users/mailer/confirmation_instructions.html.erb b/app/views/users/mailer/confirmation_instructions.html.erb index 26dc9ed..7b71e44 100644 --- a/app/views/users/mailer/confirmation_instructions.html.erb +++ b/app/views/users/mailer/confirmation_instructions.html.erb @@ -1,4 +1,4 @@ -<%<%<%

Welcome <%= @email %>!

+

Welcome <%= @email %>!

You can confirm your account email through the link below:

diff --git a/app/views/users/mailer/email_changed.html.erb b/app/views/users/mailer/email_changed.html.erb index 7c3a50f..32f4ba8 100644 --- a/app/views/users/mailer/email_changed.html.erb +++ b/app/views/users/mailer/email_changed.html.erb @@ -1,4 +1,4 @@ -<%<%<%

Hello <%= @email %>!

+

Hello <%= @email %>!

<% if @resource.try(:unconfirmed_email?) %>

We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.

diff --git a/app/views/users/mailer/password_change.html.erb b/app/views/users/mailer/password_change.html.erb index 7bca9b7..b41daf4 100644 --- a/app/views/users/mailer/password_change.html.erb +++ b/app/views/users/mailer/password_change.html.erb @@ -1,3 +1,3 @@ -<%<%<%

Hello <%= @resource.email %>!

+

Hello <%= @resource.email %>!

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/users/mailer/reset_password_instructions.html.erb b/app/views/users/mailer/reset_password_instructions.html.erb index a2e70db..010a079 100644 --- a/app/views/users/mailer/reset_password_instructions.html.erb +++ b/app/views/users/mailer/reset_password_instructions.html.erb @@ -1,4 +1,4 @@ -<%<%<%

Hello <%= @resource.email %>!

+

Hello <%= @resource.email %>!

Someone has requested a link to change your password. You can do this through the link below.

diff --git a/app/views/users/mailer/unlock_instructions.html.erb b/app/views/users/mailer/unlock_instructions.html.erb index 86d82c0..313fe8e 100644 --- a/app/views/users/mailer/unlock_instructions.html.erb +++ b/app/views/users/mailer/unlock_instructions.html.erb @@ -1,4 +1,4 @@ -<%<%<%

Hello <%= @resource.email %>!

+

Hello <%= @resource.email %>!

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

-- 2.47.1 From 27ab5fc89612bf079256ab470a590813ce63455c Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 25 Jan 2025 09:14:12 +0000 Subject: [PATCH 34/34] Add copyright notice --- app/views/layouts/mailer.html.erb | 2 ++ app/views/layouts/mailer.text.erb | 2 ++ app/views/users/mailer/confirmation_instructions.html.erb | 2 ++ app/views/users/mailer/email_changed.html.erb | 2 ++ app/views/users/mailer/password_change.html.erb | 2 ++ app/views/users/mailer/reset_password_instructions.html.erb | 2 ++ app/views/users/mailer/unlock_instructions.html.erb | 2 ++ 7 files changed, 14 insertions(+) diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index 3aac900..32b0c16 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %> + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb index 37f0bdd..9bdce1a 100644 --- a/app/views/layouts/mailer.text.erb +++ b/app/views/layouts/mailer.text.erb @@ -1 +1,3 @@ +<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %> + <%= yield %> diff --git a/app/views/users/mailer/confirmation_instructions.html.erb b/app/views/users/mailer/confirmation_instructions.html.erb index 7b71e44..cd3b2f1 100644 --- a/app/views/users/mailer/confirmation_instructions.html.erb +++ b/app/views/users/mailer/confirmation_instructions.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %> +

Welcome <%= @email %>!

You can confirm your account email through the link below:

diff --git a/app/views/users/mailer/email_changed.html.erb b/app/views/users/mailer/email_changed.html.erb index 32f4ba8..f5f2998 100644 --- a/app/views/users/mailer/email_changed.html.erb +++ b/app/views/users/mailer/email_changed.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %> +

Hello <%= @email %>!

<% if @resource.try(:unconfirmed_email?) %> diff --git a/app/views/users/mailer/password_change.html.erb b/app/views/users/mailer/password_change.html.erb index b41daf4..1181727 100644 --- a/app/views/users/mailer/password_change.html.erb +++ b/app/views/users/mailer/password_change.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %> +

Hello <%= @resource.email %>!

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/users/mailer/reset_password_instructions.html.erb b/app/views/users/mailer/reset_password_instructions.html.erb index 010a079..95bc588 100644 --- a/app/views/users/mailer/reset_password_instructions.html.erb +++ b/app/views/users/mailer/reset_password_instructions.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %> +

Hello <%= @resource.email %>!

Someone has requested a link to change your password. You can do this through the link below.

diff --git a/app/views/users/mailer/unlock_instructions.html.erb b/app/views/users/mailer/unlock_instructions.html.erb index 313fe8e..3efb341 100644 --- a/app/views/users/mailer/unlock_instructions.html.erb +++ b/app/views/users/mailer/unlock_instructions.html.erb @@ -1,3 +1,5 @@ +<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %> +

Hello <%= @resource.email %>!

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

-- 2.47.1