Fixing two bugs in Forgejo 0 ▲ Yet Another SysAdmin Website - Blog 2 hours ago · Tech · hide · 0 comments Introduction Last month while working on my OpenTofu/Terraform provider for Forgejo, I encountered a bug in the Forgejo API. I had some time to investigate so I wrote a fix, and was pleasantly surprised at how welcoming the project was to a new contributor. The problem The problematic endpoint is PATCH /orgs/{org}. This endpoint returned 200 OK when I tried to set an organization’s visibility to public, but the setting remained unchanged. Before creating a new issue, I searched through the list of open issues and found issue #13956. That’s when I learned that a second bug was also affecting this API endpoint: Every omitted fields from the PATCH /orgs/{org} request would be reset to its default value, which is not what you would expect from a PATCH endpoints. The fixes The first issue was caused by a logic error in the code: public is the zero value of VisibleType, which was interpreted as if the visibility field was not set in the request. Here is my fix with the associated… No comments yet. Log in to reply on the Fediverse. Comments will appear here.