rename builds -> bots

This commit is contained in:
Lunny Xiao
2022-11-25 17:48:48 +08:00
committed by Jason Song
parent c61ac24c1c
commit 2ecb59c092
24 changed files with 81 additions and 78 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ func (Run) TableName() string {
}
func (run *Run) HTMLURL() string {
return fmt.Sprintf("%s/builds/runs/%d", run.Repo.HTMLURL(), run.Index)
return fmt.Sprintf("%s/bots/runs/%d", run.Repo.HTMLURL(), run.Index)
}
// LoadAttributes load Repo TriggerUser if not loaded
+1 -1
View File
@@ -127,7 +127,7 @@ func (task *Task) GetBuildViewLink() string {
if task.Job == nil || task.Job.Run == nil || task.Job.Run.Repo == nil {
return ""
}
return task.Job.Run.Repo.Link() + "/builds/runs/" + strconv.FormatInt(task.ID, 10)
return task.Job.Run.Repo.Link() + "/bots/runs/" + strconv.FormatInt(task.ID, 10)
}
func (task *Task) GetCommitLink() string {
+1 -1
View File
@@ -175,7 +175,7 @@ func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) {
r.Config = new(PullRequestsConfig)
case unit.TypeIssues:
r.Config = new(IssuesConfig)
case unit.TypeCode, unit.TypeReleases, unit.TypeWiki, unit.TypeProjects, unit.TypePackages, unit.TypeBuilds:
case unit.TypeCode, unit.TypeReleases, unit.TypeWiki, unit.TypeProjects, unit.TypePackages, unit.TypeBots:
fallthrough
default:
r.Config = new(UnitConfig)
+10 -10
View File
@@ -28,7 +28,7 @@ const (
TypeExternalTracker // 7 ExternalTracker
TypeProjects // 8 Kanban board
TypePackages // 9 Packages
TypeBuilds // 10 Builds
TypeBots // 10 Bots
)
// Value returns integer value for unit type
@@ -56,8 +56,8 @@ func (u Type) String() string {
return "TypeProjects"
case TypePackages:
return "TypePackages"
case TypeBuilds:
return "TypeBuilds"
case TypeBots:
return "TypeBots"
}
return fmt.Sprintf("Unknown Type %d", u)
}
@@ -81,7 +81,7 @@ var (
TypeExternalTracker,
TypeProjects,
TypePackages,
TypeBuilds,
TypeBots,
}
// DefaultRepoUnits contains the default unit types
@@ -293,11 +293,11 @@ var (
perm.AccessModeRead,
}
UnitBuilds = Unit{
TypeBuilds,
"repo.builds",
"/builds",
"repo.builds.desc",
UnitBots = Unit{
TypeBots,
"repo.bots",
"/bots",
"repo.bots.desc",
7,
perm.AccessModeOwner,
}
@@ -313,7 +313,7 @@ var (
TypeExternalWiki: UnitExternalWiki,
TypeProjects: UnitProjects,
TypePackages: UnitPackages,
TypeBuilds: UnitBuilds,
TypeBots: UnitBots,
}
)