Commit Graph
100 Commits
Author SHA1 Message Date
Jason Songanddelvh e73d0109bc Update web_src/js/components/RepoActionView.vue
Co-authored-by: delvh <dev.lh@web.de>
2023-01-11 14:57:33 +08:00
Jason Song b171042351 Merge branch 'main' into feature/bots 2023-01-11 09:39:19 +08:00
Jason Song 883781cf6e Merge branch 'main' into feature/bots 2023-01-10 18:32:50 +08:00
Jason Song 409f11cb73 feat: use template modal 2023-01-10 18:30:18 +08:00
Jason Song 39a5e72c3c chore: update go-licenses 2023-01-10 15:34:46 +08:00
Jason Song e65f69f52e Merge branch 'main' into feature/bots 2023-01-10 15:18:48 +08:00
Jason Song 5442440b5e fix: order by index 2023-01-10 11:52:51 +08:00
Jason Song 335873e1d8 chore: remove exp 2023-01-10 10:37:20 +08:00
Jason Songandtechknowlogick a35714372d Fix halfCommitter and WithTx (#22366)
Related to #22362.

I overlooked that there's always `committer.Close()`, like:

```go
		ctx, committer, err := db.TxContext(db.DefaultContext)
		if err != nil {
			return nil
		}
		defer committer.Close()

		// ...

		if err != nil {
			return nil
		}

		// ...

		return committer.Commit()
```

So the `Close` of `halfCommitter` should ignore `commit and close`, it's
not a rollback.

See: [Why `halfCommitter` and `WithTx` should rollback IMMEDIATELY or
commit
LATER](https://github.com/go-gitea/gitea/pull/22366#issuecomment-1374778612).

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-01-09 12:19:19 -05:00
Jason Song 3c2bffd818 Merge branch 'main' into feature/bots 2023-01-09 14:08:06 +08:00
Jason Song f114a9c80a fix: ctx for NewCommitStatus 2023-01-09 14:01:09 +08:00
Jason Song 9e94346529 Remove satori/go.uuid (#22375)
`github.com/satori/go.uuid` is no longer used, so the `replace` is not
needed now
2023-01-09 01:00:10 -05:00
Jason Song f414fd6141 Merge branch 'main' into feature/bots 2023-01-09 12:17:08 +08:00
Jason SongandLunny Xiao 7adc2de464 Use context parameter in models/git (#22367)
After #22362, we can feel free to use transactions without
`db.DefaultContext`.

And there are still lots of models using `db.DefaultContext`, I think we
should refactor them carefully and one by one.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-01-09 11:50:54 +08:00
Jason Song 5e9d4f7b9c Merge branch 'main' into feature/bots 2023-01-09 10:42:38 +08:00
Jason Song 6135359a04 Always reuse transaction (#22362) 2023-01-08 09:34:58 +08:00
Jason Song 4b2bf7a512 Merge branch 'main' into feature/bots 2023-01-06 20:47:41 +08:00
Jason Song 21db670907 fix: use webhook_module 2023-01-06 20:46:36 +08:00
Jason Song 4c65c1d8b0 Merge branch 'main' into feature/bots 2023-01-06 20:32:23 +08:00
Jason Song 3dbd2d942b Remove old HookEventType (#22358)
Supplement to #22256.
2023-01-06 19:49:14 +08:00
Jason Song 4ebd096b86 fix: remove spaces between labels 2023-01-06 18:13:56 +08:00
Jason Song e249b39224 chore: rename to actions.runners.last_online 2023-01-06 18:08:43 +08:00
Jason Song 748fd3d085 chore: add init.go to actions 2023-01-06 18:06:12 +08:00
Jason Song 4b1d3c75d5 fix: ignore events caused by actions for actions notifier only 2023-01-06 17:21:07 +08:00
Jason Song fc1d24368e chore: remove fetchMockData 2023-01-06 16:32:57 +08:00
Jason Song aba1c03fee feat: improve listing runs 2023-01-06 16:29:10 +08:00
Jason Song 6f6bfc5d51 feat: more translations 2023-01-06 15:55:47 +08:00
Jason Song e61d655929 feat: show no runners available 2023-01-06 15:33:02 +08:00
Jason Song 7a4d4f0edf chore: use new dropdown icon 2023-01-06 15:15:30 +08:00
Jason Song 243b769754 feat: locale status for runner 2023-01-06 15:07:44 +08:00
Jason Song 91dfef0425 feat: LocaleString for status 2023-01-06 15:02:03 +08:00
Jason Song a6f8f10670 fix: add docs link for runner 2023-01-06 14:41:07 +08:00
Jason Song 4bc6d73b1d fix: split and trim labels 2023-01-06 14:28:16 +08:00
Jason Song 05c08ec246 chore: format runner id 2023-01-06 14:12:14 +08:00
Jason Song 326ae5d442 fix: keep original commit message 2023-01-06 13:51:40 +08:00
Jason Song ff75cbd81d chore: fix log 2023-01-06 13:47:45 +08:00
Jason Song 9bd3ea49f4 fix: map to DEFAULT_ACTIONS_URL 2023-01-06 10:50:01 +08:00
Jason Song d7aa501ba1 fix: NumClosedActionRuns 2023-01-06 09:57:36 +08:00
Jason Song a4df058d75 Merge branch 'main' into feature/bots 2023-01-06 09:37:44 +08:00
Jason Song 49e307b968 fix: show never when LastOnline is 0 2023-01-05 18:24:16 +08:00
Jason Song 2ac8410bab fix: translation keys 2023-01-05 18:24:16 +08:00
Jason SongandChristopherHX 63e82382fc Update models/actions/task_step.go
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2023-01-05 18:05:07 +08:00
Jason SongandChristopherHX 22496aa57e Update models/actions/task.go
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2023-01-05 18:04:23 +08:00
Jason Song 730af9be50 fix: add missing translations 2023-01-05 17:59:21 +08:00
Jason Song 92b117f930 test: fix import cycle in dbfs test 2023-01-05 17:23:13 +08:00
Jason Song b1013a4770 refactor: shard runner templates 2023-01-05 16:40:20 +08:00
Jason Song a4b2cf2426 feat: calculate duration 2023-01-05 16:19:08 +08:00
Jason Song c510fdbcf1 chore: simplify IsActions 2023-01-05 16:03:21 +08:00
Jason Song eee662442a fix: simplify deleting 2023-01-05 15:40:19 +08:00
Jason Song c3d7f15513 chore: remove CreateRunnerForm 2023-01-05 15:20:02 +08:00
Jason Song 08383bdcbc chore: simplify truncateContent 2023-01-05 15:16:14 +08:00
Jason Song 4bb8604180 chore: add comments 2023-01-05 14:58:49 +08:00
Jason Song e8dbe827cb fix: use %w 2023-01-05 14:45:40 +08:00
Jason Song bb3eb5efdc fix: use ctx 2023-01-05 14:44:09 +08:00
Jason Song ede9a5f2fa chore: add comments 2023-01-05 14:43:07 +08:00
Jason Song 60173297aa chore: lint codes 2023-01-05 12:14:56 +08:00
Jason Song 24446cbebe fix: add less for runners 2023-01-05 12:03:10 +08:00
Jason Songanddelvh b884772652 Apply suggestions from code review
Co-authored-by: delvh <dev.lh@web.de>
2023-01-05 11:59:32 +08:00
Jason Song 2ae7f5434c Merge branch 'main' into feature/bots 2023-01-05 10:55:47 +08:00
Jason Song b4c692a2bb chore: format code 2023-01-05 10:49:50 +08:00
Jason Songanddelvh c3b37c4e44 Update services/actions/clear_tasks.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 20:39:18 +08:00
Jason Songanddelvh 066097a0fb Update services/forms/runner.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 20:38:24 +08:00
Jason Songanddelvh e35a046c7a Update services/auth/basic.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 20:36:09 +08:00
Jason Song 0d2945fe4d Merge branch 'main' into feature/bots 2023-01-04 18:57:57 +08:00
Jason Song 4b15a33257 chore: format code 2023-01-04 18:57:10 +08:00
Jason Songanddelvh 0ecb0b46ad Update modules/setting/actions.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 18:55:15 +08:00
Jason Song 925f7f18f5 chore: new way to trim entries 2023-01-04 18:52:22 +08:00
Jason Song a222cb5c1e docs: fix format 2023-01-04 18:52:22 +08:00
Jason Song 95167fd0a2 chore: rename to NumActionRuns 2023-01-04 18:52:22 +08:00
Jason Song 6148e4c940 fix: rename to GetPossibleUserByID 2023-01-04 18:52:22 +08:00
Jason Song 0887e98f2a refactor: getPoster 2023-01-04 18:52:22 +08:00
Jason Song 911aea15a6 docs: add actions to cheat sheet 2023-01-04 18:52:22 +08:00
Jason Song d5e6d959eb refactor: rename Number to Index 2023-01-04 18:52:22 +08:00
Jason Song 2c686e8826 fix: add restraints for models 2023-01-04 18:52:22 +08:00
Jason Song 7f6a803d24 fix: omit total in FindTasks 2023-01-04 18:52:22 +08:00
Jason Song 5d938ebf4e fix: use container.Set 2023-01-04 18:52:21 +08:00
Jason Song 5925722501 chore: move statusNames 2023-01-04 18:52:21 +08:00
Jason Song 5e58ede989 docs: comment for DEFAULT_ACTIONS_URL 2023-01-04 18:52:21 +08:00
Jason Song d33e9fc11c chore: sort svgs 2023-01-04 18:52:21 +08:00
Jason Song cd2af5d4f2 fix: check if steps are empty 2023-01-04 18:52:21 +08:00
Jason Songanddelvh 66785e2450 Update modules/actions/log.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 18:35:39 +08:00
Jason Songanddelvh 1faa8856a4 Update models/user/user_system.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 18:30:02 +08:00
Jason Songanddelvh 0f824b693c Update models/user/user_system.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 18:28:31 +08:00
Jason Songanddelvh 9b00ded1fb Update models/actions/task_list.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 16:11:17 +08:00
Jason Songanddelvh 2917057b00 Update models/actions/status.go
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 15:37:55 +08:00
Jason Songanddelvh 9b0203bcc1 Update custom/conf/app.example.ini
Co-authored-by: delvh <dev.lh@web.de>
2023-01-04 14:50:02 +08:00
Jason Song 53afbcecad Merge branch 'main' into feature/bots 2023-01-03 09:43:23 +08:00
f8e93ce423 Reminder for no more logs to console (#22282)
Even if the log mode is `file`, there are still few logs printed to the
console at the very beginning.

That's fine but confusing. Someone will think the console is the only
place to find logs, and get nothing helpful. See
https://github.com/go-gitea/gitea/issues/22274#issuecomment-1367917717.

There should be a reminder that there are no more logs to the console.

And to avoid log loss, we should add configured loggers first, then
remove console logger if there's no `console` in the mode.

Tests with `MODE = file`:

Before:
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/210079862-d591677f-347e-46ed-a548-bb2ddbb0885c.png">

After:
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/210080002-d66cc418-6888-4909-b370-d03f5986ef41.png">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2023-01-01 22:00:33 +08:00
Jason Song e5deeda0aa Support estimated count with multiple schemas (#22276)
The `EstimateCount` could be incorrect when the table lives in multiple
schemas. Related to #19775.
2022-12-30 12:25:58 -06:00
d34f3a2213 Fix sitemap (#22272)
Fix #22270.

Related to #18407.

The old code treated both sitemap and sitemap index as the format like:

```xml
...
<url>
  <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc>
</url>
...
```

Actually, it's incorrect for sitemap index, it should be:

```xml
...
<sitemap>
  <loc>http://localhost:3000/explore/users/sitemap-1.xml</loc>
</sitemap>
...
```

See https://www.sitemaps.org/protocol.html

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: delvh <dev.lh@web.de>
2022-12-30 23:31:00 +08:00
Jason Song 133437d4eb Merge branch 'main' into feature/bots 2022-12-30 09:36:51 +08:00
Jason Songanddelvh 47efba78ec Support template for merge message description (#22248)
Fix #21435.

Use the first line of the template as the git commit message title, and
the rest as the description.

## Snapshots

<img width="806" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644083-5d85179c-cf58-404f-bc98-c662398a2411.png">
<img width="860" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644392-22573090-e2c1-458b-ba44-855b79735632.png">
<img width="1154" alt="image"
src="https://user-images.githubusercontent.com/9418365/209644457-a1b2711a-6787-45b4-b52c-a88d7fc132d7.png">

Co-authored-by: delvh <dev.lh@web.de>
2022-12-29 14:40:20 +02:00
Jason Song 3db95bfbad fix: check oauth2 user id 2022-12-29 17:33:47 +08:00
Jason Song a145ec2f2b fix: do not init actions service when disabled 2022-12-29 16:19:25 +08:00
Jason Song 5ae2816ac4 chore: use webhook_model alias 2022-12-29 16:06:59 +08:00
Jason Song ec020563ae refactor: mv modules/notification/actions to services/actions 2022-12-29 16:05:00 +08:00
Jason Song c84094011e fix: import 2022-12-29 15:02:10 +08:00
Jason Song f11a31e54e Merge branch 'main' into feature/bots 2022-12-29 14:51:21 +08:00
Jason Song 8717c428ea fix: CanRerun 2022-12-29 14:48:45 +08:00
Jason Song 6bbce09e7d fix: remove old secrets tab 2022-12-29 14:32:45 +08:00