Files
forge/modules/analyze/vendor.go
zeekayandHanzo Dev 063b617481 forward-only: drop .gitea, the gitea webhook type, and the gitea_ runtime keys
No compat with old Gitea deployments, so the wire values that were held back
for it go too.

  .gitea/*        WorkflowDirs is now {.hanzo, .github}/workflows. Same for the
                  PR-template, ISSUE_TEMPLATE and repo-template lookups, which
                  each carried a .gitea variant. .github stays — GitHub compat
                  is worth having; Gitea compat is what we just decided not to
                  keep.
  webhook type    "gitea" -> "native", constant GITEA -> NATIVE, routes
                  /hooks/gitea/{new,id} -> /hooks/native/{new,id}, and the enum
                  in both swagger documents.
  actions context gitea_runtime_token -> git_runtime_token,
                  gitea_default_actions_url -> git_default_actions_url.

models/migrations/* is untouched on purpose. A schema migration describes what
the database held AT THAT VERSION; v1_14/v162.go rewriting its own history to
say "native" would make it wrong about the thing it exists to migrate.

Three test fixtures needed aligning rather than renaming, all the same shape as
the bugs this cleanup keeps finding: WorkflowDirs expectations ended up with a
duplicated .hanzo entry, the repo-template test built its fixture under .gitea,
and five API tests still posted Type: "gitea" (422 now, correctly).

models, modules, services, routers green; integration compile gate green.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 13:59:46 -07:00

33 lines
805 B
Go

// Copyright 2026 Hanzo AI, Inc. All rights reserved.
// Copyright 2021 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package analyze
import (
"path"
"strings"
"github.com/go-enry/go-enry/v2"
)
// IsVendor returns whether the path is a vendor path.
// It uses go-enry's IsVendor function but overrides its detection for certain
// special cases that shouldn't be marked as vendored in the diff view.
func IsVendor(treePath string) bool {
if !enry.IsVendor(treePath) {
return false
}
// Override detection for single files
basename := path.Base(treePath)
switch basename {
case ".gitignore", ".gitattributes", ".gitmodules":
return false
}
if strings.HasPrefix(treePath, ".github/") || strings.HasPrefix(treePath, ".hanzo/") {
return false
}
return true
}