Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-dependabot-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
types: [closed]
branches:
- main
- master

jobs:
cleanup:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/merge-dependabot-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
description: 'Base branch to merge into'
required: false
type: string
default: 'main'
default: 'master'

jobs:
merge-dependabot-prs:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
run: |
echo "Fetching open Dependabot PRs..."

BASE_BRANCH="${{ inputs.base_branch || 'main' }}"
BASE_BRANCH="${{ inputs.base_branch || 'master' }}"

# Get all open Dependabot PRs with merge status
ALL_PRS=$(gh pr list \
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BASE_BRANCH="${{ inputs.base_branch || 'main' }}"
BASE_BRANCH="${{ inputs.base_branch || 'master' }}"
COMBINED_BRANCH="merge-dependabot-updates-$(date +%Y%m%d-%H%M%S)"

echo "branch=$COMBINED_BRANCH" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BASE_BRANCH="${{ inputs.base_branch || 'main' }}"
BASE_BRANCH="${{ inputs.base_branch || 'master' }}"
COMBINED_BRANCH="${{ steps.merge.outputs.branch }}"

# Build PR body in a file to avoid shell escaping issues
Expand Down
15 changes: 14 additions & 1 deletion kontroller/src/main/kotlin/no/ssb/kostra/program/FileLoader.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package no.ssb.kostra.program

import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.readValue
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import no.ssb.kostra.program.extension.buildFieldDefinitions
Expand All @@ -10,7 +14,16 @@ import java.io.InputStreamReader
import java.nio.file.NoSuchFileException

object FileLoader {
val mapper = ObjectMapper(YAMLFactory()).registerKotlinModule()
val mapper: ObjectMapper =
ObjectMapper(
YAMLFactory()
.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)
.disable(YAMLGenerator.Feature.SPLIT_LINES)
)
.registerKotlinModule() // 👈 REQUIRED for Kotlin data classes
.registerModule(JavaTimeModule()) // 👈 REQUIRED for LocalDate / LocalDateTime
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)

fun getResourceAsFieldDefinitionList(fileName: String): List<FieldDefinition> =
getResource<FileDescription>(fileName).fields.buildFieldDefinitions()
Expand Down
Loading