refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名) - 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块) - docreader proto 描述符采用等长替换,保持序列化字节布局有效 - Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像 - 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -333,7 +333,7 @@ func newCopyMilvusHarness(t *testing.T, rows []copyTestRow) *copyMilvusHarness {
|
||||
return ©MilvusHarness{
|
||||
repo: &milvusRepository{
|
||||
client: c,
|
||||
collectionBaseName: "weknora_embeddings",
|
||||
collectionBaseName: "academy_embeddings",
|
||||
metricType: entity.IP,
|
||||
},
|
||||
fake: fake,
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
||||
@@ -87,7 +87,7 @@ func newKeywordsMilvusHarness(t *testing.T, collections []string,
|
||||
t.Cleanup(func() { _ = c.Close(context.Background()) })
|
||||
|
||||
return &keywordsMilvusHarness{
|
||||
repo: &milvusRepository{client: c, collectionBaseName: "weknora_embeddings"},
|
||||
repo: &milvusRepository{client: c, collectionBaseName: "academy_embeddings"},
|
||||
fake: fake,
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ func captureMilvusLogs(t *testing.T) *bytes.Buffer {
|
||||
func TestMilvusKeywordsRetrieveFailsWhenEveryMatchedCollectionFails(t *testing.T) {
|
||||
logs := captureMilvusLogs(t)
|
||||
harness := newKeywordsMilvusHarness(t,
|
||||
[]string{"weknora_embeddings_1024", "weknora_embeddings_1536", "other_collection"},
|
||||
[]string{"academy_embeddings_1024", "academy_embeddings_1536", "other_collection"},
|
||||
func(string) (*milvuspb.SearchResults, error) { return failedMilvusSearch(), nil },
|
||||
)
|
||||
|
||||
@@ -176,7 +176,7 @@ func TestMilvusKeywordsRetrieveFailsWhenEveryMatchedCollectionFails(t *testing.T
|
||||
require.Contains(t, err.Error(), "milvus keyword search unavailable")
|
||||
require.Nil(t, results, "no result set may accompany the error")
|
||||
require.Equal(t,
|
||||
[]string{"weknora_embeddings_1024", "weknora_embeddings_1536"}, harness.fake.searches,
|
||||
[]string{"academy_embeddings_1024", "academy_embeddings_1536"}, harness.fake.searches,
|
||||
"only base-name collections are searched",
|
||||
)
|
||||
require.NotContains(t, logs.String(), "No keyword matches found",
|
||||
@@ -190,9 +190,9 @@ func TestMilvusKeywordsRetrieveFailsWhenEveryMatchedCollectionFails(t *testing.T
|
||||
func TestMilvusKeywordsRetrieveKeepsResultsWhenOnlySomeCollectionsFail(t *testing.T) {
|
||||
logs := captureMilvusLogs(t)
|
||||
harness := newKeywordsMilvusHarness(t,
|
||||
[]string{"weknora_embeddings_1024", "weknora_embeddings_1536"},
|
||||
[]string{"academy_embeddings_1024", "academy_embeddings_1536"},
|
||||
func(name string) (*milvuspb.SearchResults, error) {
|
||||
if name == "weknora_embeddings_1024" {
|
||||
if name == "academy_embeddings_1024" {
|
||||
return failedMilvusSearch(), nil
|
||||
}
|
||||
return milvusSearchHits("chunk-1", "invoice total 42"), nil
|
||||
@@ -221,7 +221,7 @@ func TestMilvusKeywordsRetrieveKeepsResultsWhenOnlySomeCollectionsFail(t *testin
|
||||
// conclusion log still fires.
|
||||
func TestMilvusKeywordsRetrieveReportsNoMatchesWhenNothingFailed(t *testing.T) {
|
||||
logs := captureMilvusLogs(t)
|
||||
harness := newKeywordsMilvusHarness(t, []string{"weknora_embeddings_1024"},
|
||||
harness := newKeywordsMilvusHarness(t, []string{"academy_embeddings_1024"},
|
||||
func(string) (*milvuspb.SearchResults, error) { return emptyMilvusSearch(), nil },
|
||||
)
|
||||
|
||||
@@ -240,9 +240,9 @@ func TestMilvusKeywordsRetrieveReportsNoMatchesWhenNothingFailed(t *testing.T) {
|
||||
func TestMilvusKeywordsRetrieveMarksPartialFailureWhenNothingHit(t *testing.T) {
|
||||
logs := captureMilvusLogs(t)
|
||||
harness := newKeywordsMilvusHarness(t,
|
||||
[]string{"weknora_embeddings_1024", "weknora_embeddings_1536"},
|
||||
[]string{"academy_embeddings_1024", "academy_embeddings_1536"},
|
||||
func(name string) (*milvuspb.SearchResults, error) {
|
||||
if name == "weknora_embeddings_1024" {
|
||||
if name == "academy_embeddings_1024" {
|
||||
return failedMilvusSearch(), nil
|
||||
}
|
||||
return emptyMilvusSearch(), nil
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"github.com/milvus-io/milvus/client/v2/index"
|
||||
client "github.com/milvus-io/milvus/client/v2/milvusclient"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
const defaultMultilingualMigrationBatchSize = 64
|
||||
@@ -56,7 +56,7 @@ type MigrationSummary struct {
|
||||
MigratedRows int
|
||||
}
|
||||
|
||||
// MigrateLegacyCollections copies all legacy WeKnora Milvus collections to a
|
||||
// MigrateLegacyCollections copies all legacy Academy Milvus collections to a
|
||||
// new multilingual collection base. Existing dense vectors are reused; only
|
||||
// Milvus's BM25 sparse vectors are regenerated from content and language.
|
||||
//
|
||||
|
||||
@@ -11,22 +11,22 @@ import (
|
||||
)
|
||||
|
||||
func TestCollectionDimensionForBase(t *testing.T) {
|
||||
dimension, ok := collectionDimensionForBase("weknora_embeddings_1536", "weknora_embeddings")
|
||||
dimension, ok := collectionDimensionForBase("academy_embeddings_1536", "academy_embeddings")
|
||||
require.True(t, ok)
|
||||
require.Equal(t, 1536, dimension)
|
||||
|
||||
_, ok = collectionDimensionForBase("weknora_embeddings_multilingual_1536", "weknora_embeddings")
|
||||
_, ok = collectionDimensionForBase("academy_embeddings_multilingual_1536", "academy_embeddings")
|
||||
require.False(t, ok)
|
||||
_, ok = collectionDimensionForBase("weknora_embeddings", "weknora_embeddings")
|
||||
_, ok = collectionDimensionForBase("academy_embeddings", "academy_embeddings")
|
||||
require.False(t, ok)
|
||||
_, ok = collectionDimensionForBase("weknora_embeddings_1536_backup", "weknora_embeddings")
|
||||
_, ok = collectionDimensionForBase("academy_embeddings_1536_backup", "academy_embeddings")
|
||||
require.False(t, ok)
|
||||
|
||||
require.True(t, matchesDimensionCollection(
|
||||
"weknora_embeddings_multilingual_1536",
|
||||
"weknora_embeddings_multilingual",
|
||||
"academy_embeddings_multilingual_1536",
|
||||
"academy_embeddings_multilingual",
|
||||
))
|
||||
require.False(t, matchesDimensionCollection("weknora_embeddings_1536", "weknora_embeddings_multilingual"))
|
||||
require.False(t, matchesDimensionCollection("academy_embeddings_1536", "academy_embeddings_multilingual"))
|
||||
}
|
||||
|
||||
func TestParseMetricType(t *testing.T) {
|
||||
|
||||
@@ -15,15 +15,15 @@ import (
|
||||
"github.com/milvus-io/milvus/client/v2/index"
|
||||
client "github.com/milvus-io/milvus/client/v2/milvusclient"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/types/interfaces"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
"academy/internal/types/interfaces"
|
||||
)
|
||||
|
||||
const (
|
||||
envMilvusCollection = "MILVUS_COLLECTION"
|
||||
envMilvusMetricType = "MILVUS_METRIC_TYPE"
|
||||
defaultCollectionName = "weknora_embeddings"
|
||||
defaultCollectionName = "academy_embeddings"
|
||||
fieldSourceID = "source_id"
|
||||
fieldSourceType = "source_type"
|
||||
fieldChunkID = "chunk_id"
|
||||
@@ -83,7 +83,7 @@ func (m *milvusRepository) getCollectionName(dimension int) string {
|
||||
}
|
||||
|
||||
// collectionAnalyzerMode inspects a collection once and caches whether it
|
||||
// uses the multilingual schema. Older WeKnora collections do not have the
|
||||
// uses the multilingual schema. Older Academy collections do not have the
|
||||
// language field, so they must continue using the legacy upsert and search
|
||||
// paths until they are migrated.
|
||||
func (m *milvusRepository) collectionAnalyzerMode(
|
||||
@@ -142,7 +142,7 @@ func (m *milvusRepository) ensureCollection(ctx context.Context, dimension int)
|
||||
// Define schema
|
||||
schema := &entity.Schema{
|
||||
CollectionName: collectionName,
|
||||
Description: fmt.Sprintf("WeKnora embeddings collection with dimension %d", dimension),
|
||||
Description: fmt.Sprintf("Academy embeddings collection with dimension %d", dimension),
|
||||
AutoID: false,
|
||||
Fields: []*entity.Field{
|
||||
entity.NewField().
|
||||
@@ -230,7 +230,7 @@ func (m *milvusRepository) ensureCollection(ctx context.Context, dimension int)
|
||||
log.Infof("[Milvus] Successfully created collection %s", collectionName)
|
||||
m.collectionAnalyzerModes.Store(collectionName, collectionAnalyzerMulti)
|
||||
} else {
|
||||
// Existing collections may have been created by an older WeKnora
|
||||
// Existing collections may have been created by an older Academy
|
||||
// version. Keep them readable and writable until they are migrated.
|
||||
if _, err := m.collectionAnalyzerMode(ctx, collectionName); err != nil {
|
||||
return err
|
||||
@@ -1407,7 +1407,7 @@ func convertResultSet(resultSet []client.ResultSet) ([]*MilvusVectorEmbeddingWit
|
||||
|
||||
// metricToSimilarity converts a raw vector-search score into cosine
|
||||
// similarity, the scale callers rank and threshold on. IP and COSINE already
|
||||
// are for the L2-normalized embeddings WeKnora indexes. Milvus L2 returns
|
||||
// are for the L2-normalized embeddings Academy indexes. Milvus L2 returns
|
||||
// the squared Euclidean distance (smaller is better), which for unit vectors
|
||||
// is 2 - 2cos; passing it through ranked the farthest hits first.
|
||||
func (m *milvusRepository) metricToSimilarity(score float64) float64 {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -45,13 +45,13 @@ func TestUpdateChunkEnabledStatusInCollectionSkipsEmptyChunkIDs(t *testing.T) {
|
||||
|
||||
require.NoError(t, repo.updateChunkEnabledStatusInCollection(
|
||||
context.Background(),
|
||||
"weknora_embeddings_1024",
|
||||
"academy_embeddings_1024",
|
||||
nil,
|
||||
false,
|
||||
))
|
||||
require.NoError(t, repo.updateChunkEnabledStatusInCollection(
|
||||
context.Background(),
|
||||
"weknora_embeddings_1024",
|
||||
"academy_embeddings_1024",
|
||||
[]string{},
|
||||
true,
|
||||
))
|
||||
@@ -61,12 +61,12 @@ func TestUpdateChunkEnabledStatusInCollectionsPropagatesFailure(t *testing.T) {
|
||||
wantErr := errors.New("upsert failed")
|
||||
err := updateChunkEnabledStatusInCollections(
|
||||
context.Background(),
|
||||
[]string{"other_collection", "weknora_embeddings_1024"},
|
||||
"weknora_embeddings",
|
||||
[]string{"other_collection", "academy_embeddings_1024"},
|
||||
"academy_embeddings",
|
||||
nil,
|
||||
[]string{"chunk-1"},
|
||||
func(_ context.Context, collection string, _ []string, enabled bool) error {
|
||||
if collection == "weknora_embeddings_1024" && !enabled {
|
||||
if collection == "academy_embeddings_1024" && !enabled {
|
||||
return wantErr
|
||||
}
|
||||
return nil
|
||||
@@ -82,11 +82,11 @@ func TestUpdateChunkEnabledStatusInCollectionsIgnoresExtendedPrefix(t *testing.T
|
||||
context.Background(),
|
||||
[]string{
|
||||
"other_collection",
|
||||
"weknora_embeddings_1024",
|
||||
"weknora_embeddings_multilingual_1024",
|
||||
"weknora_embeddings_1024_backup",
|
||||
"academy_embeddings_1024",
|
||||
"academy_embeddings_multilingual_1024",
|
||||
"academy_embeddings_1024_backup",
|
||||
},
|
||||
"weknora_embeddings",
|
||||
"academy_embeddings",
|
||||
[]string{"chunk-1"},
|
||||
nil,
|
||||
func(_ context.Context, collection string, _ []string, _ bool) error {
|
||||
@@ -98,5 +98,5 @@ func TestUpdateChunkEnabledStatusInCollectionsIgnoresExtendedPrefix(t *testing.T
|
||||
},
|
||||
)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, []string{"weknora_embeddings_1024"}, seen)
|
||||
require.Equal(t, []string{"academy_embeddings_1024"}, seen)
|
||||
}
|
||||
Reference in new issue
Block a user