Skip to content
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

Prepare release 4.5.6 #1155

Merged
merged 2 commits into from
Sep 16, 2024
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
* Fail builds when aqua scan detects remotely exploitable security vulnerabilities with solutions ([#1147](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1147))

### Added

Expand All @@ -10,6 +11,11 @@
### Fixed
* Fix Tailor deployment drifts for D, Q envs ([#1055](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1055))

## [4.5.6] - 2024-09-16

### Fixed
* Even if the POO property is set a true, this information is not present in the RA generated ([#1154](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1154))

## [4.5.5] - 2024-08-26

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ class LeVADocumentUseCase extends DocGenUseCase {

if (!sections."sec4s2s2") sections."sec4s2s2" = [:]

if (this.project.getProjectProperties()."PROJECT.USES_POO" == "true") {
if (Boolean.valueOf(this.project.getProjectProperties()."PROJECT.USES_POO")) {
sections."sec4s2s2" = [
usesPoo : "true",
lowDescription : this.project.getProjectProperties()."PROJECT.POO_CAT.LOW",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
package org.ods.orchestration.usecase

import groovy.json.JsonSlurper
import groovy.util.logging.Log
import groovy.util.logging.Slf4j
import org.apache.commons.io.FileUtils
import org.junit.Rule
import org.junit.rules.TemporaryFolder
import org.ods.util.ILogger
import org.ods.services.ServiceRegistry
import spock.lang.Unroll

import org.ods.orchestration.service.DocGenService
import org.ods.orchestration.service.JiraService
import org.ods.orchestration.service.LeVADocumentChaptersFileService
import org.ods.orchestration.util.DocumentHistory
import org.ods.orchestration.util.MROPipelineUtil
import org.ods.orchestration.util.PDFUtil
import org.ods.orchestration.util.Project
import org.ods.orchestration.util.SortUtil
import org.ods.services.JenkinsService
import org.ods.services.NexusService
import org.ods.services.OpenShiftService
import org.ods.orchestration.service.*
import org.ods.orchestration.util.*
import org.ods.services.ServiceRegistry
import org.ods.util.ILogger
import org.ods.util.IPipelineSteps
import org.ods.util.Logger
import spock.lang.Unroll
import util.FixtureHelper
import util.SpecHelper

import javax.swing.text.Document
import java.nio.file.Files
import java.nio.file.NoSuchFileException

import static org.ods.orchestration.usecase.DocumentType.*
import static org.ods.orchestration.usecase.DocumentType.CFTP
import static org.ods.orchestration.usecase.DocumentType.CFTR
import static org.ods.orchestration.usecase.DocumentType.CSD
import static util.FixtureHelper.*

import util.*
import static org.ods.orchestration.usecase.DocumentType.DIL
import static org.ods.orchestration.usecase.DocumentType.DTP
import static org.ods.orchestration.usecase.DocumentType.DTR
import static org.ods.orchestration.usecase.DocumentType.IVP
import static org.ods.orchestration.usecase.DocumentType.IVR
import static org.ods.orchestration.usecase.DocumentType.OVERALL_DTR
import static org.ods.orchestration.usecase.DocumentType.OVERALL_TIR
import static org.ods.orchestration.usecase.DocumentType.RA
import static org.ods.orchestration.usecase.DocumentType.SSDS
import static org.ods.orchestration.usecase.DocumentType.TCP
import static org.ods.orchestration.usecase.DocumentType.TCR
import static org.ods.orchestration.usecase.DocumentType.TIP
import static org.ods.orchestration.usecase.DocumentType.TIR
import static org.ods.orchestration.usecase.DocumentType.TRC
import static util.FixtureHelper.createJUnitXMLTestResults
import static util.FixtureHelper.createProject
import static util.FixtureHelper.createProjectBuildEnvironment
import static util.FixtureHelper.createSockShopJUnitXmlTestResults

@Slf4j
class LeVADocumentUseCaseSpec extends SpecHelper {
Expand Down Expand Up @@ -1957,4 +1978,43 @@ class LeVADocumentUseCaseSpec extends SpecHelper {
true | CSD as String | "IN PROGRESS" | "2" || true
}

@Unroll
def "fillRASections update section sec4s2s2 according to project property PROJECT.USES_POO"() {
given:
def sections = ["sec4s2s2":[]]
def risks = [[:]]
def proposedMeasuresDesription = [[:]]
def low = "low"
def medium = "medium"
def high = "high"
def project = Mock(Project)
jiraUseCase = Spy(new JiraUseCase(project, steps, util, Mock(JiraService), logger))
usecase = Spy(new LeVADocumentUseCase(project, steps, util, docGen, jenkins, jiraUseCase, junit, levaFiles, nexus, os, pdf, sq, bbt, logger))

when:
usecase.fillRASections(sections, risks, proposedMeasuresDesription)

then:
project.getProjectProperties() >> [
"PROJECT.NON-GXP_EVALUATION" : "",
"PROJECT.USES_POO" : poo,
"PROJECT.POO_CAT.LOW" : low,
"PROJECT.POO_CAT.MEDIUM" : medium,
"PROJECT.POO_CAT.HIGH": high
]

and:
sections.sec4s2s2 == expectedResult

where:
poo | expectedResult
"true" | [usesPoo:"true", lowDescription:"low", mediumDescription:"medium", highDescription:"high"]
"false" | [:]
"TRUE" | [usesPoo:"true", lowDescription:"low", mediumDescription:"medium", highDescription:"high"]
"FALSE" | [:]
"invalidValue" | [:]
null | [:]
true | [usesPoo:"true", lowDescription:"low", mediumDescription:"medium", highDescription:"high"]
false | [:]
}
}
Loading