•  
     
    story #10214 manage svn "commit rules" with REST API
Summary
Empty
manage svn "commit rules" with REST API

I can automate the management of svn repositories with my own rules

GET | OPTIONS /projects/:id/svn

{
  "collection": [
    {
        "id": int,
        "uri": "/svn/:id"
        "name": string
    },
    ...
  ]
}

GET /projects/:id/svn?query=XXX

{
  "collection": [
    {
        "id": int,
        "uri": "/svn/:id"
        "name": string
    }
  ]
}
  • Allow to search for 1 repository in a given project
  • The filter is not compatible with wildcard for now

GET | OPTIONS /svn/:id

{
    "id": int,
    "project_id": int,
    "uri": "/svn/:id"
    "name": string
    "settings": {
        "commit_rules": {
            "mandatory_reference": boolean,
            "allow_commit_message_change": boolean
        }
    }
}
  • note: the "settings" part is only viewable by people who are svn administrators, project administrators or site administrators

POST | OPTIONS /svn

{
    "project_id": int,
    "name": string
    "settings": {
        "commit_rules": {
            "mandatory_reference": boolean,
            "allow_commit_message_change": boolean
        }
    }
}
  • Creates a new repository
    • The repository is not physically created "right away" as it's done by a background "system event" that can take up to 2 minutes to be processed. However the route will return 201 (created) is informations are valid + a specific message to inform that the actual creation of the repository will occur later
    • As an evolution of the API we might imagin that the POST representation defined here could have a "callback_uri" the would be called by Tuleap server once the repository is created so calling script/application could be informed about it automatically.
  • This action is restricted to svn administrators, project administrators or site administrators

PUT /svn/:id

{
    "id": int
    "settings": {
        "commit_rules": {
            "mandatory_reference": boolean,
            "allow_commit_message_change": boolean
        }
    }
}
  • Update repository configuration
  • The change is logged in project audit trail (project history)
  • This action is restricted to svn administrators, project administrators or site administrators
  • Returns RepositoryRepresentation like GET

DELETE /svn/:id

  • This action is restricted to svn administrators, project administrators or site administrators
  • Delete the repository
Empty
Empty
Status
Empty
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#10214
Manuel Vacelet (vaceletm)
2017-07-19 11:15
2017-05-15 11:13
3274

References
Referencing story #10214

Git commit

tuleap/tuleap/stable

Refacto rename getById 772f33dcc1
Create GET | OPTIONS /svn/:id 80caf334de
Introduce GET project/:id/svn b8092f4d23
GET project/:id:/svn returns the content 37e90dc7a8
Implements OPTIONS /projects/:id/svn bfe6587f22
Fix setup error in REST tests a6cdf5600d
Add commit rules in GET /svn/:id 725882c9d4
Add a query for project/:id/svn 0fcad565dc
Add settings key in FullRepresentation b56805f82e
Implements DELETE /svn/:id 3a9d90ce38
Create PUT svn/:id 06a0a0faf7
Implements POST | OPTIONS /svn 69b0b891a3
Change access and add REST authentication check when missing 37fff86356
Add project history for repository deletion 78859703c9
Add project history for repository creation e92d010bb5
Post route shoud accept settings informations 8b41faf291
Refactoring : exploding god object RepositoryManager for repository creation b11ac13991
Refactoring extracting Hook update in a dedicated object d70121eeb4
Use is/has/does/can/… for booleans 0af63d987a
User can create a repository without custom settings e24b0a6390
Save hook updates in project history c0f72caf35
An error 400 is thrown if keys are missing 33abf3fb44
Check for repository is create only by SVN administrator is done in creator d4c65ef240
HookConfig retrieve should be done in a dedicated object 33c20e1510
Repository name should be validated in creator 9424c510ba
We should be able to create a repository directly with its settings 40fd9fec14

Follow-ups

User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Thomas Gerbet (tgerbet)2017-06-26 10:31
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Thomas Gerbet (tgerbet)2017-06-26 10:28
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Please stick to the current usage of search in REST API: the user should use a query parameter, like it is done in /projects or /users.

  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • So that
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Permissions set to