Skip to content

Commit

Permalink
tolerate empty promote tar for new release
Browse files Browse the repository at this point in the history
Signed-off-by: MarkAckert <[email protected]>
  • Loading branch information
MarkAckert committed Oct 1, 2024
1 parent 0b15b06 commit 9338ee8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion validate/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10904,7 +10904,17 @@ if (validateSMPEPromoteTar) {
buildNum
)
logValidate(`>>[validate 6/17]>> Found SMP/e promote tar ${smpePromoteTar['path']}.`)
core.exportVariable('SMPE_PTF_PROMOTE_TAR_PATH', smpePromoteTar['path'])
if (smpePromoteTar['size'] > 0 ) {
core.exportVariable('SMPE_PTF_PROMOTE_TAR_PATH', smpePromoteTar['path'])
} else {
// this can be size 0 in the case of new major releases, 2.0.0, 3.0.0, 4.0.0, where it's OK to ignore it
if (semver.valid(releaseVersion) && semver.minor(releaseVersion) === 0 && semver.patch(releaseVersion) === 0) {
logValidate(`>>[validate 6/17]>> Ignoring empty SMP/e promote TAR due to new major version release.`)
} else {
// we should never hit this branch, but if we do it's an error condition. This won't be hit for nightly builds.
throw new Error('Unexpected empty SMP/e promote TAR, and this is not a new major version release');
}
}
}
catch (e2) {
throw new Error(`no SMP/e promote tar found in the build`)
Expand Down
12 changes: 11 additions & 1 deletion validate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,17 @@ if (validateSMPEPromoteTar) {
buildNum
)
logValidate(`>>[validate 6/17]>> Found SMP/e promote tar ${smpePromoteTar['path']}.`)
core.exportVariable('SMPE_PTF_PROMOTE_TAR_PATH', smpePromoteTar['path'])
if (smpePromoteTar['size'] > 0 ) {
core.exportVariable('SMPE_PTF_PROMOTE_TAR_PATH', smpePromoteTar['path'])
} else {
// this can be size 0 in the case of new major releases, 2.0.0, 3.0.0, 4.0.0, where it's OK to ignore it
if (semver.valid(releaseVersion) && semver.minor(releaseVersion) === 0 && semver.patch(releaseVersion) === 0) {
logValidate(`>>[validate 6/17]>> Ignoring empty SMP/e promote TAR due to new major version release.`)
} else {
// we should never hit this branch, but if we do it's an error condition. This won't be hit for nightly builds.
throw new Error('Unexpected empty SMP/e promote TAR, and this is not a new major version release');
}
}
}
catch (e2) {
throw new Error(`no SMP/e promote tar found in the build`)
Expand Down

0 comments on commit 9338ee8

Please sign in to comment.