Skip to content

Conversation

@joarau
Copy link
Contributor

@joarau joarau commented Nov 12, 2025

No description provided.

@joarau joarau requested a review from Copilot November 13, 2025 08:49
Copilot finished reviewing on behalf of joarau November 13, 2025 08:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates Rapids/Rivers event-driven messaging and adds support for recruitment meeting notifications ("rekrutteringstreff") alongside the existing job posting notifications.

Key changes:

  • Integration of Rapids/Rivers framework for consuming Kafka events
  • New event listeners for kandidat.invitert and invitert.kandidat.endret events
  • Refactoring of data model to support multiple notification types (stilling and rekrutteringstreff)
  • New API endpoints for recruitment meeting notifications and message templates

Reviewed Changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
build.gradle.kts Added Rapids/Rivers dependency and upgraded Kotlin version (with issue)
Main.kt Refactored application startup to integrate Rapids connection and event listeners
TestRapid.kt New test utility for Rapids-based testing with loop detection
KandidatInvitertLytter.kt New event listener for candidate invitation events
InvitertTreffKandidatEndretLytter.kt New event listener for recruitment meeting change events
MinsideVarsel.kt Refactored to use generic avsenderReferanseId instead of stillingId
Mal.kt Added new message templates for recruitment meetings with URL generation
VarslerApi.kt Added new endpoint for retrieving recruitment meeting notifications
MeldingsmalApi.kt Added separate endpoints for stilling and rekrutteringstreff templates
VarselService.kt New service for creating notifications from event data
MinsideServices.kt Updated to handle notifications without stilling data
MinsideClient.kt Updated to generate dynamic URLs based on notification type
KubernetesHealthApi.kt Added Rapids health checks
Javalin.kt Updated to pass Rapids instance to health checks
LocalApp.kt Refactored to use native HttpClient instead of Fuel library
FakeMinside.kt Updated MockProducer initialization (with issue)
*Test.kt files Multiple test files added/updated for new functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
"@event_name": "kandidat.invitert",
"varselId": "$varselId",
"fnr": ["12345678901"]
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistency: fnr is defined as an array ["12345678901"] but should be a string "12345678901" to match the listener's expected format and the test on line 60.

Suggested change
"fnr": ["12345678901"]
"fnr": "12345678901"

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +19
null,
StringSerializer(),
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MockProducer constructor is being called with null as the first parameter. According to the MockProducer API, the first parameter should be a boolean autoComplete. This should be true instead of null to match the original behavior (line 16 shows true was intended).

Suggested change
null,
StringSerializer(),
StringSerializer(),
StringSerializer(),

Copilot uses AI. Check for mistakes.

private fun sjekkForLoopRecursive(kjørFra: Int) {
val messages = keyOgMeldinger()
messages.filterIndexed { index, _ -> index>=kjørFra }.forEach { (key, message) ->
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Missing space after comparison operator. Should be index >= kjørFra for consistency with Kotlin style.

Suggested change
messages.filterIndexed { index, _ -> index>=kjørFra }.forEach { (key, message) ->
messages.filterIndexed { index, _ -> index >= kjørFra }.forEach { (key, message) ->

Copilot uses AI. Check for mistakes.
init {
River(rapidsConnection).apply {
precondition {
it.requireValue("@event_name", "invitert.kandidat.endret")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forvirrende med forskjellige event-name(?):
invitert.kandidat.endret
kandidat.invitert


val kafkaRapidThread = backgroundThread("kafka-rapid", avsluttSignal) {
kafkaRapid.start()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backgroundThread prøver å restarte rapiden om den krasjer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants