-
Notifications
You must be signed in to change notification settings - Fork 0
Rapid #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.invitertandinvitert.kandidat.endretevents - 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"] |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
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.
| "fnr": ["12345678901"] | |
| "fnr": "12345678901" |
src/main/kotlin/no/nav/toi/kandidatvarsel/minside/MinsideVarsel.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/no/nav/toi/kandidatvarsel/minside/MinsideServices.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/no/nav/toi/kandidatvarsel/rapids/lyttere/KandidatInvitertLytterTest.kt
Outdated
Show resolved
Hide resolved
| null, | ||
| StringSerializer(), |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
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).
| null, | |
| StringSerializer(), | |
| StringSerializer(), | |
| StringSerializer(), |
|
|
||
| private fun sjekkForLoopRecursive(kjørFra: Int) { | ||
| val messages = keyOgMeldinger() | ||
| messages.filterIndexed { index, _ -> index>=kjørFra }.forEach { (key, message) -> |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
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.
| messages.filterIndexed { index, _ -> index>=kjørFra }.forEach { (key, message) -> | |
| messages.filterIndexed { index, _ -> index >= kjørFra }.forEach { (key, message) -> |
| init { | ||
| River(rapidsConnection).apply { | ||
| precondition { | ||
| it.requireValue("@event_name", "invitert.kandidat.endret") |
There was a problem hiding this comment.
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() | ||
| } |
There was a problem hiding this comment.
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.
…eil. varselid skal genereres her i denne appen
No description provided.