Add support for temporary repositories used for staging for Archiva
Creating a repository where the users can deploy their artifacts and once the testing tasks are completed user can deploy the artifact to the common place where the we can use those artifacts as dependencies in pom files or remove the artifact from the temporary repository if it fails during the testing phase.
Apache archiva is a repository management system where we can deploy our artifacts to a common location and later on we can make use those artifacts (jar files) in our projects by adding the artifacts as dependencies in the POM file.But here there is no any separate place to deploy the artifacts which are not tested yet and also the artifacts of an ongoing project(modules).So we need to deploy them in to the common location where the official artifacts are deployed.So there can be some issues due to use of those artifacts as dependencies in our projects since they are not properly tested.
So here my idea is to create a separate place (repositories) where the registered user can deploy the staging artifacts.Those artifacts are not visible to common users.Once the testing task is completed(ready for the public deployment) we can either merge in to the common place where others can make use of those artifacts or remove from the staging artifact(if it fails).
First i would like to give a brief introduction about my approach to adding the staging repository feature.
Adding a Staging Repository
currently archiva has two permanent repositories called internal and the snapshot. Here my idea is to propose intermediate staging repository to deploy artifacts which have been not tested yet. It is the archiva user's task to create this permanent staging repository and attached it for a selected repository. Following example will illustrate that scenario.
Lets say user has a repository called “data_repo” and he needs to get the support of staging repository. Then he has to create staging repository instance called “data_repo_stage” and he can attached this stage repository to his main repository called “data_repo”.(hope to offer this function through the web interface).Here user can add more than one stage repositories so that simultaneous releasing function will support. Promotion is done through the following path.
data_repo_stage >>> data_repo
I think in the stage repository we should limit the access. Nobody should allow to download the artifacts in the staging repositories other than the developers,QA people, archiva admin user ,and the the guy who have the permission for the promotion.
I think it is the repository manager's task to create the stage repositories and attach it to the main repository that he want to add the staging functionality.
Creating Roles for this staging repository
Read and Write access to the repository
Here registered users can read and write artifacts to the repository. Here registered users mean developers and the QA people.Here developers should have both read and write access while the QA guys have only the read access. Also QA guys should be able to mark the artifact as success one or a failure on. Then it will be useful for the merging part to take a correct decision.
Promotion the Artifacts(merging to the common place)
This is the most important part in this project. Once the testing tasks are done this role is responsible for merge artifacts from staging repository to the internal repository or the snapshot repository. It depends on the artifact(snapshot or a version).Here i am going to consider following things regarding the merging the artifacts
If the artifacts that are going to deploy is not an existing one(new one) just deploy it with creating new meta data file. (user should me able to merge the artifact bu clicking the merge button and then should receive to success/failure message from the archiva side)
If the artifact is an existing one(latest version) we need to provide following options.
when the user clicks merge button it should notify the user about the older versions in the release repository.(eg : version numbers + updated date)
then we need to suggest him following options.
- merging the artifact while keeping the older version
- merging the artifact while removing the older version. Here we should only allow to remove latest artifact.
Eg : in the main repo we have versions 1.1, 1.2, 1.3.And we are going to merge version 1.4.If there are significant changes in version 1.3 and version 1.4 it is better to keep 1.3 version and add 1.4.
But if there are no significant changes in both artifacts then it is better to remove the version 1.3 and add 1.4.
Mean while meta data updating also should be done.
In above I have mentioned only the success scenario of a artifact. There can be a fail scenario as well. If an artifact is failed then the user should manually delete the artifact
- adding a default staging repository and assign the all permissoin configurations of that repository to the admin user
- restricted this staging repository from being using as a plugging repository from out user as mentioned in above in the pom.xml files
- implementing the read action and the write actions and assign them to the developer(role)and the QA person(role) as mentioned in above.
- Testing the roles(developer) with the staging repository.
- implementing the promotion role.(only the merging based on the assumption that new artifact is being deployed.Not a update version)
- implement the logs and make use them for the searching algorithm to check the older versions of the artifacts which have already deployed.
- add searching feature(action) to the promotion role and do the merging part by providing the options regarding the version as mentioned above.
- implementing logs for staging repository