otterdog icon indicating copy to clipboard operation
otterdog copied to clipboard

Issue with org ruleset and target `tag`

Open mbarbero opened this issue 4 months ago • 2 comments

With this file https://github.com/eclipse-arche/.eclipsefdn/blob/8f71503013236f30bf21b8a3b63c056ae95f6b00/otterdog/eclipse-arche.jsonnet, I get an error on apply:

│ Error:   failed to apply patch: ADD - org_ruleset[name="tags"]                                                                                                   
│          failed to add org ruleset with name 'tags':                                                                                                             
│          Exception while accessing 'https://api.github.com/orgs/eclipse-arche/rulesets': (status=422, body={"message":"Validation Failed","errors":["Invalid     
│          rule 'pull_request': "],"documentation_url":"https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset","status":"422"})        
╵                                                                                                                                                                  

It seems that the ruleset content is not valid. Please verify and create tests for this case.

mbarbero avatar Aug 20 '25 09:08 mbarbero

Certain rules that can be specified seem to be only available when either targetting branches / tags / pulls or repository.

Right now no distinction is being made, but we need to add validation rules and then only specify the rules / keys that are supported by the target.

netomi avatar Sep 08 '25 16:09 netomi

The Rest API is not really informative in this regard: https://docs.github.com/en/rest/orgs/rules?apiVersion=2022-11-28#create-an-organization-repository-ruleset

Will need trial and error.

netomi avatar Sep 08 '25 16:09 netomi