From fa9fc60e0bf35a0e97438b0ecee269e59e03e9f1 Mon Sep 17 00:00:00 2001 From: Noam Date: Tue, 2 Jun 2026 11:07:13 +0100 Subject: [PATCH 1/6] Hide CFP speaker callout on home page --- Resources/Views/Home/home.leaf | 2 -- 1 file changed, 2 deletions(-) diff --git a/Resources/Views/Home/home.leaf b/Resources/Views/Home/home.leaf index 71425b1..2c12ef8 100644 --- a/Resources/Views/Home/home.leaf +++ b/Resources/Views/Home/home.leaf @@ -24,8 +24,6 @@ #if(count(speakers) > 0): #extend("Home/_speakers") - #else: - #extend("Home/_cfp") #endif #if(event.year == 2024): From d691512871b561c7f426c0daf487644b7a8428bf Mon Sep 17 00:00:00 2001 From: Noam Efergan Date: Mon, 15 Jun 2026 10:27:48 +0100 Subject: [PATCH 2/6] feat: add event cfp closed flag --- Resources/Views/Admin/Form/event_form.leaf | 5 +++++ Resources/Views/Home/home.leaf | 5 +++++ Sources/App/Context/HomeContext.swift | 2 ++ .../Events/Controllers/EventRouteController.swift | 3 +++ Sources/App/Features/Events/Models/Event.swift | 6 +++++- .../Models/Migrations/Event+Migration+V7.swift | 15 +++++++++++++++ Sources/App/Migrations.swift | 1 + 7 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 Sources/App/Features/Events/Models/Migrations/Event+Migration+V7.swift diff --git a/Resources/Views/Admin/Form/event_form.leaf b/Resources/Views/Admin/Form/event_form.leaf index ffac12f..834409d 100644 --- a/Resources/Views/Admin/Form/event_form.leaf +++ b/Resources/Views/Admin/Form/event_form.leaf @@ -34,6 +34,11 @@ +
+ + +
+
diff --git a/Resources/Views/Home/home.leaf b/Resources/Views/Home/home.leaf index 2c12ef8..42aa266 100644 --- a/Resources/Views/Home/home.leaf +++ b/Resources/Views/Home/home.leaf @@ -24,6 +24,11 @@ #if(count(speakers) > 0): #extend("Home/_speakers") + #else: + #if(event.cfpClosed): + #else: + #extend("Home/_cfp") + #endif #endif #if(event.year == 2024): diff --git a/Sources/App/Context/HomeContext.swift b/Sources/App/Context/HomeContext.swift index abed470..e096a66 100644 --- a/Sources/App/Context/HomeContext.swift +++ b/Sources/App/Context/HomeContext.swift @@ -37,6 +37,7 @@ struct EventContext: Codable { let isFuture: Bool let isPast: Bool let isHidden: Bool + let cfpClosed: Bool init(event: Event) { name = event.name @@ -59,6 +60,7 @@ struct EventContext: Codable { isFuture = event.date > Date() && !isKnownDate isPast = event.date <= Date() && isKnownDate isHidden = isKnownDate != true + cfpClosed = event.cfpClosed } private static func buildConferenceDateString(for event: Event) -> String? { diff --git a/Sources/App/Features/Events/Controllers/EventRouteController.swift b/Sources/App/Features/Events/Controllers/EventRouteController.swift index 8001713..3628dd5 100644 --- a/Sources/App/Features/Events/Controllers/EventRouteController.swift +++ b/Sources/App/Features/Events/Controllers/EventRouteController.swift @@ -59,6 +59,7 @@ struct EventRouteController: RouteCollection { event.location = input.location event.isCurrent = isCurrent event.showSchedule = input.showSchedule ?? false + event.cfpClosed = input.cfpClosed ?? false event.checkinKey = input.checkinKey ?? event.checkinKey event.conference = request.application.conference.rawValue @@ -75,6 +76,7 @@ struct EventRouteController: RouteCollection { ) event.conference = request.application.conference.rawValue + event.cfpClosed = input.cfpClosed ?? false eventID = try event.requireID() try await event.create(on: request.db) @@ -107,6 +109,7 @@ struct EventRouteController: RouteCollection { let location: String let isCurrent: Bool? let showSchedule: Bool? + let cfpClosed: Bool? let checkinKey: String? } } diff --git a/Sources/App/Features/Events/Models/Event.swift b/Sources/App/Features/Events/Models/Event.swift index 4c6a65d..e50c3e5 100644 --- a/Sources/App/Features/Events/Models/Event.swift +++ b/Sources/App/Features/Events/Models/Event.swift @@ -37,17 +37,21 @@ final class Event: Model, Content, @unchecked Sendable { @Field(key: "conference") var conference: String + @Field(key: "cfp_closed") + var cfpClosed: Bool + @Children(for: \.$event) var days: [EventDay] init() {} - init(id: IDValue?, name: String, date: Date, location: String, isCurrent: Bool) { + init(id: IDValue?, name: String, date: Date, location: String, isCurrent: Bool, cfpClosed: Bool = true) { self.id = id self.name = name self.date = date self.location = location self.isCurrent = isCurrent + self.cfpClosed = cfpClosed } } diff --git a/Sources/App/Features/Events/Models/Migrations/Event+Migration+V7.swift b/Sources/App/Features/Events/Models/Migrations/Event+Migration+V7.swift new file mode 100644 index 0000000..d9fa9e8 --- /dev/null +++ b/Sources/App/Features/Events/Models/Migrations/Event+Migration+V7.swift @@ -0,0 +1,15 @@ +import Fluent + +final class EventMigrationV7: AsyncMigration { + func prepare(on database: any Database) async throws { + try await database.schema(Schema.event) + .field("cfp_closed", .bool, .sql(.default(true)), .required) + .update() + } + + func revert(on database: any Database) async throws { + try await database.schema(Schema.event) + .deleteField("cfp_closed") + .update() + } +} diff --git a/Sources/App/Migrations.swift b/Sources/App/Migrations.swift index 035c33c..b430956 100644 --- a/Sources/App/Migrations.swift +++ b/Sources/App/Migrations.swift @@ -87,6 +87,7 @@ class Migrations { app.migrations.add(EventMigrationV5()) // Add `checkin_key` to event app.migrations.add(UserMigrationV2()) // Add `permissions` to user app.migrations.add(EventMigrationV6()) // Add `conference` to event ("swiftleeds" - default, or "kotlinleeds") + app.migrations.add(EventMigrationV7()) // Add `cfp_closed` to event do { guard let url = Environment.get("DATABASE_URL") else { From b8745da388bd2f4b42e64dbaa139350a06212298 Mon Sep 17 00:00:00 2001 From: Noam Efergan <135020606+NoamEfergan@users.noreply.github.com> Date: Mon, 22 Jun 2026 13:24:04 +0100 Subject: [PATCH 3/6] Update Resources/Views/Admin/Form/event_form.leaf Co-authored-by: James Sherlock <15193942+Sherlouk@users.noreply.github.com> --- Resources/Views/Admin/Form/event_form.leaf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Views/Admin/Form/event_form.leaf b/Resources/Views/Admin/Form/event_form.leaf index 834409d..92794d7 100644 --- a/Resources/Views/Admin/Form/event_form.leaf +++ b/Resources/Views/Admin/Form/event_form.leaf @@ -35,7 +35,7 @@
- +
From 077a3b8fe200ea8f91dcfe500177d615a7915fb6 Mon Sep 17 00:00:00 2001 From: Noam Efergan Date: Tue, 7 Jul 2026 10:52:38 +0100 Subject: [PATCH 4/6] ci: skip Docker push and deploy for fork PRs Fork pull_request runs don't receive repository secrets, so the "Login to Google Artifact Registry" step failed with "Password required". Gate the registry login, image push, and deploy job on same-repo events so fork PRs still lint, test, and compile the release build without attempting secret-dependent steps. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4830301..4504cbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,6 +67,9 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to Google Artifact Registry + # Secrets are unavailable to pull_request runs from forks, so skip the + # registry login (and the push below) on fork PRs to avoid a hard failure. + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} uses: docker/login-action@v3 with: registry: europe-west1-docker.pkg.dev @@ -74,6 +77,7 @@ jobs: password: ${{ secrets.GAR_JSON_KEY }} - name: Build and Push Docker Image + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} uses: docker/build-push-action@v5 with: context: . @@ -82,7 +86,11 @@ jobs: tags: europe-west1-docker.pkg.dev/swiftleeds-website/swiftleeds-web/web:${{ github.head_ref || github.ref_name }}-latest deploy: - if: github.repository_owner == 'SwiftLeeds' + # Fork PRs can't access deploy secrets; only deploy for same-repo events. + if: >- + github.repository_owner == 'SwiftLeeds' && + (github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name == github.repository) runs-on: ubuntu-latest needs: build From 0b5d2b0c9665b34797fec6c69a37c3e774b8fdcb Mon Sep 17 00:00:00 2001 From: James Sherlock <15193942+Sherlouk@users.noreply.github.com> Date: Tue, 7 Jul 2026 12:13:04 +0100 Subject: [PATCH 5/6] Revert workflow changes --- .github/workflows/build.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4504cbb..b72313d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,9 +67,6 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to Google Artifact Registry - # Secrets are unavailable to pull_request runs from forks, so skip the - # registry login (and the push below) on fork PRs to avoid a hard failure. - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} uses: docker/login-action@v3 with: registry: europe-west1-docker.pkg.dev @@ -77,7 +74,6 @@ jobs: password: ${{ secrets.GAR_JSON_KEY }} - name: Build and Push Docker Image - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} uses: docker/build-push-action@v5 with: context: . @@ -86,11 +82,6 @@ jobs: tags: europe-west1-docker.pkg.dev/swiftleeds-website/swiftleeds-web/web:${{ github.head_ref || github.ref_name }}-latest deploy: - # Fork PRs can't access deploy secrets; only deploy for same-repo events. - if: >- - github.repository_owner == 'SwiftLeeds' && - (github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name == github.repository) runs-on: ubuntu-latest needs: build From 062108aae09346a212d9a46ed63dae0fbd4738a1 Mon Sep 17 00:00:00 2001 From: James Sherlock <15193942+Sherlouk@users.noreply.github.com> Date: Tue, 7 Jul 2026 12:13:28 +0100 Subject: [PATCH 6/6] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b72313d..823eb83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,6 +83,7 @@ jobs: deploy: runs-on: ubuntu-latest + if: github.repository_owner == 'SwiftLeeds' needs: build strategy: