•  
     
    story #10217 manage "notifications" with REST API
Summary
Empty
manage "notifications" with REST API
Empty

Update existing routes:

GET /svn/:id

{
    "id": int,
    ...
    "settings": {
        "commit_rules": {
            "mandatory_reference": boolean,
            "allow_commit_message_change": boolean
        },
        "access_file": [
            "[/]",
            "* = ",
            "Contributors = r",
            "[/stuff]",
            "Contributors = rw"
        ],
        "immutable_tags": {
            "paths": [
                "/tags"
            ],
            "whitelist": [
                "/tags/moduleX"
            ]
        },
        "email_notifications": {
            [
                {
                    "path": "/trunk",
                    "user_groups": [
                        {
                            "id": "101_3",
                            "uri": "user_groups/101_3",
                            "label": "Project members"
                        },
                        UserGroupRepresentation
                    ],
                    "users": [
                        {
                            "id": 333,
                            "uri": "/users/333",
                            "username": "...",
                            ...
                        },
                        UserRepresentation
                    ],
                    "emails": [
                        "foo@example.com",
                        string
                    ]
                }
            ]
        }
    }
}

POST /svn

{
    ...
    "settings": {
        "commit_rules": {
            "mandatory_reference": boolean,
            "allow_commit_message_change": boolean
        },
        "access_file": [
            "[/]",
            "* = ",
            "Contributors = r",
            "[/stuff]",
            "Contributors = rw"
        ],
        "immutable_tags": {
            "paths": [
                "/tags"
            ],
            "whitelist": [
                "/tags/moduleX"
            ]
        },
        "email_notifications": {
            [
                {
                    "path": "/trunk",
                    "user_groups": [
                        {
                            "id": "101_3"
                        },
                        UserGroupRepresentation
                    ],
                    "users": [
                        {
                            "id": 333
                        },
                        UserRepresentation
                    ],
                    "emails": [
                        "foo@example.com",
                        string
                    ]
                }
            ]
        }
    }
}
  • For both "user_groups" and "user" the key is the id but the whole Representation can be passed along (and will be ignored). This ease the REST call chaining.

PUT /svn/:id

{
    "id": int
    "settings": {
        "commit_rules": {
            "mandatory_reference": boolean,
            "allow_commit_message_change": boolean
        },
        "access_file": [
            "[/]",
            "* = ",
            "Contributors = r",
            "[/stuff]",
            "Contributors = rw"
        ],
        "immutable_tags": {
            "paths": [
                "/tags"
            ],
            "whitelist": [
                "/tags/moduleX"
            ]
        },
        "email_notifications": {
            [
                {
                    "path": "/trunk",
                    "user_groups": [
                        {
                            "id": "101_3",
                        },
                        UserGroupRepresentation
                    ],
                    "users": [
                        {
                            "id": 333,
                        },
                        UserRepresentation
                    ],
                    "emails": [
                        "foo@example.com",
                        string
                    ]
                }
            ]
        }
    }
}
  • For both "user_groups" and "user" the key is the id but the whole Representation can be passed along (and will be ignored). This ease the REST call chaining.
  • Changes are recorded in Project History
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
#10217
Manuel Vacelet (vaceletm)
2017-09-06 13:10
2017-05-15 11:42
4491

References
Referencing story #10217

Git commit

tuleap/tuleap/stable

Add in GET svn:id notifications 5dffe42871
Create repository (POST) with or without notifications for mails f195b10fb2
Update (PUT) repository with notifications for mails 6e35770739
Encapsulate the global update in a transaction 0b3333e60b
Email type is verified by Restler 54d0f59a67
PUT repository must be stored only when modifications are done 1bdb20e2ad
Log should be done for users in REST 7f7ccf102e
Split REST test in two different files for better lisibility 4a9df4aacf
When a repository is created without settings, we should log it correctly 0d81253fe7
We should never log use a version #0 for access file history at REST repository creation e6cb91f8ca
Remove previous from project log title 8cc2ce79a7
Logs for emails should be done in UI 87bff364dc
Distinguish create and update in project history e0208a764a
Add ugroup and users into MailNotification object 3268647951
Emails should be array instead of string list 50afc66985
Path must be unique 89efa7eff7
Create repository (POST) with or without notifications for users faed926ff4
Update (PUT) repository with notifications for users 9fb45c3909
PUT notifications must be stored when notifications are done for users 153998f48e
Log notifications for users f261eafd64
emails should be unique 8fafc3e8d9
Create repository (POST) with or without notifications for users groups 6d7ddd56ad
We should allow dynamic ugroups >= Project members 002926c61e
Project history table headers are more readable 9ee564cc2c
Update (PUT) repository with notifications for user_groups d28cedd94f
Log notifications actions for ugroups 4ad73ca863
PUT notification must be stored only if changes are done for user_groups 1eb7aaa006
Missing UI notification addition in project history logs a19ecd45d4
Create a SVN repo through REST must not log "Use a version for access control file" 5c0156775e
Update doc of all route: correct indentation + true|false 69c0022f4c
Edit and delete notification from UI logs in project history. 56b9e35b48
Clean add user and add ugroups done more than one time feb3d31945

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
  • Permissions set to