You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

action.go 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package models
  6. import (
  7. "fmt"
  8. "html"
  9. "path"
  10. "strconv"
  11. "strings"
  12. "time"
  13. "code.gitea.io/gitea/modules/base"
  14. "code.gitea.io/gitea/modules/git"
  15. "code.gitea.io/gitea/modules/log"
  16. "code.gitea.io/gitea/modules/references"
  17. "code.gitea.io/gitea/modules/setting"
  18. api "code.gitea.io/gitea/modules/structs"
  19. "code.gitea.io/gitea/modules/timeutil"
  20. "github.com/unknwon/com"
  21. "xorm.io/builder"
  22. )
  23. // ActionType represents the type of an action.
  24. type ActionType int
  25. // Possible action types.
  26. const (
  27. ActionCreateRepo ActionType = iota + 1 // 1
  28. ActionRenameRepo // 2
  29. ActionStarRepo // 3
  30. ActionWatchRepo // 4
  31. ActionCommitRepo // 5
  32. ActionCreateIssue // 6
  33. ActionCreatePullRequest // 7
  34. ActionTransferRepo // 8
  35. ActionPushTag // 9
  36. ActionCommentIssue // 10
  37. ActionMergePullRequest // 11
  38. ActionCloseIssue // 12
  39. ActionReopenIssue // 13
  40. ActionClosePullRequest // 14
  41. ActionReopenPullRequest // 15
  42. ActionDeleteTag // 16
  43. ActionDeleteBranch // 17
  44. ActionMirrorSyncPush // 18
  45. ActionMirrorSyncCreate // 19
  46. ActionMirrorSyncDelete // 20
  47. )
  48. // Action represents user operation type and other information to
  49. // repository. It implemented interface base.Actioner so that can be
  50. // used in template render.
  51. type Action struct {
  52. ID int64 `xorm:"pk autoincr"`
  53. UserID int64 `xorm:"INDEX"` // Receiver user id.
  54. OpType ActionType
  55. ActUserID int64 `xorm:"INDEX"` // Action user id.
  56. ActUser *User `xorm:"-"`
  57. RepoID int64 `xorm:"INDEX"`
  58. Repo *Repository `xorm:"-"`
  59. CommentID int64 `xorm:"INDEX"`
  60. Comment *Comment `xorm:"-"`
  61. IsDeleted bool `xorm:"INDEX NOT NULL DEFAULT false"`
  62. RefName string
  63. IsPrivate bool `xorm:"INDEX NOT NULL DEFAULT false"`
  64. Content string `xorm:"TEXT"`
  65. CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
  66. }
  67. // GetOpType gets the ActionType of this action.
  68. func (a *Action) GetOpType() ActionType {
  69. return a.OpType
  70. }
  71. func (a *Action) loadActUser() {
  72. if a.ActUser != nil {
  73. return
  74. }
  75. var err error
  76. a.ActUser, err = GetUserByID(a.ActUserID)
  77. if err == nil {
  78. return
  79. } else if IsErrUserNotExist(err) {
  80. a.ActUser = NewGhostUser()
  81. } else {
  82. log.Error("GetUserByID(%d): %v", a.ActUserID, err)
  83. }
  84. }
  85. func (a *Action) loadRepo() {
  86. if a.Repo != nil {
  87. return
  88. }
  89. var err error
  90. a.Repo, err = GetRepositoryByID(a.RepoID)
  91. if err != nil {
  92. log.Error("GetRepositoryByID(%d): %v", a.RepoID, err)
  93. }
  94. }
  95. // GetActFullName gets the action's user full name.
  96. func (a *Action) GetActFullName() string {
  97. a.loadActUser()
  98. return a.ActUser.FullName
  99. }
  100. // GetActUserName gets the action's user name.
  101. func (a *Action) GetActUserName() string {
  102. a.loadActUser()
  103. return a.ActUser.Name
  104. }
  105. // ShortActUserName gets the action's user name trimmed to max 20
  106. // chars.
  107. func (a *Action) ShortActUserName() string {
  108. return base.EllipsisString(a.GetActUserName(), 20)
  109. }
  110. // GetDisplayName gets the action's display name based on DEFAULT_SHOW_FULL_NAME
  111. func (a *Action) GetDisplayName() string {
  112. if setting.UI.DefaultShowFullName {
  113. return a.GetActFullName()
  114. }
  115. return a.ShortActUserName()
  116. }
  117. // GetDisplayNameTitle gets the action's display name used for the title (tooltip) based on DEFAULT_SHOW_FULL_NAME
  118. func (a *Action) GetDisplayNameTitle() string {
  119. if setting.UI.DefaultShowFullName {
  120. return a.ShortActUserName()
  121. }
  122. return a.GetActFullName()
  123. }
  124. // GetActAvatar the action's user's avatar link
  125. func (a *Action) GetActAvatar() string {
  126. a.loadActUser()
  127. return a.ActUser.RelAvatarLink()
  128. }
  129. // GetRepoUserName returns the name of the action repository owner.
  130. func (a *Action) GetRepoUserName() string {
  131. a.loadRepo()
  132. return a.Repo.MustOwner().Name
  133. }
  134. // ShortRepoUserName returns the name of the action repository owner
  135. // trimmed to max 20 chars.
  136. func (a *Action) ShortRepoUserName() string {
  137. return base.EllipsisString(a.GetRepoUserName(), 20)
  138. }
  139. // GetRepoName returns the name of the action repository.
  140. func (a *Action) GetRepoName() string {
  141. a.loadRepo()
  142. return a.Repo.Name
  143. }
  144. // ShortRepoName returns the name of the action repository
  145. // trimmed to max 33 chars.
  146. func (a *Action) ShortRepoName() string {
  147. return base.EllipsisString(a.GetRepoName(), 33)
  148. }
  149. // GetRepoPath returns the virtual path to the action repository.
  150. func (a *Action) GetRepoPath() string {
  151. return path.Join(a.GetRepoUserName(), a.GetRepoName())
  152. }
  153. // ShortRepoPath returns the virtual path to the action repository
  154. // trimmed to max 20 + 1 + 33 chars.
  155. func (a *Action) ShortRepoPath() string {
  156. return path.Join(a.ShortRepoUserName(), a.ShortRepoName())
  157. }
  158. // GetRepoLink returns relative link to action repository.
  159. func (a *Action) GetRepoLink() string {
  160. if len(setting.AppSubURL) > 0 {
  161. return path.Join(setting.AppSubURL, a.GetRepoPath())
  162. }
  163. return "/" + a.GetRepoPath()
  164. }
  165. // GetRepositoryFromMatch returns a *Repository from a username and repo strings
  166. func GetRepositoryFromMatch(ownerName string, repoName string) (*Repository, error) {
  167. var err error
  168. refRepo, err := GetRepositoryByOwnerAndName(ownerName, repoName)
  169. if err != nil {
  170. if IsErrRepoNotExist(err) {
  171. log.Warn("Repository referenced in commit but does not exist: %v", err)
  172. return nil, err
  173. }
  174. log.Error("GetRepositoryByOwnerAndName: %v", err)
  175. return nil, err
  176. }
  177. return refRepo, nil
  178. }
  179. // GetCommentLink returns link to action comment.
  180. func (a *Action) GetCommentLink() string {
  181. return a.getCommentLink(x)
  182. }
  183. func (a *Action) getCommentLink(e Engine) string {
  184. if a == nil {
  185. return "#"
  186. }
  187. if a.Comment == nil && a.CommentID != 0 {
  188. a.Comment, _ = GetCommentByID(a.CommentID)
  189. }
  190. if a.Comment != nil {
  191. return a.Comment.HTMLURL()
  192. }
  193. if len(a.GetIssueInfos()) == 0 {
  194. return "#"
  195. }
  196. //Return link to issue
  197. issueIDString := a.GetIssueInfos()[0]
  198. issueID, err := strconv.ParseInt(issueIDString, 10, 64)
  199. if err != nil {
  200. return "#"
  201. }
  202. issue, err := getIssueByID(e, issueID)
  203. if err != nil {
  204. return "#"
  205. }
  206. if err = issue.loadRepo(e); err != nil {
  207. return "#"
  208. }
  209. return issue.HTMLURL()
  210. }
  211. // GetBranch returns the action's repository branch.
  212. func (a *Action) GetBranch() string {
  213. return a.RefName
  214. }
  215. // GetContent returns the action's content.
  216. func (a *Action) GetContent() string {
  217. return a.Content
  218. }
  219. // GetCreate returns the action creation time.
  220. func (a *Action) GetCreate() time.Time {
  221. return a.CreatedUnix.AsTime()
  222. }
  223. // GetIssueInfos returns a list of issues associated with
  224. // the action.
  225. func (a *Action) GetIssueInfos() []string {
  226. return strings.SplitN(a.Content, "|", 2)
  227. }
  228. // GetIssueTitle returns the title of first issue associated
  229. // with the action.
  230. func (a *Action) GetIssueTitle() string {
  231. index := com.StrTo(a.GetIssueInfos()[0]).MustInt64()
  232. issue, err := GetIssueByIndex(a.RepoID, index)
  233. if err != nil {
  234. log.Error("GetIssueByIndex: %v", err)
  235. return "500 when get issue"
  236. }
  237. return issue.Title
  238. }
  239. // GetIssueContent returns the content of first issue associated with
  240. // this action.
  241. func (a *Action) GetIssueContent() string {
  242. index := com.StrTo(a.GetIssueInfos()[0]).MustInt64()
  243. issue, err := GetIssueByIndex(a.RepoID, index)
  244. if err != nil {
  245. log.Error("GetIssueByIndex: %v", err)
  246. return "500 when get issue"
  247. }
  248. return issue.Content
  249. }
  250. func newRepoAction(e Engine, u *User, repo *Repository) (err error) {
  251. if err = notifyWatchers(e, &Action{
  252. ActUserID: u.ID,
  253. ActUser: u,
  254. OpType: ActionCreateRepo,
  255. RepoID: repo.ID,
  256. Repo: repo,
  257. IsPrivate: repo.IsPrivate,
  258. }); err != nil {
  259. return fmt.Errorf("notify watchers '%d/%d': %v", u.ID, repo.ID, err)
  260. }
  261. log.Trace("action.newRepoAction: %s/%s", u.Name, repo.Name)
  262. return err
  263. }
  264. // NewRepoAction adds new action for creating repository.
  265. func NewRepoAction(u *User, repo *Repository) (err error) {
  266. return newRepoAction(x, u, repo)
  267. }
  268. func renameRepoAction(e Engine, actUser *User, oldRepoName string, repo *Repository) (err error) {
  269. if err = notifyWatchers(e, &Action{
  270. ActUserID: actUser.ID,
  271. ActUser: actUser,
  272. OpType: ActionRenameRepo,
  273. RepoID: repo.ID,
  274. Repo: repo,
  275. IsPrivate: repo.IsPrivate,
  276. Content: oldRepoName,
  277. }); err != nil {
  278. return fmt.Errorf("notify watchers: %v", err)
  279. }
  280. log.Trace("action.renameRepoAction: %s/%s", actUser.Name, repo.Name)
  281. return nil
  282. }
  283. // RenameRepoAction adds new action for renaming a repository.
  284. func RenameRepoAction(actUser *User, oldRepoName string, repo *Repository) error {
  285. return renameRepoAction(x, actUser, oldRepoName, repo)
  286. }
  287. // PushCommit represents a commit in a push operation.
  288. type PushCommit struct {
  289. Sha1 string
  290. Message string
  291. AuthorEmail string
  292. AuthorName string
  293. CommitterEmail string
  294. CommitterName string
  295. Timestamp time.Time
  296. }
  297. // PushCommits represents list of commits in a push operation.
  298. type PushCommits struct {
  299. Len int
  300. Commits []*PushCommit
  301. CompareURL string
  302. avatars map[string]string
  303. emailUsers map[string]*User
  304. }
  305. // NewPushCommits creates a new PushCommits object.
  306. func NewPushCommits() *PushCommits {
  307. return &PushCommits{
  308. avatars: make(map[string]string),
  309. emailUsers: make(map[string]*User),
  310. }
  311. }
  312. // ToAPIPayloadCommits converts a PushCommits object to
  313. // api.PayloadCommit format.
  314. func (pc *PushCommits) ToAPIPayloadCommits(repoPath, repoLink string) ([]*api.PayloadCommit, error) {
  315. commits := make([]*api.PayloadCommit, len(pc.Commits))
  316. if pc.emailUsers == nil {
  317. pc.emailUsers = make(map[string]*User)
  318. }
  319. var err error
  320. for i, commit := range pc.Commits {
  321. authorUsername := ""
  322. author, ok := pc.emailUsers[commit.AuthorEmail]
  323. if !ok {
  324. author, err = GetUserByEmail(commit.AuthorEmail)
  325. if err == nil {
  326. authorUsername = author.Name
  327. pc.emailUsers[commit.AuthorEmail] = author
  328. }
  329. } else {
  330. authorUsername = author.Name
  331. }
  332. committerUsername := ""
  333. committer, ok := pc.emailUsers[commit.CommitterEmail]
  334. if !ok {
  335. committer, err = GetUserByEmail(commit.CommitterEmail)
  336. if err == nil {
  337. // TODO: check errors other than email not found.
  338. committerUsername = committer.Name
  339. pc.emailUsers[commit.CommitterEmail] = committer
  340. }
  341. } else {
  342. committerUsername = committer.Name
  343. }
  344. fileStatus, err := git.GetCommitFileStatus(repoPath, commit.Sha1)
  345. if err != nil {
  346. return nil, fmt.Errorf("FileStatus [commit_sha1: %s]: %v", commit.Sha1, err)
  347. }
  348. commits[i] = &api.PayloadCommit{
  349. ID: commit.Sha1,
  350. Message: commit.Message,
  351. URL: fmt.Sprintf("%s/commit/%s", repoLink, commit.Sha1),
  352. Author: &api.PayloadUser{
  353. Name: commit.AuthorName,
  354. Email: commit.AuthorEmail,
  355. UserName: authorUsername,
  356. },
  357. Committer: &api.PayloadUser{
  358. Name: commit.CommitterName,
  359. Email: commit.CommitterEmail,
  360. UserName: committerUsername,
  361. },
  362. Added: fileStatus.Added,
  363. Removed: fileStatus.Removed,
  364. Modified: fileStatus.Modified,
  365. Timestamp: commit.Timestamp,
  366. }
  367. }
  368. return commits, nil
  369. }
  370. // AvatarLink tries to match user in database with e-mail
  371. // in order to show custom avatar, and falls back to general avatar link.
  372. func (pc *PushCommits) AvatarLink(email string) string {
  373. if pc.avatars == nil {
  374. pc.avatars = make(map[string]string)
  375. }
  376. avatar, ok := pc.avatars[email]
  377. if ok {
  378. return avatar
  379. }
  380. u, ok := pc.emailUsers[email]
  381. if !ok {
  382. var err error
  383. u, err = GetUserByEmail(email)
  384. if err != nil {
  385. pc.avatars[email] = base.AvatarLink(email)
  386. if !IsErrUserNotExist(err) {
  387. log.Error("GetUserByEmail: %v", err)
  388. return ""
  389. }
  390. } else {
  391. pc.emailUsers[email] = u
  392. }
  393. }
  394. if u != nil {
  395. pc.avatars[email] = u.RelAvatarLink()
  396. }
  397. return pc.avatars[email]
  398. }
  399. // getIssueFromRef returns the issue referenced by a ref. Returns a nil *Issue
  400. // if the provided ref references a non-existent issue.
  401. func getIssueFromRef(repo *Repository, index int64) (*Issue, error) {
  402. issue, err := GetIssueByIndex(repo.ID, index)
  403. if err != nil {
  404. if IsErrIssueNotExist(err) {
  405. return nil, nil
  406. }
  407. return nil, err
  408. }
  409. return issue, nil
  410. }
  411. func changeIssueStatus(repo *Repository, issue *Issue, doer *User, status bool) error {
  412. stopTimerIfAvailable := func(doer *User, issue *Issue) error {
  413. if StopwatchExists(doer.ID, issue.ID) {
  414. if err := CreateOrStopIssueStopwatch(doer, issue); err != nil {
  415. return err
  416. }
  417. }
  418. return nil
  419. }
  420. issue.Repo = repo
  421. if err := issue.ChangeStatus(doer, status); err != nil {
  422. // Don't return an error when dependencies are open as this would let the push fail
  423. if IsErrDependenciesLeft(err) {
  424. return stopTimerIfAvailable(doer, issue)
  425. }
  426. return err
  427. }
  428. return stopTimerIfAvailable(doer, issue)
  429. }
  430. // UpdateIssuesCommit checks if issues are manipulated by commit message.
  431. func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, branchName string) error {
  432. // Commits are appended in the reverse order.
  433. for i := len(commits) - 1; i >= 0; i-- {
  434. c := commits[i]
  435. type markKey struct {
  436. ID int64
  437. Action references.XRefAction
  438. }
  439. refMarked := make(map[markKey]bool)
  440. var refRepo *Repository
  441. var refIssue *Issue
  442. var err error
  443. for _, ref := range references.FindAllIssueReferences(c.Message) {
  444. // issue is from another repo
  445. if len(ref.Owner) > 0 && len(ref.Name) > 0 {
  446. refRepo, err = GetRepositoryFromMatch(ref.Owner, ref.Name)
  447. if err != nil {
  448. continue
  449. }
  450. } else {
  451. refRepo = repo
  452. }
  453. if refIssue, err = getIssueFromRef(refRepo, ref.Index); err != nil {
  454. return err
  455. }
  456. if refIssue == nil {
  457. continue
  458. }
  459. perm, err := GetUserRepoPermission(refRepo, doer)
  460. if err != nil {
  461. return err
  462. }
  463. key := markKey{ID: refIssue.ID, Action: ref.Action}
  464. if refMarked[key] {
  465. continue
  466. }
  467. refMarked[key] = true
  468. // only create comments for issues if user has permission for it
  469. if perm.IsAdmin() || perm.IsOwner() || perm.CanWrite(UnitTypeIssues) {
  470. message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, repo.Link(), c.Sha1, html.EscapeString(c.Message))
  471. if err = CreateRefComment(doer, refRepo, refIssue, message, c.Sha1); err != nil {
  472. return err
  473. }
  474. }
  475. // Process closing/reopening keywords
  476. if ref.Action != references.XRefActionCloses && ref.Action != references.XRefActionReopens {
  477. continue
  478. }
  479. // Change issue status only if the commit has been pushed to the default branch.
  480. // and if the repo is configured to allow only that
  481. // FIXME: we should be using Issue.ref if set instead of repo.DefaultBranch
  482. if repo.DefaultBranch != branchName && !repo.CloseIssuesViaCommitInAnyBranch {
  483. continue
  484. }
  485. // only close issues in another repo if user has push access
  486. if perm.IsAdmin() || perm.IsOwner() || perm.CanWrite(UnitTypeCode) {
  487. if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil {
  488. return err
  489. }
  490. }
  491. }
  492. }
  493. return nil
  494. }
  495. func transferRepoAction(e Engine, doer, oldOwner *User, repo *Repository) (err error) {
  496. if err = notifyWatchers(e, &Action{
  497. ActUserID: doer.ID,
  498. ActUser: doer,
  499. OpType: ActionTransferRepo,
  500. RepoID: repo.ID,
  501. Repo: repo,
  502. IsPrivate: repo.IsPrivate,
  503. Content: path.Join(oldOwner.Name, repo.Name),
  504. }); err != nil {
  505. return fmt.Errorf("notifyWatchers: %v", err)
  506. }
  507. // Remove watch for organization.
  508. if oldOwner.IsOrganization() {
  509. if err = watchRepo(e, oldOwner.ID, repo.ID, false); err != nil {
  510. return fmt.Errorf("watchRepo [false]: %v", err)
  511. }
  512. }
  513. return nil
  514. }
  515. // TransferRepoAction adds new action for transferring repository,
  516. // the Owner field of repository is assumed to be new owner.
  517. func TransferRepoAction(doer, oldOwner *User, repo *Repository) error {
  518. return transferRepoAction(x, doer, oldOwner, repo)
  519. }
  520. func mergePullRequestAction(e Engine, doer *User, repo *Repository, issue *Issue) error {
  521. return notifyWatchers(e, &Action{
  522. ActUserID: doer.ID,
  523. ActUser: doer,
  524. OpType: ActionMergePullRequest,
  525. Content: fmt.Sprintf("%d|%s", issue.Index, issue.Title),
  526. RepoID: repo.ID,
  527. Repo: repo,
  528. IsPrivate: repo.IsPrivate,
  529. })
  530. }
  531. // MergePullRequestAction adds new action for merging pull request.
  532. func MergePullRequestAction(actUser *User, repo *Repository, pull *Issue) error {
  533. return mergePullRequestAction(x, actUser, repo, pull)
  534. }
  535. // GetFeedsOptions options for retrieving feeds
  536. type GetFeedsOptions struct {
  537. RequestedUser *User
  538. RequestingUserID int64
  539. IncludePrivate bool // include private actions
  540. OnlyPerformedBy bool // only actions performed by requested user
  541. IncludeDeleted bool // include deleted actions
  542. }
  543. // GetFeeds returns actions according to the provided options
  544. func GetFeeds(opts GetFeedsOptions) ([]*Action, error) {
  545. cond := builder.NewCond()
  546. var repoIDs []int64
  547. if opts.RequestedUser.IsOrganization() {
  548. env, err := opts.RequestedUser.AccessibleReposEnv(opts.RequestingUserID)
  549. if err != nil {
  550. return nil, fmt.Errorf("AccessibleReposEnv: %v", err)
  551. }
  552. if repoIDs, err = env.RepoIDs(1, opts.RequestedUser.NumRepos); err != nil {
  553. return nil, fmt.Errorf("GetUserRepositories: %v", err)
  554. }
  555. cond = cond.And(builder.In("repo_id", repoIDs))
  556. }
  557. cond = cond.And(builder.Eq{"user_id": opts.RequestedUser.ID})
  558. if opts.OnlyPerformedBy {
  559. cond = cond.And(builder.Eq{"act_user_id": opts.RequestedUser.ID})
  560. }
  561. if !opts.IncludePrivate {
  562. cond = cond.And(builder.Eq{"is_private": false})
  563. }
  564. if !opts.IncludeDeleted {
  565. cond = cond.And(builder.Eq{"is_deleted": false})
  566. }
  567. actions := make([]*Action, 0, 20)
  568. if err := x.Limit(20).Desc("id").Where(cond).Find(&actions); err != nil {
  569. return nil, fmt.Errorf("Find: %v", err)
  570. }
  571. if err := ActionList(actions).LoadAttributes(); err != nil {
  572. return nil, fmt.Errorf("LoadAttributes: %v", err)
  573. }
  574. return actions, nil
  575. }