Skip to content

Commit c9f3ac5

Browse files
committed
Merge branch 'main' into fix/modify_folded_review
* main: (106 commits) Relax generic package filename restrictions (go-gitea#30135) Remove jQuery class from the common admin functions (go-gitea#30137) Remove jQuery class from the reaction selector (go-gitea#30138) Forbid jQuery `.attr` (go-gitea#30116) Refactor render (go-gitea#30136) Fix: Organization Interface Display Issue (go-gitea#30133) Remove jQuery `.attr` from the Fomantic dropdowns (go-gitea#30114) Remove jQuery `.attr` from the common admin functions (go-gitea#30115) Remove jQuery from the create/rename branch modals (except Fomantic) (go-gitea#30109) Remove fomantic label module (go-gitea#30081) Fix bug for markdown rendering of blockquote (go-gitea#30130) Fix: The interface is broken when modifying code comments under mobile devices (go-gitea#30125) When the title in the issue has a value, set the text cursor at the end of the text. (go-gitea#30090) Load attachments for code comments (go-gitea#30124) Upgrade fabric to 6.0.0-beta20 (go-gitea#30121) Fix click handler in job-step-summary (go-gitea#30122) Put an edit file button on pull request files to allow a quick operation (go-gitea#29697) Remove jQuery `.attr` from the Fomantic modal cancel buttons (go-gitea#30113) Remove jQuery `.attr` from the code comments (go-gitea#30112) Remove jQuery calls that have no effect on `showElem` and `hideElem` (go-gitea#30110) ...
2 parents 20b94fc + 1ad48f7 commit c9f3ac5

File tree

453 files changed

+9184
-14750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

453 files changed

+9184
-14750
lines changed

.air.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ delay = 1000
88
include_ext = ["go", "tmpl"]
99
include_file = ["main.go"]
1010
include_dir = ["cmd", "models", "modules", "options", "routers", "services"]
11-
exclude_dir = ["modules/git/tests", "services/gitdiff/testdata", "modules/avatar/testdata", "models/fixtures", "models/migrations/fixtures", "modules/migration/file_format_testdata", "modules/avatar/identicon/testdata"]
11+
exclude_dir = [
12+
"models/fixtures",
13+
"models/migrations/fixtures",
14+
"modules/avatar/identicon/testdata",
15+
"modules/avatar/testdata",
16+
"modules/git/tests",
17+
"modules/migration/file_format_testdata",
18+
"routers/private/tests",
19+
"services/gitdiff/testdata",
20+
]
1221
exclude_regex = ["_test.go$", "_gen.go$"]
1322
stop_on_error = true

.eslintrc.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ rules:
119119
"@stylistic/js/arrow-spacing": [2, {before: true, after: true}]
120120
"@stylistic/js/block-spacing": [0]
121121
"@stylistic/js/brace-style": [2, 1tbs, {allowSingleLine: true}]
122-
"@stylistic/js/comma-dangle": [2, only-multiline]
122+
"@stylistic/js/comma-dangle": [2, always-multiline]
123123
"@stylistic/js/comma-spacing": [2, {before: false, after: true}]
124124
"@stylistic/js/comma-style": [2, last]
125125
"@stylistic/js/computed-property-spacing": [2, never]
@@ -167,7 +167,7 @@ rules:
167167
"@stylistic/js/semi-spacing": [2, {before: false, after: true}]
168168
"@stylistic/js/semi-style": [2, last]
169169
"@stylistic/js/space-before-blocks": [2, always]
170-
"@stylistic/js/space-before-function-paren": [0]
170+
"@stylistic/js/space-before-function-paren": [2, {anonymous: ignore, named: never, asyncArrow: always}]
171171
"@stylistic/js/space-in-parens": [2, never]
172172
"@stylistic/js/space-infix-ops": [2]
173173
"@stylistic/js/space-unary-ops": [2]
@@ -281,7 +281,7 @@ rules:
281281
jquery/no-ajax-events: [2]
282282
jquery/no-ajax: [2]
283283
jquery/no-animate: [2]
284-
jquery/no-attr: [0]
284+
jquery/no-attr: [2]
285285
jquery/no-bind: [2]
286286
jquery/no-class: [0]
287287
jquery/no-clone: [2]
@@ -303,7 +303,7 @@ rules:
303303
jquery/no-in-array: [2]
304304
jquery/no-is-array: [2]
305305
jquery/no-is-function: [2]
306-
jquery/no-is: [0]
306+
jquery/no-is: [2]
307307
jquery/no-load: [2]
308308
jquery/no-map: [2]
309309
jquery/no-merge: [2]
@@ -397,7 +397,7 @@ rules:
397397
no-jquery/no-animate-toggle: [2]
398398
no-jquery/no-animate: [2]
399399
no-jquery/no-append-html: [2]
400-
no-jquery/no-attr: [0]
400+
no-jquery/no-attr: [2]
401401
no-jquery/no-bind: [2]
402402
no-jquery/no-box-model: [2]
403403
no-jquery/no-browser: [2]
@@ -440,7 +440,7 @@ rules:
440440
no-jquery/no-is-numeric: [2]
441441
no-jquery/no-is-plain-object: [2]
442442
no-jquery/no-is-window: [2]
443-
no-jquery/no-is: [0]
443+
no-jquery/no-is: [2]
444444
no-jquery/no-jquery-constructor: [0]
445445
no-jquery/no-live: [2]
446446
no-jquery/no-load-shorthand: [2]

.github/workflows/files-changed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
- "Makefile"
7474
7575
templates:
76+
- "tools/lint-templates-*.js"
7677
- "templates/**/*.tmpl"
7778
- "pyproject.toml"
7879
- "poetry.lock"

.github/workflows/pull-compliance.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ jobs:
3535
- uses: actions/setup-python@v5
3636
with:
3737
python-version: "3.12"
38+
- uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
3841
- run: pip install poetry
3942
- run: make deps-py
43+
- run: make deps-frontend
4044
- run: make lint-templates
4145

4246
lint-yaml:

.stylelintrc.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rules:
3030
"@stylistic/block-opening-brace-newline-after": null
3131
"@stylistic/block-opening-brace-newline-before": null
3232
"@stylistic/block-opening-brace-space-after": null
33-
"@stylistic/block-opening-brace-space-before": null
33+
"@stylistic/block-opening-brace-space-before": always
3434
"@stylistic/color-hex-case": lower
3535
"@stylistic/declaration-bang-space-after": never
3636
"@stylistic/declaration-bang-space-before": null
@@ -140,7 +140,7 @@ rules:
140140
function-disallowed-list: null
141141
function-linear-gradient-no-nonstandard-direction: true
142142
function-name-case: lower
143-
function-no-unknown: null
143+
function-no-unknown: true
144144
function-url-no-scheme-relative: null
145145
function-url-quotes: always
146146
function-url-scheme-allowed-list: null
@@ -168,7 +168,7 @@ rules:
168168
no-duplicate-selectors: true
169169
no-empty-source: true
170170
no-invalid-double-slash-comments: true
171-
no-invalid-position-at-import-rule: null
171+
no-invalid-position-at-import-rule: [true, ignoreAtRules: [tailwind]]
172172
no-irregular-whitespace: true
173173
no-unknown-animations: null
174174
no-unknown-custom-properties: null
@@ -181,6 +181,7 @@ rules:
181181
rule-empty-line-before: null
182182
rule-selector-property-disallowed-list: null
183183
scale-unlimited/declaration-strict-value: [[/color$/, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true, expandShorthand: true}]
184+
selector-anb-no-unmatchable: true
184185
selector-attribute-name-disallowed-list: null
185186
selector-attribute-operator-allowed-list: null
186187
selector-attribute-operator-disallowed-list: null

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ DOCKER_TAG ?= latest
4242
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
4343

4444
ifeq ($(HAS_GO), yes)
45-
GOPATH ?= $(shell $(GO) env GOPATH)
46-
export PATH := $(GOPATH)/bin:$(PATH)
47-
4845
CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
4946
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
5047
endif
@@ -437,7 +434,8 @@ lint-actions:
437434
$(GO) run $(ACTIONLINT_PACKAGE)
438435

439436
.PHONY: lint-templates
440-
lint-templates: .venv
437+
lint-templates: .venv node_modules
438+
@node tools/lint-templates-svg.js
441439
@poetry run djlint $(shell find templates -type f -iname '*.tmpl')
442440

443441
.PHONY: lint-yaml
@@ -961,7 +959,7 @@ generate-gitignore:
961959

962960
.PHONY: generate-images
963961
generate-images: | node_modules
964-
npm install --no-save [email protected]beta19 imagemin-zopfli@7
962+
npm install --no-save [email protected]beta20 imagemin-zopfli@7
965963
node tools/generate-images.js $(TAGS)
966964

967965
.PHONY: generate-manpage

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![](https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml/badge.svg?branch=main)](https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml?query=branch%3Amain "Release Nightly")
44
[![](https://img.shields.io/discord/322538954119184384.svg?logo=discord&logoColor=white&label=Discord&color=5865F2)](https://discord.gg/Gitea "Join the Discord chat at https://discord.gg/Gitea")
5-
[![](https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg)](https://app.codecov.io/gh/go-gitea/gitea "Codecov")
65
[![](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea "Go Report Card")
76
[![](https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg)](https://pkg.go.dev/code.gitea.io/gitea "GoDoc")
87
[![](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest "GitHub release")

README_ZH.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![](https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml/badge.svg?branch=main)](https://github.com/go-gitea/gitea/actions/workflows/release-nightly.yml?query=branch%3Amain "Release Nightly")
44
[![](https://img.shields.io/discord/322538954119184384.svg?logo=discord&logoColor=white&label=Discord&color=5865F2)](https://discord.gg/Gitea "Join the Discord chat at https://discord.gg/Gitea")
5-
[![](https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg)](https://app.codecov.io/gh/go-gitea/gitea "Codecov")
65
[![](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea "Go Report Card")
76
[![](https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg)](https://pkg.go.dev/code.gitea.io/gitea "GoDoc")
87
[![](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest "GitHub release")

docs/content/administration/repo-indexer.en-us.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ menu:
1717

1818
# Repository indexer
1919

20+
## Builtin repository code search without indexer
21+
22+
Users could do repository-level code search without setting up a repository indexer.
23+
The builtin code search is based on the `git grep` command, which is fast and efficient for small repositories.
24+
Better code search support could be achieved by setting up the repository indexer.
25+
2026
## Setting up the repository indexer
2127

2228
Gitea can search through the files of the repositories by enabling this function in your [`app.ini`](administration/config-cheat-sheet.md):

docs/content/contributing/guidelines-frontend.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/h
4747
9. Avoid unnecessary `!important` in CSS, add comments to explain why it's necessary if it can't be avoided.
4848
10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event.
4949
11. Custom event names are recommended to use `ce-` prefix.
50-
12. Prefer using Tailwind CSS which is available via `tw-` prefix, e.g. `tw-relative`. Gitea's helper CSS classes use `gt-` prefix (`gt-df`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
50+
12. Prefer using Tailwind CSS which is available via `tw-` prefix, e.g. `tw-relative`. Gitea's helper CSS classes use `gt-` prefix (`gt-mono`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
5151
13. Avoid inline scripts & styles as much as possible, it's recommended to put JS code into JS files and use CSS classes. If inline scripts & styles are unavoidable, explain the reason why it can't be avoided.
5252

5353
### Accessibility / ARIA
@@ -118,7 +118,7 @@ However, there are still some special cases, so the current guideline is:
118118
### Show/Hide Elements
119119

120120
* Vue components are recommended to use `v-if` and `v-show` to show/hide elements.
121-
* Go template code should use Gitea's `.gt-hidden` and `showElem()/hideElem()/toggleElem()`, see more details in `.gt-hidden`'s comment.
121+
* Go template code should use `.tw-hidden` and `showElem()/hideElem()/toggleElem()`, see more details in `.tw-hidden`'s comment.
122122

123123
### Styles and Attributes in Go HTML Template
124124

docs/content/contributing/guidelines-frontend.zh-cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ HTML 页面由[Go HTML Template](https://pkg.go.dev/html/template)渲染。
4747
9. 避免在 CSS 中使用不必要的`!important`,如果无法避免,添加注释解释为什么需要它。
4848
10. 避免在一个事件监听器中混合不同的事件,优先为每个事件使用独立的事件监听器。
4949
11. 推荐使用自定义事件名称前缀`ce-`
50-
12. 建议使用 Tailwind CSS,它可以通过 `tw-` 前缀获得,例如 `tw-relative`. Gitea 自身的助手类 CSS 使用 `gt-` 前缀(`gt-df`),Gitea 自身的私有框架级 CSS 类使用 `g-` 前缀(`g-modal-confirm`)。
50+
12. 建议使用 Tailwind CSS,它可以通过 `tw-` 前缀获得,例如 `tw-relative`. Gitea 自身的助手类 CSS 使用 `gt-` 前缀(`gt-mono`),Gitea 自身的私有框架级 CSS 类使用 `g-` 前缀(`g-modal-confirm`)。
5151
13. 尽量避免内联脚本和样式,建议将JS代码放入JS文件中并使用CSS类。如果内联脚本和样式不可避免,请解释无法避免的原因。
5252

5353
### 可访问性 / ARIA
@@ -117,7 +117,7 @@ Gitea 使用一些补丁使 Fomantic UI 更具可访问性(参见 `aria.md`)
117117
### 显示/隐藏元素
118118

119119
* 推荐在Vue组件中使用`v-if``v-show`来显示/隐藏元素。
120-
* Go 模板代码应使用 Gitea 的 `.gt-hidden``showElem()/hideElem()/toggleElem()` 来显示/隐藏元素,请参阅`.gt-hidden`的注释以获取更多详细信息。
120+
* Go 模板代码应使用 `.tw-hidden``showElem()/hideElem()/toggleElem()` 来显示/隐藏元素,请参阅`.tw-hidden`的注释以获取更多详细信息。
121121

122122
### Go HTML 模板中的样式和属性
123123

docs/content/installation/comparison.en-us.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ _Symbols used in table:_
8787
| Git Blame |||||||||
8888
| Visual comparison of image changes |||| ? | ? | ? |||
8989

90+
- Gitea has builtin repository-level code search
91+
- Better code search support could be achieved by [using a repository indexer](administration/repo-indexer.md)
92+
9093
## Issue Tracker
9194

9295
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE | RhodeCode EE |

models/actions/run.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,16 @@ func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) err
170170
return err
171171
}
172172

173-
// CancelRunningJobs cancels all running and waiting jobs associated with a specific workflow.
174-
func CancelRunningJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error {
175-
// Find all runs in the specified repository, reference, and workflow with statuses 'Running' or 'Waiting'.
173+
// CancelPreviousJobs cancels all previous jobs of the same repository, reference, workflow, and event.
174+
// It's useful when a new run is triggered, and all previous runs needn't be continued anymore.
175+
func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error {
176+
// Find all runs in the specified repository, reference, and workflow with non-final status
176177
runs, total, err := db.FindAndCount[ActionRun](ctx, FindRunOptions{
177178
RepoID: repoID,
178179
Ref: ref,
179180
WorkflowID: workflowID,
180181
TriggerEvent: event,
181-
Status: []Status{StatusRunning, StatusWaiting},
182+
Status: []Status{StatusRunning, StatusWaiting, StatusBlocked},
182183
})
183184
if err != nil {
184185
return err

models/actions/schedule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository) er
127127
return fmt.Errorf("DeleteCronTaskByRepo: %v", err)
128128
}
129129
// cancel running cron jobs of this repository and delete old schedules
130-
if err := CancelRunningJobs(
130+
if err := CancelPreviousJobs(
131131
ctx,
132132
repo.ID,
133133
repo.DefaultBranch,
134134
"",
135135
webhook_module.HookEventSchedule,
136136
); err != nil {
137-
return fmt.Errorf("CancelRunningJobs: %v", err)
137+
return fmt.Errorf("CancelPreviousJobs: %v", err)
138138
}
139139
return nil
140140
}

models/activities/notification_list.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
user_model "code.gitea.io/gitea/models/user"
1515
"code.gitea.io/gitea/modules/container"
1616
"code.gitea.io/gitea/modules/log"
17+
"code.gitea.io/gitea/modules/util"
1718

1819
"xorm.io/builder"
1920
)
@@ -470,3 +471,31 @@ func (nl NotificationList) LoadComments(ctx context.Context) ([]int, error) {
470471
}
471472
return failures, nil
472473
}
474+
475+
// LoadIssuePullRequests loads all issues' pull requests if possible
476+
func (nl NotificationList) LoadIssuePullRequests(ctx context.Context) error {
477+
issues := make(map[int64]*issues_model.Issue, len(nl))
478+
for _, notification := range nl {
479+
if notification.Issue != nil && notification.Issue.IsPull && notification.Issue.PullRequest == nil {
480+
issues[notification.Issue.ID] = notification.Issue
481+
}
482+
}
483+
484+
if len(issues) == 0 {
485+
return nil
486+
}
487+
488+
pulls, err := issues_model.GetPullRequestByIssueIDs(ctx, util.KeysOfMap(issues))
489+
if err != nil {
490+
return err
491+
}
492+
493+
for _, pull := range pulls {
494+
if issue := issues[pull.IssueID]; issue != nil {
495+
issue.PullRequest = pull
496+
issue.PullRequest.Issue = issue
497+
}
498+
}
499+
500+
return nil
501+
}

models/asymkey/ssh_key_authorized_keys.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ func RegeneratePublicKeys(ctx context.Context, t io.StringWriter) error {
139139
if err != nil {
140140
return err
141141
}
142+
defer f.Close()
143+
142144
scanner := bufio.NewScanner(f)
143145
for scanner.Scan() {
144146
line := scanner.Text()
@@ -148,15 +150,12 @@ func RegeneratePublicKeys(ctx context.Context, t io.StringWriter) error {
148150
}
149151
_, err = t.WriteString(line + "\n")
150152
if err != nil {
151-
f.Close()
152153
return err
153154
}
154155
}
155-
err = scanner.Err()
156-
if err != nil {
157-
return fmt.Errorf("scan: %w", err)
156+
if err = scanner.Err(); err != nil {
157+
return fmt.Errorf("RegeneratePublicKeys scan: %w", err)
158158
}
159-
f.Close()
160159
}
161160
return nil
162161
}

models/avatars/avatar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
const (
2626
// DefaultAvatarClass is the default class of a rendered avatar
27-
DefaultAvatarClass = "ui avatar gt-vm"
27+
DefaultAvatarClass = "ui avatar tw-align-middle"
2828
// DefaultAvatarPixelSize is the default size in pixels of a rendered avatar
2929
DefaultAvatarPixelSize = 28
3030
)

models/db/context.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ func (c *halfCommitter) Close() error {
120120

121121
// TxContext represents a transaction Context,
122122
// it will reuse the existing transaction in the parent context or create a new one.
123+
// Some tips to use:
124+
//
125+
// 1 It's always recommended to use `WithTx` in new code instead of `TxContext`, since `WithTx` will handle the transaction automatically.
126+
// 2. To maintain the old code which uses `TxContext`:
127+
// a. Always call `Close()` before returning regardless of whether `Commit()` has been called.
128+
// b. Always call `Commit()` before returning if there are no errors, even if the code did not change any data.
129+
// c. Remember the `Committer` will be a halfCommitter when a transaction is being reused.
130+
// So calling `Commit()` will do nothing, but calling `Close()` without calling `Commit()` will rollback the transaction.
131+
// And all operations submitted by the caller stack will be rollbacked as well, not only the operations in the current function.
132+
// d. It doesn't mean rollback is forbidden, but always do it only when there is an error, and you do want to rollback.
123133
func TxContext(parentCtx context.Context) (*Context, Committer, error) {
124134
if sess, ok := inTransaction(parentCtx); ok {
125135
return newContext(parentCtx, sess, true), &halfCommitter{committer: sess}, nil

models/issues/comment_code.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
7474
return nil, err
7575
}
7676

77+
if err := comments.LoadAttachments(ctx); err != nil {
78+
return nil, err
79+
}
80+
7781
// Find all reviews by ReviewID
7882
reviews := make(map[int64]*Review)
7983
ids := make([]int64, 0, len(comments))

models/issues/issue.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,6 @@ func (issue *Issue) IsTimetrackerEnabled(ctx context.Context) bool {
193193
return issue.Repo.IsTimetrackerEnabled(ctx)
194194
}
195195

196-
// GetPullRequest returns the issue pull request
197-
func (issue *Issue) GetPullRequest(ctx context.Context) (pr *PullRequest, err error) {
198-
if !issue.IsPull {
199-
return nil, fmt.Errorf("Issue is not a pull request")
200-
}
201-
202-
pr, err = GetPullRequestByIssueID(ctx, issue.ID)
203-
if err != nil {
204-
return nil, err
205-
}
206-
pr.Issue = issue
207-
return pr, err
208-
}
209-
210196
// LoadPoster loads poster
211197
func (issue *Issue) LoadPoster(ctx context.Context) (err error) {
212198
if issue.Poster == nil && issue.PosterID != 0 {

0 commit comments

Comments
 (0)