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

Strategy to record logical files but skip scanning them #308

Merged
merged 25 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
99624f6
Merge pull request #256 from IBM/develop
drbruce-git Oct 17, 2022
83fbf19
Merge pull request #300 from IBM/zappbuild_301
dennis-behm Dec 16, 2022
be0b0fa
Introduce a method to record files as logicalFiles but skip scanning
dennis-behm Jan 10, 2023
875ce3c
property not relevant
dennis-behm Jan 11, 2023
b55c42b
set file extension as language for logical files
dennis-behm Jan 11, 2023
fcf900d
Merge remote-tracking branch 'upstream/develop' into
dennis-behm Jan 16, 2023
9c54dfb
minor README updates
dennis-behm Jan 16, 2023
8997ca5
Include reviewer feedback to keep it in a comment.
dennis-behm Jan 16, 2023
e2bfa98
Belongs to Merge commit of upstream/develop
dennis-behm Jan 16, 2023
5a649f0
Merge pull request #294 from IBM/develop
dennis-behm Mar 7, 2023
5b4fc97
Merge remote-tracking branch 'upstream/develop' into 200_skipscanning…
dennis-behm Mar 15, 2023
cff561b
Use DependencyScannerRegistry rather than a new mapping
dennis-behm Mar 15, 2023
27cde19
Updated readme
dennis-behm Mar 16, 2023
1098cab
skip configuration of dependency scanner configuration rather then
dennis-behm Mar 16, 2023
020f587
minor wording
dennis-behm Mar 16, 2023
5742e39
Use dependency scanner helper
dennis-behm Mar 31, 2023
6e0e847
updated readme.md
dennis-behm Mar 31, 2023
dc428ae
fix variable name
dennis-behm Apr 5, 2023
85e0df0
Merge pull request #354 from IBM/develop
dennis-behm May 15, 2023
c0abcb5
move from JSON to a string representation of the scanner mapping
dennis-behm May 22, 2023
b5c00a5
Merge remote-tracking branch 'upstream/main' into
dennis-behm May 22, 2023
e01bfe4
Cleanup of languageHint settings
dennis-behm May 26, 2023
06975fb
remove scanner mapping
dennis-behm May 26, 2023
abaadae
renamed utility reference for better readability
dennis-behm May 30, 2023
3168c0c
reorganize the location where to store build and default app config
dennis-behm May 31, 2023
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
27 changes: 18 additions & 9 deletions build-conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,32 @@ Property | Description
--- | ---
buildPropFiles | Comma separated list of additional build property files to load. Supports both absolute and relative file paths. Relative paths assumed to be relative to `zAppBuild/build-conf/`.
buildListFileExt | File extension that indicates the build file is really a build list.
languagePropertyQualifiers | List of language script property qualifiers. Each language script property has a unique qualifier to avoid collision with other language script properties.
applicationConfRootDir | Alternate root directory for application-conf location. Allows for the deployment of the application-conf directories to a static location. Defaults to ${workspace}/${application}
gitRepositoryCompareService | Service URL for the Git provider to record a link to the git provider for a visual comparision of two hashes
requiredDBBToolkitVersion | Minimum required DBB ToolkitVersion to run this version of zAppBuild.
requiredBuildProperties | Comma separated list of required build properties for zAppBuild/build.groovy. Build and language scripts will validate that *required* build properties have been set before the script runs. If any are missing or empty, then a validation error will be thrown.
formatConsoleOutput | Flag to log output in table views instead of printing raw JSON data
impactBuildOnBuildPropertyChanges | Boolean property to activate impact builds on changes of build properties within the application repository
impactBuildOnBuildPropertyList | List of build property lists referencing which language properties should cause an impact build when the given property is changed
continueOnScanFailure | Determine the behavior when facing a scanner failure. true (default) to continue scanning. false will terminate the process.
createBuildOutputSubfolder | Option to create a subfolder with the build label within the build output dir (outDir). Default: true.
documentDeleteRecords | Option determine if the build framework should document deletions of outputs in DBB Build Report. Default: false. Requires DBB Toolkit 1.1.3 and higher.
generateDb2BindInfoRecord | Flag to control the generation of a generic DBB build record for a build file to document the configured db2 bind information (application-conf/bind.properties). Default: false ** Can be overridden by a file property.
dbb.file.tagging | Controls compile log and build report file tagging. Default: true.
dbb.LinkEditScanner.excludeFilter | DBB configuration property used by the link edit scanner to exclude load module entries
metadataStoreType | DBB MetadataStore Type configuration property. Valid options are 'file' or 'db2'. Default: file
metadataStoreFileLocation | DBB File MetadataStore location. Default: $USER
metadataStoreDb2Url | DBB configuration property for Db2 URL. ***Can be overridden by build.groovy option -url, --url***
metadataStoreDb2ConnectionConf | DBB configuration property for Db2 configuration properties file.
dbb.gateway.type | DBB configuration property to determine which gateway type is used for the build process
dbb.gateway.procedureName | Interactive gateway Procedure Name
dbb.gateway.accountNumber | Interactive gateway Account Number
dbb.gateway.groupId | Interactive gateway Group ID
dbb.gateway.regionSize | Interactive gateway Region Size
dbb.gateway.logLevel | Interactive gateway Log Level
dbb.scannerMapping | DBB PropertyMapping specifying the scanner implementation to be used
continueOnScanFailure | Determine the behavior when facing a scanner failure. true (default) to continue scanning. false will terminate the process.
createBuildOutputSubfolder | Option to create a subfolder with the build label within the build output dir (outDir). Default: true.
buildOutputTSformat | Defines the build timestamp format for build output subfolder and build label.
formatConsoleOutput | Flag to log output in table views instead of printing raw JSON data on verbose output
generateDb2BindInfoRecord | Flag to control the generation of a generic DBB build record for a build file to document the configured db2 bind information (application-conf/bind.properties). Default: false ** Can be overridden by a file property.
generateDb2BindInfoRecordProperties | Comma-separated list of the bind parameters to be added to the DBB build record.
impactBuildOnBuildPropertyChanges | Boolean property to activate impact builds on changes of build properties within the application repository
impactBuildOnBuildPropertyList | List of build property lists referencing which language properties should cause an impact build when the given property is changed
documentDeleteRecords | Option determine if the build framework should document deletions of outputs in DBB Build Report. Default: false.
dbb.LinkEditScanner.excludeFilter | DBB configuration property used by the link edit scanner to exclude load module entries

### dependencyReport.properties
Properties used by the impact utilities to generate a report of external impacted files
Expand Down
182 changes: 98 additions & 84 deletions build-conf/build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Build properties used by build.groovy
#######################################################################
# build.properties configuration to specify
#
# - global build properties for zAppBuild
# - global default application properties
#
#######################################################################


#######################################################################
# Global build properties used by zappbuild
#

#
# Comma separated list of additional build property files to load
Expand All @@ -9,12 +20,6 @@ buildPropFiles=datasets.properties,dependencyReport.properties,Assembler.propert
# file extension that indicates the build file is really a build list or build list filter
buildListFileExt=txt

#
# Service URL for the Git provider to have a visual comparision of two hashes
# Leveraged as a build result property <props.gitRepositoryURL>/compare/
# samples: GitHub : /compare/ ; GitLab : /-/compare/
gitRepositoryCompareService=/compare/

#
# Alternate root directory for application-conf locations. Allows for the deployment of
# the application-conf directories to an alternate location rather in the application repository.
Expand Down Expand Up @@ -42,96 +47,28 @@ gitRepositoryCompareService=/compare/
# Defaults to ${workspace}
applicationConfRootDir=

#
# Service URL for the Git provider to have a visual comparision of two hashes
# Leveraged as a build result property <props.gitRepositoryURL>/compare/
# samples: GitHub : /compare/ ; GitLab : /-/compare/
gitRepositoryCompareService=/compare/

#
# Minimum required DBB ToolkitVersion to run this version of zAppBuild
# Build initialization process validates the DBB Toolkit Version in use and matches that against this setting
# Build initialization process validates the DBB Toolkit Version in use and matches that against this setting
requiredDBBToolkitVersion=2.0.0

#
# Comma separated list of required build properties for zAppBuild/build.groovy
requiredBuildProperties=buildOrder,buildListFileExt

#
# Flag to log output in table views instead of printing raw JSON data
# default = false
formatConsoleOutput=false

#
# impactBuildOnBuildPropertyChanges controls if impact calculation should analyze
# build property changes for COBOL, PLI, ASM.
# default = false
impactBuildOnBuildPropertyChanges=false

#
# list of build property lists referencing which language properties should cause an impact build when the given property is changed
# properties need to be managed in property files within the application repository to detect the change; applies only to impact builds
# general pattern: langPrefix_impactPropertyList, optional: langPrefix_impactPropertyListCICS and langPrefix_impactPropertyListSQL
impactBuildOnBuildPropertyList=[${assembler_impactPropertyList},${assembler_impactPropertyListCICS},${assembler_impactPropertyListSQL},${bms_impactPropertyList},${cobol_impactPropertyList},${cobol_impactPropertyListCICS},${cobol_impactPropertyListSQL},${dbdgen_impactPropertyList},${linkedit_impactPropertyList},${mfs_impactPropertyList},${pli_impactPropertyList},${pli_impactPropertyListCICS},${pli_impactPropertyListSQL},${psbgen_impactPropertyList}]

# createTestcaseDependency controls if a dependency should be set up between the testcase
# and the corresponding application program. If this property set to true, a dependency
# to the program is created for the testcase, which is then impacted by a change
# of the program. In this case, the testcase is recompiled everytime the program is modified.
# When set to false, the testcase is not impacted by the change of the program.
# Default: false
createTestcaseDependency=false

# generateDb2BindInfoRecord controls if zAppBuild generates a generic DBB build record for a build file
# to document the configured db2 bind options (application-conf/bind.properties) .
# This allows to pass the information into the packaging step and on to your deployment manager, like UCD.
# Implemented in Assembler.groovy, Cobol.groovy and PLI.groovy
# See also generateDb2BindInfoRecordProperties for the list of properties which are documented
# Default: false
generateDb2BindInfoRecord=false

# generateDb2BindInfoRecordProperties is a comma-separated list of existing bind parameters configured to zAppBuild.
# See application-conf/bind.properties for available properties.
generateDb2BindInfoRecordProperties=bind_collectionID,bind_packageOwner,bind_qualifier

# dbb.file.tagging controls compile log and build report file tagging. If true, files
# written as UTF-8 or ASCII are tagged.
# If the environment variable _BPXK_AUTOCVT is set ALL, file tagging may have an
# adverse effect if viewing log files and build report via Jenkins.
# In this case, set dbb.file.tagging to false or comment out the line. Default: true
dbb.file.tagging=true

# Set filter used to exclude certain information from the link edit scanning.
# The value contains a comma separated list of patterns.
# example: A filter of *.SUB1, *.SUB2 will exclude modules SUB1 and SUB2
# from any dataset. To exclude member HELLO in PDS TEST.ASM will
# be matched by the pattern TEST.ASM.HELLO. The pattern TEST.ASM.*
# will match any member in the data set TEST.COBOL.
# The following filter excludes CICS and LE Library references.
dbb.LinkEditScanner.excludeFilter = ${SDFHLOAD}.*, ${SCEELKED}.*

#
# Determine the behavior when facing a scanner failure
# 'true' proceeds with the build and report the a warning (default)
# 'false' will terminate the build process
continueOnScanFailure=true

#
# Determine if a subfolder with a timestamp should be created in the buildOutDir location.
# Applies to all build types except userBuild
# Default: true
createBuildOutputSubfolder=true

#
# Build Timestamp Format
# Applies to all build types except userBuild
# Default: yyyyMMdd.HHmmss.mmm - See Date format method pattern strings
buildOutputTSformat=yyyyMMdd.HHmmss.mmm

#
# Flag to determine if the build framework should document deletions of outputs in DBB Build Report
# for build files being mapped to language scripts
#
# Requires the DBB toolkit 1.1.3 or higher. Backward compatibility of zAppBuild is preserved,
# when feature is turned off
#
# Default : false
documentDeleteRecords=false

# MetadataStore configuration properties:

# select MetadataStore configuration (either 'file' or 'db2')
Expand All @@ -145,12 +82,12 @@ metadataStoreType=file
#metadataStoreDb2Url=jdbc:db2:<Db2 server location>

# Db2 connection configuration property file
# Sample is povided at $DBB_HOME/conf/db2Connection.conf
# Sample is povided at $DBB_HOME/conf/db2Connection.conf
#metadataStoreDb2ConnectionConf=


# The dbb.gateway.type property determines which gateway type is used for the entire build process
# Possible values are 'legacy' and 'interactive. Default if not indicated is 'legacy'
# Possible values are 'legacy' and 'interactive'. Default if not indicated is 'legacy'
dbb.gateway.type=legacy

# Procedure Name - specified with the procname parameter
Expand All @@ -173,3 +110,80 @@ dbb.gateway.regionSize=
# 16 - Log information to the system console
dbb.gateway.logLevel=2



#######################################################################
# Global default application properties used by zappbuild
# if not overridden by settings in the /application-conf directory

#
# Determine the behavior when facing a scanner failure
# 'true' proceeds with the build and report the a warning (default)
# 'false' will terminate the build process
continueOnScanFailure=true

#
# Determine if a subfolder with a timestamp should be created in the buildOutDir location.
# Applies to all build types except userBuild
# Default: true
createBuildOutputSubfolder=true

#
# Build Timestamp Format
# Applies to all build types except userBuild
# Default: yyyyMMdd.HHmmss.mmm - See Date format method pattern strings
buildOutputTSformat=yyyyMMdd.HHmmss.mmm

#
# Flag to log output in table views instead of printing raw JSON data
# default = false
formatConsoleOutput=false

# createTestcaseDependency controls if a dependency should be set up between the testcase
# and the corresponding application program. If this property set to true, a dependency
# to the program is created for the testcase, which is then impacted by a change
# of the program. In this case, the testcase is recompiled everytime the program is modified.
# When set to false, the testcase is not impacted by the change of the program.
# Default: false
createTestcaseDependency=false

# generateDb2BindInfoRecord controls if zAppBuild generates a generic DBB build record for a build file
# to document the configured db2 bind options (application-conf/bind.properties) .
# This allows to pass the information into the packaging step and on to your deployment manager, like UCD.
# Implemented in Assembler.groovy, Cobol.groovy and PLI.groovy
# See also generateDb2BindInfoRecordProperties for the list of properties which are documented
# Default: false
generateDb2BindInfoRecord=false

# generateDb2BindInfoRecordProperties is a comma-separated list of existing bind parameters configured to zAppBuild.
# See application-conf/bind.properties for available properties.
generateDb2BindInfoRecordProperties=bind_collectionID,bind_packageOwner,bind_qualifier

#
# impactBuildOnBuildPropertyChanges controls if impact calculation should analyze
# build property changes for COBOL, PLI, ASM.
# default = false
impactBuildOnBuildPropertyChanges=false

#
# list of build property lists referencing which language properties should cause an impact build when the given property is changed
# properties need to be managed in property files within the application repository to detect the change; applies only to impact builds
# general pattern: langPrefix_impactPropertyList, optional: langPrefix_impactPropertyListCICS and langPrefix_impactPropertyListSQL
impactBuildOnBuildPropertyList=[${assembler_impactPropertyList},${assembler_impactPropertyListCICS},${assembler_impactPropertyListSQL},${bms_impactPropertyList},${cobol_impactPropertyList},${cobol_impactPropertyListCICS},${cobol_impactPropertyListSQL},${dbdgen_impactPropertyList},${linkedit_impactPropertyList},${mfs_impactPropertyList},${pli_impactPropertyList},${pli_impactPropertyListCICS},${pli_impactPropertyListSQL},${psbgen_impactPropertyList}]


# Set filter used to exclude certain information from the link edit scanning.
# The value contains a comma separated list of patterns.
# example: A filter of *.SUB1, *.SUB2 will exclude modules SUB1 and SUB2
# from any dataset. To exclude member HELLO in PDS TEST.ASM will
# be matched by the pattern TEST.ASM.HELLO. The pattern TEST.ASM.*
# will match any member in the data set TEST.COBOL.
# The following filter excludes CICS and LE Library references.
dbb.LinkEditScanner.excludeFilter = ${SDFHLOAD}.*, ${SCEELKED}.*

#
# Flag to determine if the build framework should document deletions of outputs in DBB Build Report
# for build files being mapped to language scripts
#
# Default : false
documentDeleteRecords=false
5 changes: 5 additions & 0 deletions build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import groovy.cli.commons.*
@Field def buildUtils= loadScript(new File("utilities/BuildUtilities.groovy"))
@Field def impactUtils= loadScript(new File("utilities/ImpactUtilities.groovy"))
@Field def filePropUtils= loadScript(new File("utilities/FilePropUtilities.groovy"))
@Field def depScannerUtils= loadScript(new File("utilities/DependencyScannerUtilities.groovy"))
M-DLB marked this conversation as resolved.
Show resolved Hide resolved
@Field String hashPrefix = ':githash:'
@Field String giturlPrefix = ':giturl:'
@Field String gitchangedfilesPrefix = ':gitchangedfiles:'
Expand Down Expand Up @@ -202,6 +203,10 @@ def initializeBuildProcess(String[] args) {

// verify/create/clone the collections for this build
impactUtils.verifyCollections()

// loading the scanner mapping to fill the DependencyScannerRegistry
depScannerUtils.populateDependencyScannerRegistry()

}

/*
Expand Down
2 changes: 1 addition & 1 deletion samples/MortgageApplication/application-conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Location of file properties, script mappings and file level property overrides.
Property | Description
--- | ---
dbb.scriptMapping | DBB configuration file properties association build files to language scripts
dbb.scannerMapping | DBB scanner mapping to overwrite the file scanner. File property
dbb.scannerMapping | zAppBuild configuration to map files extensions to DBB dependency scanner configurations
cobol_testcase | File property to indicate a generated zUnit cobol test case to use a different set of source and output libraries

### BMS.properties
Expand Down
20 changes: 20 additions & 0 deletions samples/MortgageApplication/application-conf/file.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ dbb.scriptMapping = Cobol.groovy :: **/*.cbl
dbb.scriptMapping = LinkEdit.groovy :: **/*.lnk
dbb.scriptMapping = PLI.groovy :: **/*.pli

#
# dbb.scannerMapping to map files extensions to DBB dependency scanner configurations
#
# this maps file extensions to scanner configuration for the DBB dependency scanners
# also see:
# https://www.ibm.com/docs/api/v1/content/SS6T76_2.0.0/javadoc/com/ibm/dbb/dependency/DependencyScannerRegistry.html
#
# Schema
# {"scannerClass":"ScannerImplementation" : "languageHint":"DBBScannerHint" } :: comma separated list of file extensions
#
# Note - if an extension of a build file is not specified in the mapping,
# zAppBuild will skip scanning the file and only record a LogicalFile without capturing dependencies.
#
dbb.scannerMapping = {"scannerClass":"DependencyScanner", "languageHint":"COB"} :: cbl,cpy,cob
dbb.scannerMapping = {"scannerClass":"DependencyScanner", "languageHint":"C"} :: c, h
dbb.scannerMapping = {"scannerClass":"DependencyScanner", "languageHint":"ASM"} :: asm, mac
dbb.scannerMapping = {"scannerClass":"DependencyScanner", "languageHint":"CPP"} :: cpp, hpp
dbb.scannerMapping = {"scannerClass":"DependencyScanner", "languageHint":"PLI"} :: pli, inc
dbb.scannerMapping = {"scannerClass":"ZUnitConfigScanner", "languageHint":""} :: bzucfg

M-DLB marked this conversation as resolved.
Show resolved Hide resolved
#
# Need to build epsnbrvl.cbl first during cobol builds
cobol_fileBuildRank = 1 :: **/cobol/epsnbrvl.cbl
Expand Down
2 changes: 1 addition & 1 deletion samples/application-conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Location of file properties, script mappings and file-level property overrides.
Property | Description
--- | ---
dbb.scriptMapping | DBB configuration file properties association build files to language scripts
dbb.scannerMapping | DBB scanner mapping to overwrite the file scanner. File property
dbb.scannerMapping | zAppBuild configuration to map files extensions to DBB dependency scanner configurations
isSQL | File property overwrite to indicate that a file requires to include SQL parameters
isCICS | File property overwrite to indicate that a file requires to include CICS parameters
isMQ | File property overwrite to indicate that a file requires to include MQ parameters
Expand Down
Loading