[PR #9400] [MERGED] server/internal/internal/names: validate names #12946

Closed
opened 2026-04-13 00:13:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9400
Author: @bmizerany
Created: 2/27/2025
Status: Merged
Merged: 3/1/2025
Merged by: @bmizerany

Base: mainHead: bmizerany/validatenames


📝 Commits (1)

  • 9c1204b server/internal/internal/names: validate names

📊 Changes

6 files changed (+261 additions, -150 deletions)

View changed files

📝 server/internal/client/ollama/registry.go (+92 -57)
📝 server/internal/client/ollama/registry_test.go (+39 -27)
📝 server/internal/internal/names/name.go (+53 -54)
📝 server/internal/internal/names/name_test.go (+75 -7)
📝 server/internal/registry/server.go (+1 -1)
📝 server/internal/registry/server_test.go (+1 -4)

📄 Description

This commit is a step towards a goal to make names less ceremonial outside of the registry client. Clients of the registry package can treat names as opaque strings, and the registry package will handle parsing, validating, and normalizing names.

Ideally we end up with the names package tucked away in an internal package for good. We'll see how things go.

Also, this package name is not permanent. This another step in the on-going process of refactoring the server code, and at some point it will most likely be renamed/moved.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/9400 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 2/27/2025 **Status:** ✅ Merged **Merged:** 3/1/2025 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/validatenames` --- ### 📝 Commits (1) - [`9c1204b`](https://github.com/ollama/ollama/commit/9c1204b686f10a9f9bc2a4d4eb70aadf25e61905) server/internal/internal/names: validate names ### 📊 Changes **6 files changed** (+261 additions, -150 deletions) <details> <summary>View changed files</summary> 📝 `server/internal/client/ollama/registry.go` (+92 -57) 📝 `server/internal/client/ollama/registry_test.go` (+39 -27) 📝 `server/internal/internal/names/name.go` (+53 -54) 📝 `server/internal/internal/names/name_test.go` (+75 -7) 📝 `server/internal/registry/server.go` (+1 -1) 📝 `server/internal/registry/server_test.go` (+1 -4) </details> ### 📄 Description This commit is a step towards a goal to make names less ceremonial outside of the registry client. Clients of the registry package can treat names as opaque strings, and the registry package will handle parsing, validating, and normalizing names. Ideally we end up with the names package tucked away in an internal package for good. We'll see how things go. Also, this package name is not permanent. This another step in the on-going process of refactoring the server code, and at some point it will most likely be renamed/moved. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:13:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#12946