On 15/08/25 at 13:11 +0800, Blair Noctis wrote:
> (The last message got signing messed up, sorry)
> 
> On 2025-08-14T22:21:56+0200, Salvo Tomaselli <tipos...@tiscali.it>:
> > Hello,
> >
> > I do not want merge requests from random people. I want a bugreport
> > with an attached patch. How can I signal this to people? (without
> > spending an inordinate amount of time in salsa to click around and
> > disable merge requests entirely).
> 
> I don't really know about a way to signal such without disabling MRs, nobody
> reads project descriptions, and for salsa, even READMEs. Maybe [MR
> templates], though that's kinda unfriendly for the other side.
> 
> If you do want to disable them, here are some instructions to make it
> faster:
> 
> - Web interface
>       1. Go to repository
>       2. On the left sidebar, click Settings - General
>       3. Click to expand "Visibility, project features, permissions"
>       4. Under "Repository", uncheck "Merge requests"
>       5. Scroll down a bit and click "Save changes"
> - API, practically also CLI
>       0. Get a personal access token at 
> https://salsa.debian.org/-/user_settings/personal_access_tokens?scopes=api,write_repository
>       1. `curl --request PUT --url 
> https://salsa.debian.org/api/v4/projects/<id>
> --header 'PRIVATE-TOKEN: <personal-access-token>' --header 'content-type:
> application/json' --data '{"merge_requests_access_level": "disabled"}'`
>               1. `<id>` could be (1) the numeric project ID, which is shown 
> in the
> pop-up menu when you click the ⋮ button at the upper right corner on the
> "home" page of the project, or in Settings - General; (2)
> `<owner>%2f<project>`
>               2. Add `"issues_access_level": "disabled"` to the JSON after 
> `--data` in 2
> and you get to also disable the cursed issues!
>       3. Free takeaway: `curl
> https://salsa.debian.org/api/v4/users/<username>/projects | jq '.[].name'`
> (or `/groups/<group>/projects`) (or `'.[].id')
> - glab (GitLab CLI): AFAIK it doesn't have a "porcelain" command for that,
> and the "plumbing" command (`glab api`) is essentially just calling the API

If you want to get the list of `owner/project` where MRs should be
disabled, you could easily script something around
https://udd.debian.org/salsa/:

curl
'https://udd.debian.org/salsa/?email1=ltworf%40debian.org&format=json' |
jq -r '.status[] | select (.mrs_enabled==true) | .project'

Lucas

Reply via email to