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

Enhanced Packaging process #262

Merged
merged 18 commits into from
Aug 2, 2024
Merged

Conversation

M-DLB
Copy link
Collaborator

@M-DLB M-DLB commented Jul 10, 2024

This PR contains various fixes and an enhancement to the error management in the script.

Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
@M-DLB M-DLB requested a review from dennis-behm July 10, 2024 07:40
Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@M-DLB can you please have a look to the additional comments, please?

}
} else {
println "*! Copying $container(${deployableArtifact.file}) could not be copied due to missing mapping. Packaging failed."
props.error = "true"
println "*! [ERROR] Copy failed: The file '$container(${deployableArtifact.file})' could not be copied due to missing mapping."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about?

Suggested change
println "*! [ERROR] Copy failed: The file '$container(${deployableArtifact.file})' could not be copied due to missing mapping."
println "*! [ERROR] Copy failed: The file '$container(${deployableArtifact.file})' could not be copied. No mapping found for last level qualifier in script configuration 'copyModeMap'. Please verify."

}
}
if (props.generateSBOM && props.generateSBOM.toBoolean() && !props.error) {
if (props.generateSBOM && props.generateSBOM.toBoolean() && rc < 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about

Suggested change
if (props.generateSBOM && props.generateSBOM.toBoolean() && rc < 1) {
if (props.generateSBOM && props.generateSBOM.toBoolean() && rc == 0) {

rc = runProcess(processCmd, new File(props.workDir))
assert rc == 0 : "Failed to append $logPattern."
processRC = runProcess(processCmd, new File(props.workDir))
assert processRC == 0 : "Failed to append '$logPattern'."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the idea of rc to now properly run through the script and avoid Assert Exceptions?

@@ -742,10 +751,12 @@ def relativizePath(String path) {
class DeployableArtifact {
private final String file;
private final String deployType;
private final Boolean zFSArtifact;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's odd to see zFSArtifact, I assume if this is false, it assumes to be a PDS member?

What if you introduce a String objectType that can be zFSArtifact, PDS-MEMBER, SEQ-Dataset ... So, it allows a bit more flexibility for additional objects, that we want to package in the future.

@@ -755,7 +766,7 @@ class DeployableArtifact {
}

public boolean equals(DeployableArtifact other) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This misses a method description.

Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the rc logic, should we now rework a bit the section starting in line 688 as well, instead of throwing AssertionErrors?

@@ -665,7 +660,7 @@ def parseInput(String[] cliArgs){
}

if(opts.t == false) {
println("*! Error: tarFilename is only optional when no build report order is specified")
println("*! [ERROR] tarFilename is only optional when no build report order is specified")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println("*! [ERROR] tarFilename is only optional when no build report order is specified")
println("*! [VALIDATION-ERROR] tarFilename is only optional when no build report order is specified")

@@ -665,7 +660,7 @@ def parseInput(String[] cliArgs){
}

if(opts.t == false) {
println("*! Error: tarFilename is only optional when no build report order is specified")
println("*! [ERROR] tarFilename is only optional when no build report order is specified")
System.exit(3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this should used rc, right? And there are a couple of more exits in the validation .

Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
@M-DLB M-DLB requested a review from dennis-behm July 12, 2024 11:45
Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @M-DLB, thanks for the fixes. Some additional comment and suggestions.

Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved

props = parseInput(args)

def startTime = new Date()
// Just printing the Usage and exiting
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add that into the parseInput method

Pipeline/PackageBuildOutputs/PackageBuildOutputs.groovy Outdated Show resolved Hide resolved
M-DLB and others added 11 commits July 12, 2024 16:29
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @M-DLB

@dennis-behm dennis-behm merged commit ece76fb into IBM:main Aug 2, 2024
1 check failed
@M-DLB M-DLB deleted the feature/upliftPackagingScript branch August 29, 2024 06:55
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

Successfully merging this pull request may close these issues.

2 participants