From 33434db3f2c506d8c06272d5a0a8b05836b44c28 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 3 Nov 2024 09:31:10 +0100 Subject: [PATCH 1/5] Stop redundant builds --- .github/workflows/build.yml | 3 +++ .github/workflows/copyright_notice.yml | 3 +++ .github/workflows/tests.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16e72bb..5edde29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,9 @@ on: branches: - main pull_request: +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: build-static-assets: runs-on: ubuntu-latest diff --git a/.github/workflows/copyright_notice.yml b/.github/workflows/copyright_notice.yml index c97e035..35d8b8d 100644 --- a/.github/workflows/copyright_notice.yml +++ b/.github/workflows/copyright_notice.yml @@ -3,6 +3,9 @@ on: pull_request: permissions: contents: write +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: copyright_notice: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e4d4fec..9f2572f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,6 +4,9 @@ on: branches: - main pull_request: +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: unit_tests: runs-on: ubuntu-latest From 4f133ac3f5568ff40f77038d38d0ab69a31e29e8 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 3 Nov 2024 09:40:57 +0100 Subject: [PATCH 2/5] Configure a build timeout of 30 minutes --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16e72bb..342ba24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,7 @@ on: jobs: build-static-assets: runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v4 with: From 22fbdf5ca3019b5d1a61bef47d9b7e161e12b76a Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 3 Nov 2024 10:07:08 +0100 Subject: [PATCH 3/5] Stop building docker images on PR --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16e72bb..3482b99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ on: push: branches: - main - pull_request: jobs: build-static-assets: runs-on: ubuntu-latest From f21aaa37233646be34428d665c54fbfc464e1050 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 3 Nov 2024 10:41:45 +0100 Subject: [PATCH 4/5] Remove the email property from the guest model --- app/serializers/serializable_guest.rb | 2 +- db/migrate/20241103093955_remove_email_from_guests.rb | 5 +++++ db/schema.rb | 5 +---- db/seeds.rb | 1 - spec/factories/guest.rb | 1 - 5 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20241103093955_remove_email_from_guests.rb diff --git a/app/serializers/serializable_guest.rb b/app/serializers/serializable_guest.rb index b8d9347..d711d03 100644 --- a/app/serializers/serializable_guest.rb +++ b/app/serializers/serializable_guest.rb @@ -3,7 +3,7 @@ class SerializableGuest < JSONAPI::Serializable::Resource type 'guest' - attributes :id, :email, :group_id, :status + attributes :id, :group_id, :status attribute :name do "#{@object.first_name} #{@object.last_name}" diff --git a/db/migrate/20241103093955_remove_email_from_guests.rb b/db/migrate/20241103093955_remove_email_from_guests.rb new file mode 100644 index 0000000..f09bced --- /dev/null +++ b/db/migrate/20241103093955_remove_email_from_guests.rb @@ -0,0 +1,5 @@ +class RemoveEmailFromGuests < ActiveRecord::Migration[7.2] + def change + remove_column :guests, :email, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 172be0b..0ee5240 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. @@ -12,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_11_01_181052) do +ActiveRecord::Schema[7.2].define(version: 2024_11_03_093955) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -42,7 +40,6 @@ ActiveRecord::Schema[7.2].define(version: 2024_11_01_181052) do create_table "guests", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "first_name" t.string "last_name" - t.string "email" t.string "phone" t.datetime "created_at", null: false t.datetime "updated_at", null: false diff --git a/db/seeds.rb b/db/seeds.rb index 71b2a31..ec78d0c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -58,7 +58,6 @@ NUMBER_OF_GUESTS.times do Guest.create!( first_name: Faker::Name.first_name, last_name: Faker::Name.last_name, - email: Faker::Internet.email, phone: Faker::PhoneNumber.cell_phone, group: groups.sample, status: Guest.statuses.keys.sample diff --git a/spec/factories/guest.rb b/spec/factories/guest.rb index 688cdea..2637fb4 100644 --- a/spec/factories/guest.rb +++ b/spec/factories/guest.rb @@ -6,7 +6,6 @@ FactoryBot.define do first_name { Faker::Name.first_name } last_name { Faker::Name.last_name } - email { Faker::Internet.email } phone { Faker::PhoneNumber.cell_phone } end end From c08f7bd37c67f2dd8253eebd212cb2ae1e6fb428 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 3 Nov 2024 10:03:47 +0000 Subject: [PATCH 5/5] Add copyright notice --- db/migrate/20241103093955_remove_email_from_guests.rb | 2 ++ db/schema.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/db/migrate/20241103093955_remove_email_from_guests.rb b/db/migrate/20241103093955_remove_email_from_guests.rb index f09bced..26ca939 100644 --- a/db/migrate/20241103093955_remove_email_from_guests.rb +++ b/db/migrate/20241103093955_remove_email_from_guests.rb @@ -1,3 +1,5 @@ +# Copyright (C) 2024 Manuel Bustillo + class RemoveEmailFromGuests < ActiveRecord::Migration[7.2] def change remove_column :guests, :email, :string diff --git a/db/schema.rb b/db/schema.rb index 0ee5240..39cc112 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.