•  
      request #7384 Restore archived gitolite repositories from siteadmin
    Infos
    #7384
    Mohamed Amin Doghri (doghrim)
    2015-04-30 17:31
    2014-08-28 16:02
    6720
    Details
    Restore archived gitolite repositories from siteadmin
    Hello ,

    We want to allow siteadmin to restore deleted gitolite repositories already archived . (Archiving deleted repositories was announced in

    https://tuleap.net/plugins/tracker/?aid=7363 and we are doing internal code review for it.)
    Description of above feature :
    -In "Site Administration interface / Project administration section , user search for project
    -Click on [show pending documents] : it's better to change it to ([show pending items])
    -In "Pending deleted documents for project xxx" we will add "Deleted Git repositories" tab
    -In this section we will show the list of deleted Git repositories that are backuped.
    -For each one we will display :
    *It's name
    *Creation date
    *Created by (user name)
    *Deletion date
    *A button to restore the repository
    *A button to completely remove the repository from the staging area

    What do you think ?

    BR
    Amin
    enhancement
    SCM/Git
    Empty
    Empty
    Empty
    Stage
    Mohamed Amin Doghri (doghrim)
    Closed
    2015-04-30
    Attachments
    Empty
    References

    Follow-ups

    • User avatar
      • Status changed from Under review to Closed
      • Close date set to 2015-04-30
    • User avatar
      last edited by: dylan bowden (dylan) 4 years ago
      Integrated in Tuleap 8.0.99.24 and Tuleap 8.0.99.25

      see also gerrit #3772
    • User avatar
      Hi,

      Any update please ?

      Thanks
    • User avatar
      Hi,

      we have an idea to solve the possible concurrency issue. I'm going to write a changeset on top of yours that will modify things as follows.

      1. As codendiadm
      2. chgrp gitolite backup.tar.gz -> this changes the group so that gitolite has rights on the file. - use System_Command::exec().
      3. As gitolite
      4. Untar the file.
      5. As codendiadm
      6. Update the gitolite config

      All this can be done with the owner 'app'.

      I will then merge both commits together.
    • User avatar
      As discussed via chat, the patch is ok but we need to figure something out surrounding concurrent events via the app and root owners of events for the same queue. I'll get back to you.
    • User avatar
      Your review and feedbacks for http://gerrit.tuleap.net/#/c/3003/ are welcome.

      Thank you in advance
    • User avatar
      Any update please ?
    • User avatar
      Please review in : http://gerrit.tuleap.net/#/c/3003/

      Thank you in advance
    • User avatar
      It is in our team task. We will reveiw this as sson as possible
    • User avatar
      Your review and feedbacks for http://gerrit.tuleap.net/#/c/3003/ are welcome.

      Thanks
    • User avatar
      Please review in : http://gerrit.tuleap.net/#/c/3003/

      Thank you in advance
    • User avatar
    • User avatar
    • User avatar
      Please review in : http://gerrit.tuleap.net/#/c/3003/

      Thanks

      • Status changed from Under implementation to Under review
      • Assigned to changed from None to Mohamed Amin Doghri (doghrim)
      • Reported in version cleared
    • User avatar
      The proper way to do it is to have a RESTORE event lauched as root so it can restore the files and run the chown (see BackendSystem for this)
      Then, once this RESTORE is done, there should be another even (lauched as APP) to re-update the repo definition (probably just launche GIT_REPO_UPDATE should be enough)

      For the RESTORE part, ideally it should be in git queue but as of today there is no way to execute an event of git queue as root. I think the easiest way is to launch it in main/default queue.
    • User avatar
      We are busy on 7.8 validation, we will have a look at your questions once it's out.
    • User avatar
      Any idea please ?
    • User avatar
      Any idea please ?
    • User avatar
      Any idea ?
    • User avatar
    • User avatar
      Hello ,

      I've an issue in this restore feature. In fact I was able to restore repositories with wrong ownership (codendiadm:codendiadm instead of

      gitolite:gitolite) , Is there any method inside git plugin that allow me to change repository ownership ?

      "chown" command doesn't work due to user permission (codendiadm) is not able to change ownsership.

      I've tried to run Restore systemevent with root, but it was blocked to "new" status and when running it with "app" it works well except this

      ownership issue.

      You could try my code in http://gerrit.tuleap.net/#/c/3003/

      Thing that is not clear to me is how tuleap fix right ownership (gitolite:gitolite) when creating repository with system event running with app user

      (normally codendiadm) ?
      If you look at "/usr/share/tuleap/plugins/git/include/events/SystemEvent_GIT_REPO_UPDATE.class.php" you will see that inside process method

      we have one call that seems to be responsible for repo creation wich is :
      $repository->getBackend()->updateRepoConf($repository);

      In my restore code I've already call this method but it doesn't change the ownership to gitolite:gitolite

      Thanks to help
      Amin
    • User avatar
      • Status changed from Acknowledged to Under implementation
    • User avatar
      >>>Does the archived repositories will be automatically purged after a given amount of time like other items?
      Yes (it will be announced in other artifact linked to #7363), and in this case we don't need manual deletion from siteadmin interface.

      >>>When the repository is archived/restored, what happen on the gerrit server side?
      Nothing since the repository should be disconnected from Gerrit before it's deletion .

      >>>Something that I did not ask in the previous request:
      >>>- Does the user have the choice between archive and delete action or is there only one action archive?
      Archiving is automatic after reporitory deletion, so nothing will change from user side, he will have only "delete" button and no other choice.
    • User avatar
      Does the archived repositories will be automatically purged after a given amount of time like other items?

      When the repository is archived/restored, what happen on the gerrit server side?

      Something that I did not ask in the previous request:
      - Does the user have the choice between archive and delete action or is there only one action archive?

      • Status changed from New to Acknowledged