accrescent / accrescent/console-api
Enforce fields using explicit presence in CI
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Because protobuf recommends explicit presence for maximum compatibility with protobuf editions, we should enforce that all fields in our schema use explicit presence.
There are at least two good options to support this enforcement:
- Adding a new lint rule to the Buf CLI: We could make a feature request to Buf that they add a new lint rule enforcing explicit field presence, following their preferred process. They say they'll add rules if they "think they're maintainable and could have widespread value", and since explicit field presence is a documented recommendation directly from the protobuf team, it would be worth giving this approach a shot especially since it is less maintenance work for us in the long run.
- Creating a Buf check plugin: We could make a custom Buf check plugin following Buf's documentation which enforces explicit presence on all fields. This would probably we less that 50 lines of code, and we could use it in the future to enforce other Accrescent-specific protobuf rules. Since we don't yet have another need for a Buf check plugin, it would be better if we can get an explicit presence lint rule in the Buf CLI isntead, but if that's not possible, writing a Buf check plugin is an acceptable way to go.
See also https://github.com/accrescent/appstore-api/issues/19.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the explicit-presence recommendation, the Buf process for requesting lint rules, and the Buf check-plugin documentation linked in the issue. Also inspect issue #19 for related context. Done means the project has a maintained enforcement mechanism ensuring all schema fields use explicit presence.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100