build: move backend-checks CI checks to Makefile: make pr-go #11053

Merged
Gusted merged 1 commit from slink/forgejo:make-pr-go into forgejo 2026-02-17 02:41:43 +01:00
Contributor

This is to have a simple and consistent make target for developers to locally run the checks which the CI will also run. The goal is to avoid wasting review cycles on CI failures.

To have a single source of truth, the CI is adjusted to call the same make target. Additional checks should no longer be added to the CI workflow, but rather to the makefile.

The pull request template is adjusted to remind of running this make target.

CI output is improved by using a simple bash script which uses sed to add ##[group] tags to "make --debug=b" output and filter out messages which usually do not contribute to understanding. While this approach has limits and depends on the specific debug output format of GNU make, it avoids adjusting the makefile itself for additional CI beautification, contributing to maintainability.

  • no tests needed (this is purely a build change)
  • docs: hint added to PR template
  • no release notes nedded
This is to have a simple and consistent make target for developers to locally run the checks which the CI will also run. The goal is to avoid wasting review cycles on CI failures. To have a single source of truth, the CI is adjusted to call the same make target. Additional checks should no longer be added to the CI workflow, but rather to the makefile. The pull request template is adjusted to remind of running this make target. CI output is improved by using a simple bash script which uses sed to add `##[group]` tags to "make --debug=b" output and filter out messages which usually do not contribute to understanding. While this approach has limits and depends on the specific debug output format of GNU make, it avoids adjusting the makefile itself for additional CI beautification, contributing to maintainability. - no tests needed (this is purely a build change) - docs: hint added to PR template - no release notes nedded
Gusted left a comment
Owner

Otherwise sounds like a nice improvement. Maybe also should be mentioned on https://forgejo.org/docs/latest/contributor/testing/?

Otherwise sounds like a nice improvement. Maybe also should be mentioned on https://forgejo.org/docs/latest/contributor/testing/?
@ -13,3 +13,3 @@
The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).
### Tests
### Tests for GO changes
Owner

S/GO/Go

S/GO/Go
Gusted marked this conversation as resolved
slink force-pushed make-pr-go from 63b685a960
Some checks are pending
requirements / merge-conditions (pull_request) Waiting to run
testing / backend-checks (pull_request) Waiting to run
testing / frontend-checks (pull_request) Waiting to run
testing / test-unit (pull_request) Blocked by required conditions
testing / test-e2e (pull_request) Blocked by required conditions
testing / test-remote-cacher (redis) (pull_request) Blocked by required conditions
testing / test-remote-cacher (valkey) (pull_request) Blocked by required conditions
testing / test-remote-cacher (garnet) (pull_request) Blocked by required conditions
testing / test-remote-cacher (redict) (pull_request) Blocked by required conditions
testing / test-mysql (pull_request) Blocked by required conditions
testing / test-pgsql (pull_request) Blocked by required conditions
testing / test-sqlite (pull_request) Blocked by required conditions
testing / security-check (pull_request) Blocked by required conditions
issue-labels / release-notes (pull_request_target) Waiting to run
Integration tests for the release process / release-simulation (pull_request) Successful in 5m49s
issue-labels / backporting (pull_request_target) Has been skipped
issue-labels / cascade (pull_request_target) Has been skipped
to 59e2a8874f
Some checks failed
Integration tests for the release process / release-simulation (pull_request) Successful in 6m27s
testing / frontend-checks (pull_request) Successful in 1m22s
testing / backend-checks (pull_request) Successful in 6m1s
testing / test-unit (pull_request) Successful in 4m18s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m14s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m11s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m1s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m4s
testing / test-e2e (pull_request) Successful in 24m0s
testing / test-mysql (pull_request) Successful in 27m28s
testing / test-sqlite (pull_request) Successful in 35m6s
testing / test-pgsql (pull_request) Successful in 39m40s
testing / security-check (pull_request) Successful in 1m12s
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Failing after 3s
2026-01-26 14:06:30 +01:00
Compare
slink referenced this pull request from a commit 2026-01-26 14:15:30 +01:00
slink referenced this pull request from a commit 2026-01-26 14:16:59 +01:00
Author
Contributor

Changed GO into Go and docs pr opened: forgejo/docs#1714

Changed GO into Go and docs pr opened: https://codeberg.org/forgejo/docs/pulls/1714
@ -26,3 +26,2 @@
- uses: ./.forgejo/workflows-composite/setup-env
- run: su forgejo -c 'make deps-backend deps-tools'
- run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check lint-swagger fmt-check swagger-validate' # ensure the "go-licenses" make target runs
- run: su forgejo -c 'make -j$(nproc) pr-go'
Owner

i would suggest to split it tioo multiple run commands for easier failure analyzation on failues. It's currently hard to find what fails

i would suggest to split it tioo multiple run commands for easier failure analyzation on failues. It's currently hard to find what fails
Author
Contributor

that would counter-act the goal of having a single source of truth.
If we have one thing in the CI and another in the Makefile, they will diverge again.

Should we maybe have a some magic string to make the CI format the output nicely?

that would counter-act the goal of having a single source of truth. If we have one thing in the CI and another in the `Makefile`, they will diverge again. Should we maybe have a some magic string to make the CI format the output nicely?
Owner

not sure, i don't know if log grouping works on forgejo actions

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#grouping-log-lines

then we could detect actions and emit grouping commands on ci

not sure, i don't know if log grouping works on forgejo actions https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#grouping-log-lines then we could detect actions and emit grouping commands on ci
Owner

#3337, its supported.

https://codeberg.org/forgejo/forgejo/pulls/3337, its supported.
Owner

@Gusted wrote in #11053 (comment):

#3337, its supported.

ha, found it too now😅

@Gusted wrote in https://codeberg.org/forgejo/forgejo/pulls/11053#issuecomment-10174722: > #3337, its supported. ha, found it too now😅
Owner

we can use GITHUB_ACTIONS or FORGEJO_ACTIONS to detect

we can use `GITHUB_ACTIONS` or `FORGEJO_ACTIONS` to detect
Author
Contributor

Just CI?
I am trying to come up with something manageable for the Makefile...

Just `CI`? I am trying to come up with something manageable for the Makefile...
Owner
sure https://code.forgejo.org/forgejo/runner/src/commit/6721a406e5e6e5a07a9931d1d03fdcf4bbb0b48a/act/runner/run_context.go#L1360
slink changed title from build: move backend-checks CI checks to Makefile to WIP: build: move backend-checks CI checks to Makefile 2026-01-26 17:11:59 +01:00
slink force-pushed make-pr-go from 59e2a8874f
Some checks failed
Integration tests for the release process / release-simulation (pull_request) Successful in 6m27s
testing / frontend-checks (pull_request) Successful in 1m22s
testing / backend-checks (pull_request) Successful in 6m1s
testing / test-unit (pull_request) Successful in 4m18s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m14s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m11s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m1s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m4s
testing / test-e2e (pull_request) Successful in 24m0s
testing / test-mysql (pull_request) Successful in 27m28s
testing / test-sqlite (pull_request) Successful in 35m6s
testing / test-pgsql (pull_request) Successful in 39m40s
testing / security-check (pull_request) Successful in 1m12s
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Failing after 3s
to e3e271934c
Some checks failed
testing.yml / test a CI grouping idea (pull_request) Failing after 0s
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Failing after 2s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m13s
2026-01-26 17:15:31 +01:00
Compare
slink force-pushed make-pr-go from e3e271934c
Some checks failed
testing.yml / test a CI grouping idea (pull_request) Failing after 0s
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Failing after 2s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m13s
to 58fbedc17f
Some checks failed
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Failing after 1s
testing / frontend-checks (pull_request) Successful in 55s
testing / backend-checks (pull_request) Successful in 3m42s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m41s
testing / test-unit (pull_request) Successful in 4m38s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m8s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m13s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m6s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m9s
testing / test-e2e (pull_request) Successful in 19m30s
testing / test-sqlite (pull_request) Has been cancelled
testing / test-pgsql (pull_request) Has been cancelled
testing / test-mysql (pull_request) Has been cancelled
testing / security-check (pull_request) Has been cancelled
2026-01-26 17:23:02 +01:00
Compare
Author
Contributor

FTR: The following idea is nice, I think, because it does not require any changes to the makefile, but I found no way to replace the working directory output with the current target:

diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml
index d40d000c4e..1e0c1bbc17 100644
--- a/.forgejo/workflows/testing.yml
+++ b/.forgejo/workflows/testing.yml
@@ -24,7 +24,7 @@ jobs:
           EOF
       - uses: https://data.forgejo.org/actions/checkout@v6
       - uses: ./.forgejo/workflows-composite/setup-env
-      - run: su forgejo -c 'make -j$(nproc) pr-go'
+      - run: su forgejo -c './tools/cimake.sh pr-go'
       # this will re-run the backend target also contained in pr-go, but
       # a re-build is insignificant
       - uses: ./.forgejo/workflows-composite/build-backend
diff --git a/tools/cimake.sh b/tools/cimake.sh
new file mode 100755
index 0000000000..1d935120e5
--- /dev/null
+++ b/tools/cimake.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# GNU make wrapper for invocation from ci to generate grouping of output
+# without getting into the YAML madness of "what is a string"
+exec make -w -O -j$(nproc) "$@" 2>&1 | sed 's:^make\: Entering directory:\#\#[group]:;s:^make\: Leaving directory:\#\#[endgroup]:'

this produces:

image

But I am giving it up, because we should really have descriptive names for the groups

FTR: The following idea is nice, I think, because it does not require any changes to the makefile, but I found no way to replace the working directory output with the current target: ```diff diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index d40d000c4e..1e0c1bbc17 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -24,7 +24,7 @@ jobs: EOF - uses: https://data.forgejo.org/actions/checkout@v6 - uses: ./.forgejo/workflows-composite/setup-env - - run: su forgejo -c 'make -j$(nproc) pr-go' + - run: su forgejo -c './tools/cimake.sh pr-go' # this will re-run the backend target also contained in pr-go, but # a re-build is insignificant - uses: ./.forgejo/workflows-composite/build-backend diff --git a/tools/cimake.sh b/tools/cimake.sh new file mode 100755 index 0000000000..1d935120e5 --- /dev/null +++ b/tools/cimake.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# GNU make wrapper for invocation from ci to generate grouping of output +# without getting into the YAML madness of "what is a string" +exec make -w -O -j$(nproc) "$@" 2>&1 | sed 's:^make\: Entering directory:\#\#[group]:;s:^make\: Leaving directory:\#\#[endgroup]:' ``` this produces: ![image](/attachments/c6e2464d-4ce4-4e3f-9be1-3c8f5373cab7) But I am giving it up, because we should really have descriptive names for the groups
or does the idea actually work?
All checks were successful
testing / frontend-checks (pull_request) Successful in 48s
testing / backend-checks (pull_request) Successful in 2m16s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m49s
testing / test-unit (pull_request) Successful in 4m14s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m18s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m19s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m19s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m19s
testing / test-e2e (pull_request) Successful in 25m58s
testing / test-mysql (pull_request) Successful in 26m36s
testing / test-sqlite (pull_request) Successful in 32m41s
testing / test-pgsql (pull_request) Successful in 35m41s
testing / security-check (pull_request) Successful in 51s
issue-labels / backporting (pull_request_target) Has been skipped
issue-labels / cascade (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Successful in 1s
140c9d8e8e
Author
Contributor

Actually... There is a debug option which might give us what we want.
@viceice could you have a look at https://codeberg.org/forgejo/forgejo/actions/runs/134218/jobs/0/attempt/1 and tell me what you think?

As mentioned before, the compelling advantage of something like this is that it does not require changes to the makefile (which can be forgotten etc.).

The drawback (if it is any) is that we need to accept additional debug output which we are less interested in, or we'd need to hack more line replacements for those parts of the output which we do not want to see (with the danger of accidentally suppressing something which we are interested in)

image

Actually... There is a debug option which might give us what we want. @viceice could you have a look at https://codeberg.org/forgejo/forgejo/actions/runs/134218/jobs/0/attempt/1 and tell me what you think? As mentioned before, the compelling advantage of something like this is that it does not require changes to the makefile (which can be forgotten etc.). The drawback (if it is any) is that we need to accept additional debug output which we are less interested in, or we'd need to hack more line replacements for those parts of the output which we do not want to see (with the danger of accidentally suppressing something which we _are_ interested in) ![image](/attachments/19407ccb-9f31-4c24-91e5-0f8dc1c066b7)
164 KiB
slink changed title from WIP: build: move backend-checks CI checks to Makefile to WIP: build: move CI checks to Makefile 2026-01-26 17:54:25 +01:00
Owner

looks promissing, maybe we should try to filter some more known verbose messages 🙃

  • Prerequisite 'tests/e2e/changes.go' is newer than target 'templates/swagger/v1_json.tmpl'.
  • File 'swagger-check' does not exist.

then we're porbably good to go

looks promissing, maybe we should try to filter some more known verbose messages 🙃 - `Prerequisite 'tests/e2e/changes.go' is newer than target 'templates/swagger/v1_json.tmpl'.` - `File 'swagger-check' does not exist.` then we're porbably good to go
slink force-pushed make-pr-go from 140c9d8e8e
All checks were successful
testing / frontend-checks (pull_request) Successful in 48s
testing / backend-checks (pull_request) Successful in 2m16s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m49s
testing / test-unit (pull_request) Successful in 4m14s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m18s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m19s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m19s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m19s
testing / test-e2e (pull_request) Successful in 25m58s
testing / test-mysql (pull_request) Successful in 26m36s
testing / test-sqlite (pull_request) Successful in 32m41s
testing / test-pgsql (pull_request) Successful in 35m41s
testing / security-check (pull_request) Successful in 51s
issue-labels / backporting (pull_request_target) Has been skipped
issue-labels / cascade (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Successful in 1s
to 6d13f7794e
All checks were successful
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Successful in 2s
testing / frontend-checks (pull_request) Successful in 1m13s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m49s
testing / backend-checks (pull_request) Successful in 4m34s
testing / test-unit (pull_request) Successful in 4m35s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m2s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m3s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m1s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m3s
testing / test-mysql (pull_request) Successful in 23m53s
testing / test-sqlite (pull_request) Successful in 26m5s
testing / test-pgsql (pull_request) Successful in 30m49s
testing / security-check (pull_request) Successful in 40s
testing / test-e2e (pull_request) Successful in 17m16s
2026-01-27 14:39:25 +01:00
Compare
slink changed title from WIP: build: move CI checks to Makefile to build: move backend-checks CI checks to Makefile: make pr-go 2026-01-27 14:41:38 +01:00
Author
Contributor

ready for merge:

tools/cimake.sh:

  • filtering of additional messages as suggested by @viceice
  • set pipefail mode to make sure a make failure is propagated
  • general polishing

CI:

  • added reference to makefile
ready for merge: tools/cimake.sh: * filtering of additional messages as suggested by @viceice * set pipefail mode to make sure a make failure is propagated * general polishing CI: * added reference to makefile
Author
Contributor

This failure https://codeberg.org/forgejo/forgejo/actions/runs/134508/jobs/3/attempt/1 looks unrelated, I did not touch e2e and the error looks like ... something swallowed some characters...?

This failure https://codeberg.org/forgejo/forgejo/actions/runs/134508/jobs/3/attempt/1 looks unrelated, I did not touch e2e and the error looks like ... something swallowed some characters...?
viceice approved these changes 2026-01-27 15:03:10 +01:00
Dismissed
slink force-pushed make-pr-go from 6d13f7794e
All checks were successful
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Successful in 2s
testing / frontend-checks (pull_request) Successful in 1m13s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m49s
testing / backend-checks (pull_request) Successful in 4m34s
testing / test-unit (pull_request) Successful in 4m35s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m2s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m3s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m1s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m3s
testing / test-mysql (pull_request) Successful in 23m53s
testing / test-sqlite (pull_request) Successful in 26m5s
testing / test-pgsql (pull_request) Successful in 30m49s
testing / security-check (pull_request) Successful in 40s
testing / test-e2e (pull_request) Successful in 17m16s
to 0d8262e582
All checks were successful
issue-labels / release-notes (pull_request_target) Has been skipped
requirements / merge-conditions (pull_request) Successful in 2s
testing / frontend-checks (pull_request) Successful in 57s
testing / backend-checks (pull_request) Successful in 2m53s
Integration tests for the release process / release-simulation (pull_request) Successful in 5m25s
testing / test-unit (pull_request) Successful in 5m48s
testing / test-remote-cacher (garnet) (pull_request) Successful in 1m48s
testing / test-remote-cacher (redict) (pull_request) Successful in 1m51s
testing / test-remote-cacher (redis) (pull_request) Successful in 1m54s
testing / test-remote-cacher (valkey) (pull_request) Successful in 1m53s
testing / test-e2e (pull_request) Successful in 24m2s
testing / test-mysql (pull_request) Successful in 26m26s
testing / test-sqlite (pull_request) Successful in 32m24s
testing / test-pgsql (pull_request) Successful in 37m37s
testing / security-check (pull_request) Successful in 1m10s
issue-labels / backporting (pull_request_target) Has been skipped
milestone / set (pull_request_target) Successful in 6s
2026-02-05 11:07:12 +01:00
Compare
Author
Contributor

rebased and force-pushed, no changes to the patch

rebased and force-pushed, no changes to the patch
viceice approved these changes 2026-02-05 11:18:59 +01:00
Member

While this has been open, I've prepared a new backend check in #11142, using semgrep. I'm inclined to leave the semgrep change separate from this new pr-go make target because: (a) it already is, so neither of these changes will conflict on each other, (b) it requires a separate tool that can't be automatically installed by the go toolchain (semgrep) since it's not a go tool, (c) it's a relatively slow tool, (d) the slow perf is mitigated in CI because it uses patch-aware detection of what files to run against.

Just wanted to raise this note to see if there's an alternate opinion before either change moves forward. semgrep's applicability in #11142 will be so very small that it's unlikely to be an inconvenience, but that could change over time.

While this has been open, I've prepared a new backend check in #11142, using `semgrep`. I'm inclined to leave the `semgrep` change separate from this new `pr-go` make target because: (a) it already is, so neither of these changes will conflict on each other, (b) it requires a separate tool that can't be automatically installed by the go toolchain (`semgrep`) since it's not a go tool, (c) it's a relatively slow tool, (d) the slow perf is mitigated in CI because it uses patch-aware detection of what files to run against. Just wanted to raise this note to see if there's an alternate opinion before either change moves forward. `semgrep`'s applicability in #11142 will be so very small that it's unlikely to be an inconvenience, but that could change over time.
Author
Contributor

Re @mfenniak

I am not competent regarding semgrep, but it seems to be a proprietary, closed source tool (I only checked briefly, the pip installer for the CE cli contains a big binary executable). As a matter of principle, I would not even install such a tool locally, and, consequently, I would vote against requiring it to pass for PRs to be merged. In my opinion, there is also a risk of relying too much on such a tool, and in my mind there is a broader conflict with forgejo's values.

I do not have any say in this project, so the maintainers are of course to make their decision independent of this opinion.

As a possible compromise, one option could be to just run the tool "asynchronously" against trunk.

Re @mfenniak I am not competent regarding semgrep, but it seems to be a proprietary, closed source tool (I only checked briefly, the pip installer for the CE cli contains a big binary executable). As a matter of principle, I would not even install such a tool locally, and, consequently, I would vote against requiring it to pass for PRs to be merged. In my opinion, there is also a risk of relying too much on such a tool, and in my mind there is a broader conflict with forgejo's values. I do not have any say in this project, so the maintainers are of course to make their decision independent of this opinion. As a possible compromise, one option could be to just run the tool "asynchronously" against trunk.
Member

@slink wrote in #11053 (comment):

I am not competent regarding semgrep, but it seems to be a proprietary, closed source tool (I only checked briefly, the pip installer for the CE cli contains a big binary executable).

This is a misunderstanding of a weird packaging choice. semgrep is an LGPL-2.1 licensed open source tool. https://github.com/semgrep/semgrep It's written in OCaml, so I'm not sure why they use a pip package as a distribution tool, but that's the cause of the binary -- it's not a python tool.

Now, there is a fair criticism of the project in a more nuanced way -- the authors recently removed capabilities from the open source tool to package them as part of their commercial engine. (https://semgrep.dev/blog/2024/important-updates-to-semgrep-oss/#json-and-sarif-output-changes) This resulted in a fork, Opengrep. We could easily adopt Opengrep instead if it proves to be the healthier project in the long-term due to the limited usage proposed at this time.

With that information in mind, how is your opinion on make pr-go influenced?

@slink wrote in https://codeberg.org/forgejo/forgejo/pulls/11053#issuecomment-10426718: > I am not competent regarding semgrep, but it seems to be a proprietary, closed source tool (I only checked briefly, the pip installer for the CE cli contains a big binary executable). This is a misunderstanding of a weird packaging choice. semgrep is an LGPL-2.1 licensed open source tool. https://github.com/semgrep/semgrep It's written in OCaml, so I'm not sure why they use a pip package as a distribution tool, but that's the cause of the binary -- it's not a python tool. Now, there is a fair criticism of the project in a more nuanced way -- the authors recently removed capabilities from the open source tool to package them as part of their commercial engine. (https://semgrep.dev/blog/2024/important-updates-to-semgrep-oss/#json-and-sarif-output-changes) This resulted in a fork, Opengrep. We could easily adopt Opengrep instead if it proves to be the healthier project in the long-term due to the limited usage proposed at this time. With that information in mind, how is your opinion on `make pr-go` influenced?
Author
Contributor

@mfenniak wrote in #11053 (comment):

This is a misunderstanding of a weird packaging choice. semgrep is an LGPL-2.1 licensed open source tool.

Thank you so much for clearing up my misunderstanding. 🙏 FWIW, their corporate website does not exactly promote a link to their sources either, but I really should have looked more carefully. Thank you again for correcting my mistake.

As long as the toolchain can be built from sources, I am fine with requiring it.

@mfenniak wrote in https://codeberg.org/forgejo/forgejo/pulls/11053#issuecomment-10428132: > This is a misunderstanding of a weird packaging choice. semgrep is an LGPL-2.1 licensed open source tool. Thank you so much for clearing up my misunderstanding. 🙏 FWIW, their corporate website does not exactly promote a link to their sources either, but I really should have looked more carefully. Thank you again for correcting my mistake. As long as the toolchain can be built from sources, I am fine with requiring it.
Author
Contributor

@mfenniak I just realized that I might not have answered your actual question: Being inexperienced with semgrep, I am not sure how relevant it would be to run it locally. As a newbie to this project, I wanted to avoid pushing PRs for which CI immediately fails, and just today I found issues which would only should up in e2e. So I guess in principle make pr-go could include all CI checks, but it also needs to remain manageable in terms of runtime.
So based on

it's a relatively slow tool, (d) the slow perf is mitigated in CI because it uses patch-aware detection of what files to run against.

it would seem sensible to not run it with make pr-go?

@mfenniak I just realized that I might not have answered your actual question: Being inexperienced with semgrep, I am not sure how relevant it would be to run it locally. As a newbie to this project, I wanted to avoid pushing PRs for which CI immediately fails, and just today I found issues which would only should up in e2e. So I guess in principle `make pr-go` could include _all_ CI checks, but it also needs to remain manageable in terms of runtime. So based on > it's a relatively slow tool, (d) the slow perf is mitigated in CI because it uses patch-aware detection of what files to run against. it would seem sensible to not run it with `make pr-go`?
slink referenced this pull request from a commit 2026-02-09 17:18:06 +01:00
Owner

@slink wrote in #11053 (comment):

it's a relatively slow tool, (d) the slow perf is mitigated in CI because it uses patch-aware detection of what files to run against.

it would seem sensible to not run it with make pr-go?

It runs in 6 seconds for me, but I'm not sure how well installing python packages is in the current Makefile, there's some as that was inherited from Gitea but I don't think we ever ran them.

@slink wrote in https://codeberg.org/forgejo/forgejo/pulls/11053#issuecomment-10449888: > > it's a relatively slow tool, (d) the slow perf is mitigated in CI because it uses patch-aware detection of what files to run against. > > it would seem sensible to not run it with `make pr-go`? It runs in 6 seconds for me, but I'm not sure how well installing python packages is in the current Makefile, there's some as that was inherited from Gitea but I don't think we ever ran them.
Gusted approved these changes 2026-02-17 02:11:18 +01:00
Gusted left a comment
Owner

Looks good, thanks!

Looks good, thanks!
Gusted merged commit a81fc2a290 into forgejo 2026-02-17 02:41:43 +01:00
First-time contributor

Just want to say thank you for doing this & the docs update, since they would have helped with an earlier PR I submitted. Hopefully they help newer folks too.

Just want to say thank you for doing this & the docs update, since they would have helped with an earlier PR I submitted. Hopefully they help newer folks too.
Sign in to join this conversation.
No reviewers
No labels
arch
riscv64
backport/v1.19
backport/v1.20
backport/v1.21/forgejo
backport/v10.0/forgejo
backport/v11.0/forgejo
backport/v12.0/forgejo
backport/v13.0/forgejo
backport/v14.0/forgejo
backport/v7.0/forgejo
backport/v8.0/forgejo
backport/v9.0/forgejo
breaking
bug
bug
confirmed
bug
duplicate
bug
needs-more-info
bug
new-report
bug
reported-upstream
code/actions
code/api
code/auth
code/auth/faidp
code/auth/farp
code/email
code/federation
code/git
code/migrations
code/packages
code/wiki
database
MySQL
database
PostgreSQL
database
SQLite
dependency-upgrade
dependency
certmagic
dependency
chart.js
dependency
Chi
dependency
Chroma
dependency
citation.js
dependency
codespell
dependency
css-loader
dependency
devcontainers
dependency
dropzone
dependency
editorconfig-checker
dependency
elasticsearch
dependency
enmime
dependency
F3
dependency
ForgeFed
dependency
garage
dependency
Git
dependency
git-backporting
dependency
Gitea
dependency
gitignore
dependency
go-ap
dependency
go-enry
dependency
go-gitlab
dependency
Go-org
dependency
go-rpmutils
dependency
go-sql-driver mysql
dependency
go-swagger
dependency
go-version
dependency
go-webauthn
dependency
gocron
dependency
Golang
dependency
goldmark
dependency
goquery
dependency
Goth
dependency
grpc-go
dependency
happy-dom
dependency
Helm
dependency
image-spec
dependency
jsonschema
dependency
KaTeX
dependency
lint
dependency
MariaDB
dependency
Mermaid
dependency
minio-go
dependency
misspell
dependency
Monaco
dependency
PDFobject
dependency
playwright
dependency
postcss
dependency
postcss-plugins
dependency
pprof
dependency
prometheus client_golang
dependency
protobuf
dependency
relative-time-element
dependency
renovate
dependency
reply
dependency
ssh
dependency
swagger-ui
dependency
tailwind
dependency
temporal-polyfill
dependency
terminal-to-html
dependency
tests-only
dependency
text-expander-element
dependency
urfave
dependency
vfsgen
dependency
vite
dependency
Woodpecker CI
dependency
x tools
dependency
XORM
Discussion
duplicate
enhancement/feature
forgejo/accessibility
forgejo/branding
forgejo/ci
forgejo/commit-graph
forgejo/documentation
forgejo/furnace cleanup
forgejo/i18n
forgejo/interop
forgejo/moderation
forgejo/privacy
forgejo/release
forgejo/scaling
forgejo/security
forgejo/ui
Gain
High
Gain
Nice to have
Gain
Undefined
Gain
Very High
good first issue
i18n/backport-stable
impact
large
impact
medium
impact
small
impact
unknown
Incompatible license
issue
closed
issue
do-not-exist-yet
issue
open
manual test
Manually tested during feature freeze
OS
FreeBSD
OS
Linux
OS
macOS
OS
Windows
problem
QA
regression
release blocker
Release Cycle
Feature Freeze
release-blocker
v7.0
release-blocker
v7.0.1
release-blocker
v7.0.2
release-blocker
v7.0.3
release-blocker
v7.0.4
release-blocker
v8.0.0
release-blocker/v9.0.0
run-all-playwright-tests
run-end-to-end-tests
test
manual
test
needed
test
needs-help
test
not-needed
test
present
untested
User research - time-tracker
valuable code
worth a release-note
User research - Accessibility
User research - Blocked
User research - Community
User research - Config (instance)
User research - Errors
User research - Filters
User research - Future backlog
User research - Git workflow
User research - Labels
User research - Moderation
User research - Needs input
User research - Notifications/Dashboard
User research - Rendering
User research - Repo creation
User research - Repo units
User research - Security
User research - Settings (in-app)
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/forgejo!11053
No description provided.