Commit Graph
100 Commits
Author SHA1 Message Date
Jason Song d4c47acff4 fix: remove useless grpc routers 2022-12-12 17:29:34 +08:00
Jason Song cca23dd4af feat: rename bot user to gitea-actions 2022-12-12 17:29:34 +08:00
Jason Song 5cfc48c288 fix: template format 2022-12-12 17:29:34 +08:00
Jason Song d41fb40fb5 docs: comment for V1AlphaRoute 2022-12-12 17:29:34 +08:00
Jason Song 59c3707da2 Merge branch 'main' into feature/bots 2022-12-12 13:33:24 +08:00
Jason Song a6e39ca180 Merge branch 'main' into feature/bots 2022-12-12 13:12:58 +08:00
Jason Song 4da0a65511 chore: migrations v236 2022-12-12 13:12:00 +08:00
Jason Song dbdfd2647c chore: rename to workflows.go 2022-12-12 13:09:17 +08:00
Jason Song 86d6598a54 fix: use LONGBLOB 2022-12-12 13:08:49 +08:00
Jason Song 7a34d37aad fix: use ctx 2022-12-12 11:05:22 +08:00
Jason Song dbef504584 fix: truncated title 2022-12-12 10:54:28 +08:00
Jason Songanda1012112796 22203eeb38 Update modules/notification/actions/helper.go
Co-authored-by: a1012112796 <1012112796@qq.com>
2022-12-12 10:48:32 +08:00
Jason Song dfa1b6168d Merge branch 'main' into feature/bots 2022-12-12 10:46:13 +08:00
Jason Song 2779d47ad3 Optimize html templates (#22080)
Replace `active{{end}} item` with `active{{end}} item`.
2022-12-09 21:34:51 +08:00
Jason Song d378a78c79 Merge branch 'main' into feature/bots 2022-12-09 16:20:28 +08:00
Jason Song 901914e34b feat: move summary to header 2022-12-09 16:14:45 +08:00
Jason Song 9b6b848311 fix: layout 2022-12-09 15:47:58 +08:00
Jason Song 10ebbeca2f chore: rename to action 2022-12-09 15:29:26 +08:00
Jason Song 8fb1e53ca2 Rename actions to operations on UI (#22067)
Use "operations" to indicate "some something can be done", to prevent
users from confusing it with CICD.

Releated to: #13539.

Snapshots:

<img width="389" alt="image"
src="https://user-images.githubusercontent.com/9418365/206409797-a99bac25-2d38-4066-b9ab-27a4f6fe67e7.png">
<img width="398" alt="image"
src="https://user-images.githubusercontent.com/9418365/206410099-bbd258a9-54d9-4664-8d95-31d29cb35209.png">
<img width="442" alt="image"
src="https://user-images.githubusercontent.com/9418365/206410218-009a3103-a9b9-4d0c-86b6-540dda5bce89.png">

I'm not a native English speaker, but I think "operations" may be good
enough, and Gitea already uses this word:

<img width="1440" alt="image"
src="https://user-images.githubusercontent.com/9418365/206410671-4a718b14-0603-40cb-bdcb-f6f84d1f5e24.png">
2022-12-08 21:14:09 +08:00
Jason Song 266a122ba2 Merge branch 'main' into feature/bots 2022-12-08 18:11:18 +08:00
Jason Song 49143952fa fix: remove timestamp 2022-12-08 18:08:17 +08:00
Jason Song 3dc7ffc925 fix: add settings.actions_desc 2022-12-08 17:41:25 +08:00
Jason Song 0a85537c79 Support disabling database auto migration (#22053)
Gitea will migrate the database model version automatically, but it
should be able to be disabled and keep Gitea shutdown if the version is
not matched.
2022-12-07 09:58:31 -06:00
Jason Song 202bbe27c0 docs: update comparison 2022-12-07 17:35:05 +08:00
Jason Song 8377fc00d6 Merge branch 'main' into feature/bots 2022-12-07 09:45:18 +08:00
Jason Song 26b87561b6 fix: deal with empty repo 2022-12-06 18:32:26 +08:00
Jason Song eaf266a635 chore: fix lint 2022-12-06 16:58:49 +08:00
Jason Song ab0a60e56a Merge branch 'main' into feature/bots 2022-12-06 16:39:06 +08:00
Jason Song 55df4fd3e9 chore: rename BOTS 2022-12-06 16:24:27 +08:00
Jason Song f6f29d4cbf chore: upgrade act to v0.234.0 2022-12-06 16:23:18 +08:00
Jason Song 4142218088 chore: rename dbfs prefix 2022-12-06 16:13:29 +08:00
Jason Song 74874d065f Fix issue/PR numbers (#22037)
When deleting a closed issue, we should update both `NumIssues`and
`NumClosedIssues`, or `NumOpenIssues`(`= NumIssues -NumClosedIssues`)
will be wrong. It's the same for pull requests.

Releated to #21557.

Alse fixed two harmless problems:

- The SQL to check issue/PR total numbers is wrong, that means it will
update the numbers even if they are correct.
- Replace legacy `num_issues = num_issues + 1` operations with
`UpdateRepoIssueNumbers`.
2022-12-06 15:53:09 +08:00
Jason Song da51e18cc0 chore: make go-licenses 2022-12-06 15:27:48 +08:00
Jason Song 223782ca4c refactor: rename to actions 2022-12-06 15:16:25 +08:00
Jason Song 56368f3963 refactor: use ctx in models 2022-12-06 14:15:48 +08:00
Jason Song c07d0c1768 refactor: rename model 2022-12-06 13:48:09 +08:00
Jason Song f2c7bbb0bc refactor: rename to actions-proto-go 2022-12-06 13:44:23 +08:00
Jason Song 67c5c8868b refactor: rename import alias 2022-12-05 15:57:45 +08:00
Jason Song 5f74b35377 refactor: rename files 2022-12-05 15:52:32 +08:00
Jason Song 704f72017d refactor: rename packages 2022-12-05 15:45:38 +08:00
Jason Song fdd3444c52 fix: add missing ctx 2022-12-05 14:46:34 +08:00
Jason Song bd1af5b7f8 Merge branch 'main' into feature/bots 2022-12-05 14:31:00 +08:00
Jason Song b0d6c7b86e chore: use SPDX-License-Identifier 2022-12-02 22:25:31 +08:00
Jason Song d4842ac45b chore: resolve conflict 2022-12-02 22:23:18 +08:00
Jason Song 76869e4b76 Merge branch 'main' into feature/bots 2022-12-02 22:17:49 +08:00
Jason SongandLunny Xiao f59a74852b Update gitea-vet to check FSFE REUSE (#22004)
Related to:
- #21840
- https://gitea.com/gitea/gitea-vet/pulls/21

What it looks like when it's working:
https://drone.gitea.io/go-gitea/gitea/64040/1/5

All available SPDX license identifiers: [SPDX License
List](https://spdx.org/licenses/).

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-02 22:14:57 +08:00
Jason Song 3dc5547775 Merge branch 'main' into feature/bots 2022-12-02 21:05:31 +08:00
Jason Song b9ab9b21c6 Merge branch 'go-gitea:main' into feature/bots 2022-12-02 13:28:14 +08:00
Jason Song f869c988a5 chore: resolve conflict 2022-12-02 11:17:41 +08:00
Jason Song 9bd773eb85 Merge branch 'main' into feature/bots 2022-12-02 09:42:42 +08:00
Jason SongandLunny Xiao f9cbf5a1bc Util type to parse ref name (#21969)
Provide a new type to make it easier to parse a ref name.

Actually, it's picked up from #21937, to make the origin PR lighter.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-01 19:56:04 +08:00
Jason Song 4e5d4d0073 Skip initing LFS storage if disabled (#21996)
A complement to #21985.

I overlooked it because the name of the switch is `StartServer`, not
`Enabled`. I believe the weird name is a legacy, but renaming is out of
scope.
2022-12-01 11:02:04 +02:00
Jason Song d2a4c10bc7 chore: code lint 2022-12-01 15:39:28 +08:00
Jason Song b2745bff43 feat: support disable bots completely 2022-12-01 15:27:28 +08:00
Jason Song ab69fdc6fe feat: more notifications 2022-12-01 14:13:22 +08:00
Jason Song a29babebd0 fix: skip initing bots storage if disabled 2022-12-01 13:42:48 +08:00
Jason Song c5c9b4ae57 Merge branch 'main' into feature/bots 2022-12-01 13:39:47 +08:00
Jason Song 67881ae99a Skip initing disabled storages (#21985)
If `Attachment` or `Packages` are disabled, we don't have to init the
storages for them.
2022-11-30 21:39:02 +08:00
Jason Song 847d65d724 Merge branch 'main' into feature/bots 2022-11-30 18:25:36 +08:00
Jason Song 4487f04b14 feat: new way to notify 2022-11-30 18:24:47 +08:00
Jason Song 9808d084ba fix: remove useless codes 2022-11-30 16:07:00 +08:00
Jason Song 26ac9ab57d Merge branch 'go-gitea:main' into feature/bots 2022-11-30 16:05:24 +08:00
Jason Song 3682fc3883 Merge branch 'main' into feature/bots 2022-11-29 18:50:02 +08:00
Jason Song 3793d55eca fix: commit status 2022-11-29 18:48:00 +08:00
Jason Song 564937a657 feat: bots_service.CreateCommitStatus 2022-11-29 18:21:27 +08:00
Jason Song 8f2efdaf60 chore: add dbfs to migration 2022-11-29 17:19:26 +08:00
Jason Song c1fce2cf7d feat: remove bots resources after deleting repo 2022-11-29 16:25:58 +08:00
Jason Song e33d4d7700 fix: rename table name string 2022-11-29 13:47:09 +08:00
Jason Song 04d72d3500 refactor: rename tables to bot_* 2022-11-29 12:34:23 +08:00
Jason Song 3ac6bf3db4 fix: avoid hash uuid 2022-11-29 11:42:03 +08:00
Jason Song 797c21de1f Merge branch 'main' into feature/bots 2022-11-29 11:09:20 +08:00
Jason Song f047ee0a40 Use random bytes to generate access token (#21959) 2022-11-28 23:37:42 +08:00
Jason Song 9607750b5e Replace fmt.Sprintf with hex.EncodeToString (#21960)
`hex.EncodeToString` has better performance than `fmt.Sprintf("%x",
[]byte)`, we should use it as much as possible.

I'm not an extreme fan of performance, so I think there are some
exceptions:

- `fmt.Sprintf("%x", func(...)[N]byte())`
- We can't slice the function return value directly, and it's not worth
adding lines.
    ```diff
    func A()[20]byte { ... }
    - a := fmt.Sprintf("%x", A())
    - a := hex.EncodeToString(A()[:]) // invalid
    + tmp := A()
    + a := hex.EncodeToString(tmp[:])
    ```
- `fmt.Sprintf("%X", []byte)`
- `strings.ToUpper(hex.EncodeToString(bytes))` has even worse
performance.
2022-11-28 11:19:18 +00:00
Jason Song 6f5c3feb2d fix: register bots notifier when enabled only 2022-11-28 18:24:09 +08:00
Jason Song e37b3911d8 fix: use ref in options 2022-11-28 18:21:49 +08:00
Jason Song 66b558017f Merge branch 'main' into feature/bots 2022-11-28 17:23:53 +08:00
Jason Song dccddd045e test: init bot storage path 2022-11-28 17:19:15 +08:00
Jason Song 0c1d568e1d chore: fix mods 2022-11-28 15:08:02 +08:00
Jason Song e1c1d36234 fix: remove http2 support 2022-11-28 14:52:23 +08:00
Jason Song ae018b6b48 fix: use PutVarint instead of AppendVarint 2022-11-26 22:41:03 +08:00
Jason Song ef4b3673dd chore: golang lint 2022-11-26 22:12:52 +08:00
Jason Song bfe0fc1533 chore: replace spaces 2022-11-26 21:42:02 +08:00
Jason Song dc48bf21c6 chore: add copyright 2022-11-26 21:33:05 +08:00
Jason Song 7854178da4 chore: fix duplicate to satisfy 2022-11-26 20:51:45 +08:00
Jason Song 0bd9553219 chore: golang lint 2022-11-26 20:14:03 +08:00
Jason Song 3b119f3d78 chore: npm install --package-lock-only 2022-11-25 22:27:34 +08:00
Jason Song 6af809d0bd chore: lint front 2022-11-25 22:27:34 +08:00
Jason Song 02fac6b5f0 Merge branch 'main' into feature/bots 2022-11-25 18:20:31 +08:00
Jason Song 378e1f8d01 chore: fix problems caused by rebase 2022-11-25 17:58:34 +08:00
Jason Song 295a7f68c8 feat: update job info 2022-11-25 17:48:48 +08:00
Jason Song 1886156329 chore: remove outdated todos 2022-11-25 17:48:48 +08:00
Jason Song 4814a6ad1b fix: fill more contexts 2022-11-25 17:48:48 +08:00
Jason Song fdd3c0434e feat: add IsForkPullRequest 2022-11-25 17:48:48 +08:00
Jason Song 6ad8bddabf feat: GetRunningTaskByToken 2022-11-25 17:48:48 +08:00
Jason Song e346581344 chore: update grpc router path 2022-11-25 17:48:48 +08:00
Jason Song 48f5c152b9 chore: mod tidy 2022-11-25 17:48:48 +08:00
Jason Song 96d9b729ee chore: upgrade act 2022-11-25 17:48:48 +08:00
Jason Song d17a0b13f1 chore: use bots-proto-go v0.1.0 2022-11-25 17:48:48 +08:00
Jason Song ea1bc1b662 chore: replace with code.gitea.io/bots-proto-go 2022-11-25 17:48:48 +08:00
Jason Song 736275f0b1 feat: support cancel button 2022-11-25 17:48:48 +08:00