Skip to content

Commit

Permalink
Add validation of reporting prereqs (#459)
Browse files Browse the repository at this point in the history
* Add validation of reporting prereqs

Signed-off-by: Dennis Behm <[email protected]>
  • Loading branch information
dennis-behm authored Dec 14, 2023
1 parent c8a9d08 commit b5d0038
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,8 @@ def createBuildList() {
}

// Perform analysis and build report of external impacts
if (props.reportExternalImpacts && props.reportExternalImpacts.toBoolean()){
// Prereq: Metadatastore Connection
if (metadataStore && props.reportExternalImpacts && props.reportExternalImpacts.toBoolean()){
if (buildSet && changedFiles) {
println "** Perform analysis and reporting of external impacted files for the build list including changed files."
reportingUtils.reportExternalImpacts(buildSet.plus(changedFiles))
Expand All @@ -674,7 +675,8 @@ def createBuildList() {
}

// Document and validate concurrent changes
if (props.reportConcurrentChanges && props.reportConcurrentChanges.toBoolean()){
// Prereq: Workspace containing git repos. Skipped for --userBuild build type
if (!props.userBuild && props.reportConcurrentChanges && props.reportConcurrentChanges.toBoolean()){
println "** Calculate and document concurrent changes."
reportingUtils.calculateConcurrentChanges(buildSet)
}
Expand Down
6 changes: 4 additions & 2 deletions utilities/ReportingUtilities.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,15 @@ def calculateConcurrentChanges(Set<String> buildSet) {

// initialize patterns
List<Pattern> gitRefMatcherPatterns = createMatcherPatterns(props.reportConcurrentChangesGitBranchReferencePatterns)

// obtain all current remote branches
// TODO: Handle / Exclude branches from other repositories
Set<String> remoteBranches = new HashSet<String>()
props.applicationSrcDirs.split(",").each { dir ->
dir = buildUtils.getAbsolutePath(dir)
remoteBranches.addAll(gitUtils.getRemoteGitBranches(dir))
if (gitUtils.isGitDir(dir)) {
remoteBranches.addAll(gitUtils.getRemoteGitBranches(dir))
}
}

// Run analysis for each remoteBranch, which matches the configured criteria
Expand Down

0 comments on commit b5d0038

Please sign in to comment.