-
Notifications
You must be signed in to change notification settings - Fork 26
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
Iac 778 backup on clean environment throws exception #155
Iac 778 backup on clean environment throws exception #155
Conversation
@mtopchieva, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
e56e332
to
3cbcf1d
Compare
@mtopchieva, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
1 similar comment
@mtopchieva, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
3552fc1
to
030921a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to re-evaluate the reason behind backing up only the last version
@@ -178,8 +178,26 @@ public final List<Package> importAllPackages(final List<Package> vroPackages, fi | |||
String backupFilePath = this.createBackupFilePath(pkg, currentDateTimeString, backupFilesDirectory); | |||
|
|||
try { | |||
pkg.setFilesystemPath(backupFilePath); | |||
restClient.exportPackage(pkg, dryrun, exportConfigAttributeValues, exportConfigSecureStringValues); | |||
System.out.println("Package for back up: " + pkg.getFQName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please user the logger object to send information instead of system.out?
restClient.exportPackage(highestVersionPac, dryrun, exportConfigAttributeValues, exportConfigSecureStringValues); | ||
|
||
} else { | ||
System.out.println("Package with name: " + pkg.getName() + " does not exist in vRO and backup is skipped."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please user the logger object to send information instead of system.out?
} else { | ||
System.out.println("Package with name: " + pkg.getName() + " does not exist in vRO and backup is skipped."); | ||
|
||
} | ||
} catch (Exception ex) { | ||
String exceptionMessage = ex.getMessage(); | ||
System.out.println("ExceptionMessage: " + exceptionMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please user the logger object to send information instead of system.out?
} | ||
} | ||
|
||
System.out.println("Highest version package to backup: " + highestVersionPac.getFQName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please user the logger object to send information instead of system.out?
* @param packages the collection of packages differring by version | ||
* @return the package with highest version | ||
*/ | ||
private Package getHighestVersion(List<Package> packages) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to have only the latest versions backed up? We should be receiving backup of all versions, as Build Tools for VMware Aria - might have the cleanup flag enabled and delete some of the versions that we did not backed up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the discussion in the jira issue, this is what was finally agreed.
@mtopchieva, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
1 similar comment
@mtopchieva, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
60412c2
to
506aa52
Compare
This issue IAC-778 has been assigned with new scope (to backup all versions of a package, not just the highest one). It must be added before merging the PR. |
@mtopchieva, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
1 similar comment
@mtopchieva, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
28bbb22
to
a34ccc1
Compare
fa8d894
to
a01bb08
Compare
Signed-off-by: Aleksandar Kumanov <[email protected]>
a01bb08
to
8f3c697
Compare
Signed-off-by: Aleksandar Kumanov <[email protected]>
…re-aria into IAC-778-backup-on-clean-environment-throws-exception Signed-off-by: Aleksandar Kumanov <[email protected]>
Signed-off-by: Aleksandar Kumanov <[email protected]>
Signed-off-by: Aleksandar Kumanov <[email protected]>
} | ||
|
||
if (!samePackagesInDest.isEmpty()) { | ||
List<Package> allCurrentPkgVersions = this.getPackages(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that going to retrieve all packages available in vRO (including the system packages) or just the packages matching the one we try to import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is going to retrieve all packages and all of their versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, we need to update this - it needs to get all package versions, but only for the packages that we are trying to import (if existing packages are present on the env).
as example if we want to import com.vmware.pscoe.templates.buildtoolsforvmwareariasamples.xml-1.0.11-SNAPSHOT.package
, then we should be exporting any package that starts with com.vmware.pscoe.templates.buildtoolsforvmwareariasamples.xml
PS: Keep in mind that in the package name we CAN have dash. (so we first remove any -SNAPSHOT text, then get the last dash in the string and extract the package name based on this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, my bad I mixed up the context with another ticket. It is backing up all versions (existing in the environment) of the packages we are about to import including the dependencies as well.
Signed-off-by: Aleksandar Kumanov <[email protected]>
Signed-off-by: Aleksandar Kumanov <[email protected]>
Checklist
Fixed #XXX -
orClosed #XXX -
prefix to auto-close the issueTesting
Testing was done through a regular import of packages through the installer, with a flag in the 'environment.properties' file: 'vro_enable_backup=true'
Tests were performed by having a different set of packages and versions in the local VMware Aria Orchestrator instance, in order to validate that the highest available version per package name is backed up (in the 'vro' folder), or that if no versions are found for the package in vRO to back up, a message is logged that the back up for this package is skipped.