Skip to content

Commit 726a925

Browse files
authored
Merge branch 'main' into docker/package
2 parents 0a59e1a + 300b724 commit 726a925

36 files changed

+272
-154
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Wim <[email protected]> (@42wim)
4646
Jason Song <[email protected]> (@wolfogre)
4747
Yarden Shoham <[email protected]> (@yardenshoham)
4848
Yu Tian <[email protected]> (@Zettat123)
49-
Eddie Yang <[email protected]> (@yp05327)
5049
Dong Ge <[email protected]> (@sillyguodong)
5150
Xinyi Gong <[email protected]> (@HesterG)
5251
wxiaoguang <[email protected]> (@wxiaoguang)

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,12 @@ lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
377377
.PHONY: lint-js
378378
lint-js: node_modules
379379
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
380-
# npx vue-tsc
380+
npx vue-tsc
381381

382382
.PHONY: lint-js-fix
383383
lint-js-fix: node_modules
384384
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
385-
# npx vue-tsc
385+
npx vue-tsc
386386

387387
.PHONY: lint-css
388388
lint-css: node_modules
@@ -451,10 +451,6 @@ lint-templates: .venv node_modules
451451
lint-yaml: .venv
452452
@poetry run yamllint .
453453

454-
.PHONY: tsc
455-
tsc:
456-
npx vue-tsc
457-
458454
.PHONY: watch
459455
watch:
460456
@bash tools/watch.sh

models/fixtures/action_run.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,22 @@
5555
updated: 1683636626
5656
need_approval: 0
5757
approved_by: 0
58+
-
59+
id: 794
60+
title: "job output"
61+
repo_id: 4
62+
owner_id: 1
63+
workflow_id: "test.yaml"
64+
index: 190
65+
trigger_user_id: 1
66+
ref: "refs/heads/test"
67+
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
68+
event: "push"
69+
is_fork_pull_request: 0
70+
status: 1
71+
started: 1683636528
72+
stopped: 1683636626
73+
created: 1683636108
74+
updated: 1683636626
75+
need_approval: 0
76+
approved_by: 0

models/fixtures/branch.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,15 @@
8181
is_deleted: false
8282
deleted_by_id: 0
8383
deleted_unix: 0
84+
85+
-
86+
id: 15
87+
repo_id: 4
88+
name: 'master'
89+
commit_id: 'c7cd3cd144e6d23c9d6f3d07e52b2c1a956e0338'
90+
commit_message: 'add Readme'
91+
commit_time: 1588147171
92+
pusher_id: 13
93+
is_deleted: false
94+
deleted_by_id: 0
95+
deleted_unix: 0

options/license/MIPS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Copyright (c) 1992, 1991, 1990 MIPS Computer Systems, Inc.
2+
MIPS Computer Systems, Inc. grants reproduction and use
3+
rights to all parties, PROVIDED that this comment is
4+
maintained in the copy.

options/license/ThirdEye

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(C) Copyright 1984 by Third Eye Software, Inc.
2+
3+
Third Eye Software, Inc. grants reproduction and use rights to
4+
all parties, PROVIDED that this comment is maintained in the copy.
5+
6+
Third Eye makes no claims about the applicability of this
7+
symbol table to a particular use.

package-lock.json

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"devDependencies": {
6767
"@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
6868
"@playwright/test": "1.49.0",
69+
"@silverwind/vue-tsc": "2.1.13",
6970
"@stoplight/spectral-cli": "6.14.2",
7071
"@stylistic/eslint-plugin-js": "2.11.0",
7172
"@stylistic/stylelint-plugin": "3.1.1",
@@ -110,8 +111,7 @@
110111
"type-fest": "4.30.0",
111112
"updates": "16.4.0",
112113
"vite-string-plugin": "1.3.4",
113-
"vitest": "2.1.8",
114-
"vue-tsc": "2.1.10"
114+
"vitest": "2.1.8"
115115
},
116116
"browserslist": [
117117
"defaults"

routers/web/repo/actions/actions.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package actions
55

66
import (
77
"bytes"
8+
stdCtx "context"
89
"fmt"
910
"net/http"
1011
"slices"
@@ -245,7 +246,7 @@ func List(ctx *context.Context) {
245246
return
246247
}
247248

248-
if err := loadIsRefDeleted(ctx, runs); err != nil {
249+
if err := loadIsRefDeleted(ctx, ctx.Repo.Repository.ID, runs); err != nil {
249250
log.Error("LoadIsRefDeleted", err)
250251
}
251252

@@ -273,7 +274,7 @@ func List(ctx *context.Context) {
273274

274275
// loadIsRefDeleted loads the IsRefDeleted field for each run in the list.
275276
// TODO: move this function to models/actions/run_list.go but now it will result in a circular import.
276-
func loadIsRefDeleted(ctx *context.Context, runs actions_model.RunList) error {
277+
func loadIsRefDeleted(ctx stdCtx.Context, repoID int64, runs actions_model.RunList) error {
277278
branches := make(container.Set[string], len(runs))
278279
for _, run := range runs {
279280
refName := git.RefName(run.Ref)
@@ -285,14 +286,14 @@ func loadIsRefDeleted(ctx *context.Context, runs actions_model.RunList) error {
285286
return nil
286287
}
287288

288-
branchInfos, err := git_model.GetBranches(ctx, ctx.Repo.Repository.ID, branches.Values(), false)
289+
branchInfos, err := git_model.GetBranches(ctx, repoID, branches.Values(), false)
289290
if err != nil {
290291
return err
291292
}
292293
branchSet := git_model.BranchesToNamesSet(branchInfos)
293294
for _, run := range runs {
294295
refName := git.RefName(run.Ref)
295-
if refName.IsBranch() && !branchSet.Contains(run.Ref) {
296+
if refName.IsBranch() && !branchSet.Contains(refName.ShortName()) {
296297
run.IsRefDeleted = true
297298
}
298299
}

routers/web/repo/actions/actions_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import (
77
"strings"
88
"testing"
99

10+
actions_model "code.gitea.io/gitea/models/actions"
11+
"code.gitea.io/gitea/models/db"
12+
unittest "code.gitea.io/gitea/models/unittest"
13+
1014
act_model "github.com/nektos/act/pkg/model"
1115
"github.com/stretchr/testify/assert"
1216
)
@@ -154,3 +158,21 @@ func TestReadWorkflow_WorkflowDispatchConfig(t *testing.T) {
154158
Type: "boolean",
155159
}, workflowDispatch.Inputs[2])
156160
}
161+
162+
func Test_loadIsRefDeleted(t *testing.T) {
163+
unittest.PrepareTestEnv(t)
164+
165+
runs, total, err := db.FindAndCount[actions_model.ActionRun](db.DefaultContext,
166+
actions_model.FindRunOptions{RepoID: 4, Ref: "refs/heads/test"})
167+
assert.NoError(t, err)
168+
assert.Len(t, runs, 1)
169+
assert.EqualValues(t, 1, total)
170+
for _, run := range runs {
171+
assert.False(t, run.IsRefDeleted)
172+
}
173+
174+
assert.NoError(t, loadIsRefDeleted(db.DefaultContext, 4, runs))
175+
for _, run := range runs {
176+
assert.True(t, run.IsRefDeleted)
177+
}
178+
}

0 commit comments

Comments
 (0)