Hi, There were few issues in PCA related to artifact distribution; - If an artifact is deleted PCA fails to push the delete commit to remote repo because checkout job gets executed first causing deleted file to bepulled again - When cloning the Git repo, PCA will delete the whole directory in repository.path causing potential data losses. It could affect the application process running in the cartridge instance since some required files may get removed at the server startup
Few improvements were made to resolve these issues. - Now PCA will run the commit job first. If the Git clone has not been done it will skip in that iteration. - When Git checkout job is running, if there are any modifications in the working directory, checkout job will be skipped, allowing commit job to push those changes to remote repo first. Earlier when running the checkout job PCA will do a "git reset --hard" causing all modifications to vanish thus leading to potential data losses. - When commit job is running it will stage all untracked files and commit the changes and do a "git pull --rebase" before pushing to remote repo. This will resolve any possible conflicts with the remote repo to a certain level. - PCA will now clone the remote repo to a temporary location first instead of directly cloning at repository path. After clone is complete it will move all the files to repository path overwriting any existing files. The priority will be given to remote repo. This will avoid any potential problems that could arise because of missing artifacts when starting up the application process. Also I've written an integration test to PCA to cover these scenarios. It will assert whether a file gets removed from the remote repo when it is deleted locally. JIRAs can be found at [1] and [2]. Please try it out and let me know your thoughts. [1] https://issues.apache.org/jira/browse/STRATOS-1566 [2] https://issues.apache.org/jira/browse/STRATOS-1568 Thanks. -- Akila Ravihansa Perera WSO2 Inc.; http://wso2.com/ Blog: http://ravihansa3000.blogspot.com