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

HowTo - Modify records created by zAppbuild at runtime #281

Closed
FALLAI-Denis opened this issue Nov 13, 2022 · 2 comments
Closed

HowTo - Modify records created by zAppbuild at runtime #281

FALLAI-Denis opened this issue Nov 13, 2022 · 2 comments

Comments

@FALLAI-Denis
Copy link

Hi,

I need is to manage the current construction report and to access the EXECUTE record of a step (MVSExec), either to remove attributes from this record, or to add attributes to this record, (and in particular the outputs attribute).
For this I need to find this particular record in the construction report: no direct acces for this.

I can find this record with the buildReport.getRecords() method and by filtering the list to isolate the desired EXECUTE record but then I have no method to modify the record, and in particular to delete all or part of the Outputs of the EXECUTE record.

Is there a way to intervene on a (EXECUTE) record created by zAppbuild before the build report is saved in the DBB Collections?

@dennis-behm
Copy link
Member

@FALLAI-Denis ,

the BuildReport is stored/persisted at the end of the build process :

dbb-zappbuild/build.groovy

Lines 692 to 709 in 99624f6

// save json file
println "** Writing build report data to ${jsonOutputFile}"
buildReport.save(jsonOutputFile, buildReportEncoding)
// create build report html file
def htmlOutputFile = new File("${props.buildOutDir}/BuildReport.html")
println "** Writing build report to ${htmlOutputFile}"
buildReport.generateHTML(htmlOutputFile)
// attach build report & result
if (metadataStore) {
buildReport.save(jsonOutputFile, buildReportEncoding)
// Save build report & build report data
buildResult.setBuildReport(new FileInputStream(htmlOutputFile))
buildResult.setBuildReportData(new FileInputStream(jsonOutputFile))
println "** Updating build result BuildGroup:${props.applicationBuildGroup} BuildLabel:${props.applicationBuildLabel}"
}

You should be able to obtain the BuildReport through the BuildReportFactory and even make updates to it before saving the BuildResult .

The CreateUCDComponentVersion script for example is removing outputs without a deployType or when the type is ZUNIT on a BuildReport object.

Persisting information is controlled via the report(true) and deployType('DBRM') options. I think you have opened another thread which is talking about your issue on the ibm/dbb repository (if I am not mistaken). Assuming this is the same area, you have two options:

  1. Modify the BuildReport, see above OR
  2. Skip documenting the DBRM in the scripts but invoke when needed an additional MVSExec step, which just invokes an IEFBR14 but registers an output through the above API. I assume this to be "cheaper" than rescanning the expanded source for example.

@FALLAI-Denis
Copy link
Author

Hi @dennis-behm

Thanks for your response and your great help.

I apply same solution as CreateUCDComponentVersion script for removing unwanted output.
Works fine!
👍 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants