Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository ruleset event doesn't match schema #3429

Open
stevehipwell opened this issue Jan 9, 2025 · 2 comments · May be fixed by #3430
Open

Repository ruleset event doesn't match schema #3429

stevehipwell opened this issue Jan 9, 2025 · 2 comments · May be fixed by #3430

Comments

@stevehipwell
Copy link
Contributor

I'm looking at the code for the Ruleset & RepositoryRuleset types and both of them seem to be representing the same GH resource with slightly different implementations (Conditions & Rules). I can see that the Ruleset type use for the REST API is technically valid even though it represents the rules as an opaque json.RawMessage (this is what I'm looking to fix). But the RepositoryRuleset and specifically the RepositoryRulesetRule type doesn't match the schema for the repository_ruleset event, which is based on the same schema as for the REST API.

@gmlewis do you have additional context that I don't have to explain why this actually works? If not I plan on refactoring all of this code back to a common pattern as it used elsewhere as well as removing the json.RawMessage fields which cause issues in consumers such as the GH TF provider.

@gmlewis
Copy link
Collaborator

gmlewis commented Jan 9, 2025

No, I personally have not used the repository ruleset endpoints.
I recommend you take a look at the GitHub "Blame" history of these endpoints to see who has been involved in their implementations, and possibly ask them in this issue if they have any additional context for you.

@stevehipwell
Copy link
Contributor Author

@unamdev0 do you remember why the ruleset types aren't aligned and why the rules for the event don't match the schema?

REF: #3305

@stevehipwell stevehipwell linked a pull request Jan 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants