Repository navigation
api: let update-service clear domains and ports, and go private - #42
Merged
bbedward merged 1 commit intoOct 19, 2026
Merged
Conversation
An empty overwrite_hosts or overwrite_ports now removes every domain or port, and is_public false removes every domain of a non-database service. Both become removals of what the service has, so the repository merge and its other callers are unchanged. UNB-402
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
overwrite_hosts: [],overwrite_ports: []andis_public: falsereturned 200 and changed nothing.Root cause:
[]into a non-nil empty slice (encoding/json, humaformats.go), but every check downstream useslen(...) > 0:MergeHosts/MergePortsand the repository update inrepositories/service/mutations.go. An empty overwrite looked the same as no overwrite.update.gosetsis_publicback to true whenever the service still has hosts and ports. With the hosts never cleared,falsewas always overwritten.Fix:
expandClearsruns inprepareServiceUpdatefor non-database services. It turns an empty overwrite into removals of the service's current hosts or ports, andis_public: falseinto removing every domain. Sending domains together withis_public: falseis refused. After that, the existingremove_hostspath runs, the one that worked by hand on banano:removesLastHostmakes the service private, and staged batches see the domains as released.Backwards compatibility:
MutateConfigInputthemselves behave as before.undefinedor a filled list,update-service-input.tsand the undeployed forms).is_public: falsewhen public is unticked. That used to keep the generated domain and stay public. Now it removes the domain, which is what the form asks for.Field docs on
overwrite_hosts,overwrite_portsandis_publicsay what empty and false do. Generated docs data and web client types are regenerated (comments only).Tests:
TestExpandClearsdecodes request bodies with huma's JSON format, then checks the merged result and the private switch. Not run against a live cluster.fixes UNB-402