Set up CI and AI pull request review via Forgejo actions #300

Merged
kparal merged 2 commits from tox-ci-ai into develop 2026-03-25 15:46:52 +00:00
Owner

Set up CI and AI pull request review via Forgejo actions

CI is a bit tricky because the requirement files are designed
to match the rather odd environment we deploy blockerbugs in in
production: Python 3.11 on RHEL 9 with almost all dependencies
installed via pip. This includes compiling gssapi and krb5. So
instead of my usual "just throw tox at it" approach, this
replicates that same environment: we use an Alma 9 container,
install the Python bits and the necessary compiler and devel
dependencies, then use pip to install all the deps. Then we run
the linters and the tests (not using run because this ancient
pip on this ancient Python on this ancient RHEL doesn't install
the binaries, you have to use python -m).

The linters fail at present because there are lots of real
problems; I assume nobody ran these checks for a while. I included
a fix for the biggest flood of mypy issues, but otherwise I
figured to leave the problems alone because I don't want to
cause conflicts with the forgejo port PR. I figure once we get
that PR merged we can then fix up the linting issues. But at least
we'll have tests and AI review run on that PR while we work on
it.

Signed-off-by: Adam Williamson awilliam@redhat.com

Set up CI and AI pull request review via Forgejo actions CI is a bit tricky because the requirement files are designed to match the rather odd environment we deploy blockerbugs in in production: Python 3.11 on RHEL 9 with almost all dependencies installed via pip. This includes compiling gssapi and krb5. So instead of my usual "just throw tox at it" approach, this replicates that same environment: we use an Alma 9 container, install the Python bits and the necessary compiler and devel dependencies, then use pip to install all the deps. Then we run the linters and the tests (not using `run` because this ancient pip on this ancient Python on this ancient RHEL doesn't install the binaries, you have to use `python -m`). The linters fail at present because there are lots of real problems; I assume nobody ran these checks for a while. I included a fix for the biggest flood of mypy issues, but otherwise I figured to leave the problems alone because I don't want to cause conflicts with the forgejo port PR. I figure once we get that PR merged we can then fix up the linting issues. But at least we'll have tests and AI review run on that PR while we work on it. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Set up CI and AI pull request review via Forgejo actions
Some checks failed
CI via Tox / tox (pull_request) Failing after 1m6s
77db88f3fa
Signed-off-by: Adam Williamson <awilliam@redhat.com>
adamwill force-pushed tox-ci-ai from 77db88f3fa
Some checks failed
CI via Tox / tox (pull_request) Failing after 1m6s
to 7ade9a1ff5
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 1m8s
2026-03-10 17:42:07 +00:00
Compare
adamwill force-pushed tox-ci-ai from 7ade9a1ff5
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 1m8s
to 882c142343
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 1m9s
2026-03-10 17:45:12 +00:00
Compare
adamwill force-pushed tox-ci-ai from 882c142343
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 1m9s
to bb18c238db
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 11s
2026-03-10 17:56:43 +00:00
Compare
adamwill force-pushed tox-ci-ai from bb18c238db
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 11s
to a4473cd687
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2s
2026-03-10 17:59:51 +00:00
Compare
adamwill force-pushed tox-ci-ai from a4473cd687
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2s
to fbc61baa96
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 34s
2026-03-10 18:01:30 +00:00
Compare
adamwill force-pushed tox-ci-ai from fbc61baa96
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 34s
to 26942d0d71
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m7s
2026-03-10 18:03:15 +00:00
Compare
adamwill force-pushed tox-ci-ai from 26942d0d71
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m7s
to 08454ce929
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 44s
2026-03-10 18:10:46 +00:00
Compare
adamwill force-pushed tox-ci-ai from 08454ce929
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 44s
to 2456a23eaa
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m6s
2026-03-10 18:28:41 +00:00
Compare
adamwill force-pushed tox-ci-ai from 2456a23eaa
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m6s
to 4e5bd648b0
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m6s
2026-03-10 18:32:02 +00:00
Compare
adamwill force-pushed tox-ci-ai from 4e5bd648b0
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m6s
to a53e4daeb9
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m8s
2026-03-10 18:43:48 +00:00
Compare
adamwill force-pushed tox-ci-ai from a53e4daeb9
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m8s
to 5ca085bc31
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m20s
2026-03-10 18:50:54 +00:00
Compare
adamwill force-pushed tox-ci-ai from 5ca085bc31
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m20s
to 4bc6a86a78
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m6s
2026-03-10 18:56:34 +00:00
Compare
adamwill force-pushed tox-ci-ai from 4bc6a86a78
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m6s
to c58d3fdec0
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m45s
2026-03-10 18:59:46 +00:00
Compare
adamwill force-pushed tox-ci-ai from c58d3fdec0
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m45s
to 3334300010
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m19s
2026-03-10 19:14:20 +00:00
Compare
Disable a mypy error code in models files
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m23s
3bf3fdef21
See https://github.com/pallets-eco/flask-sqlalchemy/issues/1327 .
Basically, due to a fundamental incompatibility between how
Flask-SQLAlchemy works and how typing is meant to work, if you
use Flask-SQLAlchemy as documented (like we're doing here), you
get typing errors.

I tried the "Declaring a type for db.Model" workaround, but for
me - as for the issue author - it didn't work, I got the same
"Incompatible types in assignment" errors. So let's just go with
disabling the name-defined error on the files affected by this.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
adamwill force-pushed tox-ci-ai from 3bf3fdef21
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m23s
to bcb9845e97
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m22s
2026-03-10 21:04:34 +00:00
Compare
Owner

Sooo, this is great, but the testing process is likely to get considerably changed in #296 (PR #299) - it's getting run in a container instead, similarly to testdays-web. I think we should leave this open until #296 is done, and then we can look at what changes are required here. Please note that updating the baseline OS/Python/libraries is definitely the better way forward. It's all archaic, because at some point we matched it to our production OpenShift environment and then nobody touched it for a long time 🙂

Please note that we have a similar ticket in quality/testdays-web#96 , which should already look similar to how BBA might end up looking. So if you want to look there and prepare a PR for it, you're very welcome 🙂

Sooo, this is great, but the testing process is likely to get considerably changed in #296 (PR #299) - it's getting run in a container instead, similarly to testdays-web. I think we should leave this open until #296 is done, and then we can look at what changes are required here. Please note that updating the baseline OS/Python/libraries is definitely the better way forward. It's all archaic, because at some point we matched it to our production OpenShift environment and then nobody touched it for a long time 🙂 Please note that we have a similar ticket in quality/testdays-web#96 , which should already look similar to how BBA might end up looking. So if you want to look there and prepare a PR for it, you're very welcome 🙂
kparal self-assigned this 2026-03-11 12:18:08 +00:00
Author
Owner

From a quick look at that PR, I'm not sure it would change how the tests are invoked at all. It uses testcontainers, which does all the container stuff 'internally'. The container environment is not used as the build environment, AFAICS, so it doesn't affect the need to install development packages so gssapi and krb5 can be built, I don't think - I think that still happens the same way. The containers are used as an execution environment for doing E2E testing (which was not present before, only unit tests). In fact, AFAICS, blockerbugs itself isn't run in a container; the containers are used for deploying Pagure and Postgres, for blockerbugs to run against.

AFAICS you still trigger the tests by just running pytest, which is what this PR does. And it barely touches requirements.txt at all, at least at present. So, unless I'm missing something, I think these are actually probably perfectly compatible.

From a quick look at that PR, I'm not sure it would change how the tests are *invoked* at all. It uses `testcontainers`, which does all the container stuff 'internally'. The container environment is not used as the *build* environment, AFAICS, so it doesn't affect the need to install development packages so gssapi and krb5 can be built, I don't think - I think that still happens the same way. The containers are used as an *execution* environment for doing E2E testing (which was not present before, only unit tests). In fact, AFAICS, blockerbugs itself isn't run in a container; the containers are used for deploying Pagure and Postgres, for blockerbugs to run *against*. AFAICS you still trigger the tests by just running `pytest`, which is what this PR does. And it barely touches `requirements.txt` at all, at least at present. So, unless I'm missing something, I think these are actually probably perfectly compatible.
Author
Owner

Ah, hmm, but some experimenting with testdays-web does expose a problem: our infra-hosted Forgejo actions runners are container-based, and nested containers are difficult. We'd probably need to set up VM runners, somehow, to get it to work.

AI review and running the linters might still be useful, though?

Ah, hmm, but some [experimenting with testdays-web](https://forge.fedoraproject.org/quality/testdays-web/pulls/99#issuecomment-577679) does expose a problem: our infra-hosted Forgejo actions runners are container-based, and nested containers are difficult. We'd probably need to set up VM runners, somehow, to get it to work. AI review and running the linters might still be useful, though?
adamwill force-pushed tox-ci-ai from bcb9845e97
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m22s
to 873995d622
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m22s
2026-03-12 21:27:36 +00:00
Compare
Author
Owner

Update: @jgroman figured out how to finesse the testcontainers situation in quality/testdays-web#99 , hopefully we can do the same here. There's a question whether we should merge this first then have #299 make the adjustments so the new container-based tests work in CI, or merge #299 first and make adjustments to the testcontainers stuff in this PR. I kinda like the idea of merging this first, but WDYT?

Update: @jgroman figured out how to finesse the testcontainers situation in https://forge.fedoraproject.org/quality/testdays-web/pulls/99 , hopefully we can do the same here. There's a question whether we should merge this first then have #299 make the adjustments so the new container-based tests work in CI, or merge #299 first and make adjustments to the testcontainers stuff in this PR. I kinda like the idea of merging this first, but WDYT?
@ -0,0 +1,152 @@
## Project Overview
Owner

What is the purpose of this document? I originally assumed it's some leftover that was included in this PR by accident. At least quality/testdays-web!99 didn't need one.

If this is intentional, I'd like to understand the process behind it (and ideally have some hyperlink to the documentation, so that I can add it here). What is the envisioned life cycle of this doc? Obviously it will get outdated quickly. Is this supposed to be regenerated regularly? Since AI is used to generate it, why is it better to have it stored in a repo, rather than let AI generate it on the fly during the PR review, in a freshly current form, and then throw it away?

What is the purpose of this document? I originally assumed it's some leftover that was included in this PR by accident. At least quality/testdays-web!99 didn't need one. If this is intentional, I'd like to understand the process behind it (and ideally have some hyperlink to the documentation, so that I can add it here). What is the envisioned life cycle of this doc? Obviously it will get outdated quickly. Is this supposed to be regenerated regularly? Since AI is used to generate it, why is it better to have it stored in a repo, rather than let AI generate it on the fly during the PR review, in a freshly current form, and then throw it away?
Owner

I think the main reason for keeping this file around is that while originally it is generated, it can be manually updated with details which were not picked up by context-generator and you think should be mentioned anyway. Also I suspect that having previous version might even help the context-generator build updated version of this file.
Here are some notes from ai-reviewer docs: https://gitlab.com/redhat/edge/ci-cd/ai-code-review/-/blob/main/docs/user-guide.md#-project-context-configuration

I think the main reason for keeping this file around is that while originally it is generated, it can be manually updated with details which were not picked up by context-generator and you think should be mentioned anyway. Also I suspect that having previous version might even help the context-generator build updated version of this file. Here are some notes from ai-reviewer docs: https://gitlab.com/redhat/edge/ci-cd/ai-code-review/-/blob/main/docs/user-guide.md#-project-context-configuration
Author
Owner

The purpose is to provide context about the project to the review tool. ai-code-review is written to always read this file and include it in the review context if it's present.

ai-code-review (and other non-agentic review tools, generally) doesn't put the entire project in the context when querying the model. They just include the PR diff itself (and the commit message, and existing comments on the PR). So the review sometimes has issues or misses problems because the model isn't aware of significant context in untouched files, or outside the diff context in modified files.

You can get better results by using an agentic workflow and letting it check out the entire project and look through the commit history and stuff, but that's expensive.

The idea here is to instead have an agentic thing generate this static "here's how the project works overall" document periodically, and have the non-agentic review tool take that context into account so it can hopefully produce more comprehensive and accurate reviews.

The generator is https://github.com/juanje/context-generator . I did get a PR merged recently that makes it add a README.md explaining what the file is for and how it's generated - https://github.com/juanje/context-generator/pull/2 . I probably generated the file for this PR before that was merged. We can re-generate it, or just add an appropriate README.md manually, I guess.

So far the idea is just to re-generate or update the file manually, ad hoc, whenever it seems necessary. You could implement some kind of timed workflow to use opencode to update it every month, or something, but I don't know if it's worth the effort.

Edit: if I didn't put one in the testdays-web PR, it was an oversight or I did that just before I started making these files. I've been intending to include one of these files in every repo I'm enabling ai-code-review on, I think it's a good concept.

The purpose is to provide context about the project to the review tool. ai-code-review is written to always read this file and include it in the review context if it's present. ai-code-review (and other non-agentic review tools, generally) doesn't put the entire project in the context when querying the model. They just include the PR diff itself (and the commit message, and existing comments on the PR). So the review sometimes has issues or misses problems because the model isn't aware of significant context in untouched files, or outside the diff context in modified files. You can get better results by using an agentic workflow and letting it check out the entire project and look through the commit history and stuff, but that's expensive. The idea here is to instead have an agentic thing generate this static "here's how the project works overall" document periodically, and have the non-agentic review tool take that context into account so it can hopefully produce more comprehensive and accurate reviews. The generator is https://github.com/juanje/context-generator . I did get a PR merged recently that makes it add a README.md explaining what the file is for and how it's generated - https://github.com/juanje/context-generator/pull/2 . I probably generated the file for this PR before that was merged. We can re-generate it, or just add an appropriate README.md manually, I guess. So far the idea is just to re-generate or update the file manually, ad hoc, whenever it seems necessary. You *could* implement some kind of timed workflow to use opencode to update it every month, or something, but I don't know if it's worth the effort. Edit: if I didn't put one in the testdays-web PR, it was an oversight or I did that just before I started making these files. I've been intending to include one of these files in every repo I'm enabling ai-code-review on, I think it's a good concept.
Author
Owner

I added the README.md.

I added the README.md.
Owner

Your reply was very helpful, thanks. I had no idea that during a PR review the AI only sees the diff and not the whole project. I don't think that's really a difference between agent and non-agent AI (as I understand it), rather it's all just about cost and speed?

Anyway, I played with context-generator, generated the context myself just to see how it works. IIUIC, the manual section in it is pre-populated, but the idea is that we maintain it ourselves, to limit the errors/mistakes of AI reviews. Ok, sounds fine. I'm not going to spend time to fine-tuning it at this moment, but we can expand it according to future AI reviews.

Your reply was very helpful, thanks. I had no idea that during a PR review the AI only sees the diff and not the whole project. I don't think that's really a difference between agent and non-agent AI (as I understand it), rather it's all just about cost and speed? Anyway, I played with context-generator, generated the context myself just to see how it works. IIUIC, the **manual section** in it is pre-populated, but the idea is that we maintain it ourselves, to limit the errors/mistakes of AI reviews. Ok, sounds fine. I'm not going to spend time to fine-tuning it at this moment, but we can expand it according to future AI reviews.
adamwill marked this conversation as resolved
@ -0,0 +22,4 @@
python3.11 -m venv bb-env
source bb-env/bin/activate
python -m pip install -r requirements.txt -r requirements-development.txt
- name: Lint and test
Owner

Can we have two separate steps, one for linting and one for running unit tests? Currently in Forge I see:

Run linters and tests / lint-and-test (pull_request) Failing after 2m22s

That's not helpful to me, because the there are lots of linter errors, but those are really not important. The test suite is important, and that's currently hidden behind the linter warnings, so that I would need to click Details and inspect it manually every time. In order to make this useful, I believe we need two separate steps and two separate results.

Can we have two separate steps, one for linting and one for running unit tests? Currently in Forge I see: > Run linters and tests / lint-and-test (pull_request) Failing after 2m22s That's not helpful to me, because the there are lots of linter errors, but those are really not important. The test suite is important, and that's currently hidden behind the linter warnings, so that I would need to click Details and inspect it manually every time. In order to make this useful, I believe we need two separate steps and two separate results.
Author
Owner

Well...sort of no, unfortunately :(

AFAICS, Actions (both GitHub and Forgejo) has no easy way within a single job to implement 'run A, then run B, report the results separately, and make the overall state failed if A or B failed'. Usually, if A fails, it short-circuits there and never runs B. There is an option to "ignore failure", but this really ignores it - it will go ahead and run B if A fails...and if B passes, the overall result is a pass.

You can make them separate jobs, but then you have to repeat all the setup steps, which seems kinda crazy. Or you can hack it up by having each step dump its exit code to a file, using the 'ignore failure' thing on all of them, then having a final step which figures out whether to report 'pass' or 'fail', I think. But it's all a bit messy. I guess I can take another look and see if one of those is viable, or if I can figure anything else out (there may be some way to have two separate jobs both use an environment set up by a third job, or something).

Well...sort of no, unfortunately :( AFAICS, Actions (both GitHub and Forgejo) has no easy way within a single job to implement 'run A, then run B, report the results separately, and make the overall state failed if A or B failed'. Usually, if A fails, it short-circuits there and never runs B. There is an option to "ignore failure", but this really *ignores* it - it will go ahead and run B if A fails...and if B passes, the overall result is a pass. You can make them separate jobs, but then you have to repeat all the setup steps, which seems kinda crazy. Or you can hack it up by having each step dump its exit code to a file, using the 'ignore failure' thing on all of them, then having a final step which figures out whether to report 'pass' or 'fail', I think. But it's all a bit messy. I guess I can take another look and see if one of those is viable, or if I can figure anything else out (there *may* be some way to have two separate jobs both use an environment set up by a third job, or something).
Author
Owner

I guess another approach is to write a little wrapper script for running the checks and gathering the status and reporting it. That's sort of like the "signal file" approach, but implemented more in the repo than in the workflow.

I guess another approach is to write a little wrapper script for running the checks and gathering the status and reporting it. That's sort of like the "signal file" approach, but implemented more in the repo than in the workflow.
Owner

Do we need this aggregated result (A and B)? That would provide the exact same feedback we already have today.
I think it is good enough to just have a glance at PR status and see a line of checkmarks or Xs in there and dig deeper only if necessary. In my opinion it is not that crazy to have separate jobs - spinning up new container and installing dependencies in this project currently takes 2 minutes. It is not instant but I'd say it is acceptable.

Do we need this aggregated result (A and B)? That would provide the exact same feedback we already have today. I think it is good enough to just have a glance at PR status and see a line of checkmarks or Xs in there and dig deeper only if necessary. In my opinion it is not that crazy to have separate jobs - spinning up new container and installing dependencies in this project currently takes 2 minutes. It is not instant but I'd say it is acceptable.
Author
Owner

Yeah, true. Splitting the jobs just feels like a waste of resources, but it's true, it's not going to melt any glaciers. I can maybe do it that way for now so we can merge this while I'm on PTO, then I can always look at trying to make it more efficient later.

Yeah, true. Splitting the jobs just feels like a waste of resources, but it's true, it's not going to melt any glaciers. I can maybe do it that way for now so we can merge this while I'm on PTO, then I can always look at trying to make it more efficient later.
Author
Owner

oh, yeah, now I look at it, I especially disliked it because the dep install step requires actual compilation. But, oh well.

oh, yeah, now I look at it, I especially disliked it because the dep install step requires actual compilation. But, oh well.
Owner

I've managed to run tests and linting together, but report them separately 😼 See the updated PR. I only forwarded the success/failure status of the step to a different job, not the full output, so when seeing linting output, you need to look to the test job. But I think this is good enough, and it runs only once.

I've managed to run tests and linting together, but report them separately 😼 See the updated PR. I only forwarded the success/failure status of the step to a different job, not the full output, so when seeing linting output, you need to look to the test job. But I think this is good enough, and it runs only once.
Owner

Oh, I forgot to say - if we actually decide to block PRs on linter errors, then we don't need to have separated jobs. But currently we're not there yet (all the current errors would need to be fixed first), and I'm not even sure it's a good idea. The linters warn about too many little nitpicks like indentation and similar, and present it as an error. So we would first probably need to do some tweaking, what we want to consider an error and what we don't. I'm generally interested in programming warnings (unused variable, etc), but not style warnings (I refuse to call them errors 🙂).

So currently, having the jobs separated is the better option, in my view. (Or running just the test suite and skipping linters would also be OK for me).

Oh, I forgot to say - if we actually decide to block PRs on linter errors, then we don't need to have separated jobs. But currently we're not there yet (all the current errors would need to be fixed first), and I'm not even sure it's a good idea. The linters warn about too many little nitpicks like indentation and similar, and present it as an error. So we would first probably need to do some tweaking, what we want to consider an error and what we don't. I'm generally interested in programming warnings (unused variable, etc), but not _style_ warnings (I refuse to call them errors 🙂). So currently, having the jobs separated is the better option, in my view. (Or running _just_ the test suite and skipping linters would also be OK for me).
Author
Owner

FWIW, my personal preference for style linting is to simply enforce "whatever black says". It keeps things clean and simple and avoids philosophical debates. So on all my projects the CI is set to fail if black would change anything. You usually have to do one big 'black-ify' commit to get it into a 'correct' state to start with, though.

FWIW, my personal preference for style linting is to simply enforce "whatever black says". It keeps things clean and simple and avoids philosophical debates. So on all my projects the CI is set to fail if black would change anything. You usually have to do one big 'black-ify' commit to get it into a 'correct' state to start with, though.
Owner

Yes, I want to try it, but not as part of the currently pending large PRs.

Yes, I want to try it, but not as part of the currently pending large PRs.
kparal marked this conversation as resolved
adamwill force-pushed tox-ci-ai from 873995d622
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m22s
to 2265dc0fe7
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m26s
2026-03-20 04:50:19 +00:00
Compare
adamwill force-pushed tox-ci-ai from 2265dc0fe7
Some checks failed
Run linters and tests / lint-and-test (pull_request) Failing after 2m26s
to ec1e3191dc
Some checks failed
Run linters and tests / lint (pull_request) Failing after 2m19s
Run linters and tests / test (pull_request) Successful in 2m23s
2026-03-20 17:51:42 +00:00
Compare
run tests and linting together, but report linting separately
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m27s
Run tests and linters / lint (pull_request) Failing after 1s
7db5783c06
kparal added this to the Sprint 6 project 2026-03-24 17:12:39 +00:00
@ -0,0 +6,4 @@
jobs:
test:
runs-on: fedora
permissions:
Owner

I can't find any documentation for this key. But I've tested that if I omit it, everything still runs just fine. I see that the ai-code-review includes this in its example. But I guess we can drop it here in the CI workflow.

I can't find any documentation for this key. But I've tested that if I omit it, everything still runs just fine. I see that the ai-code-review includes this in its example. But I guess we can drop it here in the CI workflow.
Author
Owner

I must have copied the file from an old base or something. permissions are significant on GitHub but not currently implemented on Forgejo.

I must have copied the file from an old base or something. `permissions` are significant on GitHub but not currently implemented on Forgejo.
Owner

Ok, good to know, thanks.

(Btw I like adding new commits instead of force-pushing during a review, otherwise it's quite hard to inspect the diff in your git client (I see that Forge does a decent job, though). It's easy to squash it all after the review is done.)

Ok, good to know, thanks. (Btw I like adding new commits instead of force-pushing during a review, otherwise it's quite hard to inspect the diff in your git client (I see that Forge does a decent job, though). It's easy to squash it all after the review is done.)
kparal marked this conversation as resolved
adamwill force-pushed tox-ci-ai from 7db5783c06
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m27s
Run tests and linters / lint (pull_request) Failing after 1s
to 0e2dc77e73
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m31s
Run tests and linters / lint (pull_request) Failing after 1s
2026-03-25 01:43:20 +00:00
Compare
Author
Owner

The problem I see with your approach, @kparal , is that we won't do the linter checks at all if the tests fail.

The problem I see with your approach, @kparal , is that we won't do the linter checks at all if the tests fail.
Owner

FWIW, there seems to be one more option suggested by CC:

jobs:                                                                                                                                                                                                                                    
  check:                                                                                                                                                                                                                                 
    runs-on: fedora                                                                                                                                                                                                                      
    strategy:                                                                                                                                                                                                                            
      fail-fast: false                                                                                                                                                                                
      matrix:                                                                                                                                                                                                                            
        task: [test, lint]                                                                                                                                                                                                               
    container:                                                                                                                                                                                                                           
      image: quay.io/almalinuxorg/almalinux:9                                                                                                                                                                                            
    steps:                                                                                                                                                                                                                               
      # ... shared setup ...                                                                                                                                                                                                             
      - name: Run task                                                                                                                                                                                                                   
        run: |                                                                                                                                                                                                                           
          source bb-env/bin/activate                                                                                                                                                                                                     
          if [ "${{ matrix.task }}" = "test" ]; then                                                                                                                                                                                     
            python3.11 -m pytest                                                                                                                                                                                                         
          else                                                                                                                                                                                                                           
            EXIT=0; python3.11 -m flake8 ... || EXIT=$?; ... exit $EXIT                                                                                                                                                                  
          fi

The critical setting is fail-fast: false - this tells the runner to continue all matrix jobs even if one fails. Each matrix entry shows as a separate check.

FWIW, there seems to be one more option suggested by CC: ``` jobs: check: runs-on: fedora strategy: fail-fast: false matrix: task: [test, lint] container: image: quay.io/almalinuxorg/almalinux:9 steps: # ... shared setup ... - name: Run task run: | source bb-env/bin/activate if [ "${{ matrix.task }}" = "test" ]; then python3.11 -m pytest else EXIT=0; python3.11 -m flake8 ... || EXIT=$?; ... exit $EXIT fi ``` The critical setting is fail-fast: false - this tells the runner to continue all matrix jobs even if one fails. Each matrix entry shows as a separate check.
run linters first
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m32s
Run tests and linters / lint (pull_request) Failing after 1s
c8a3a07109
Owner

@adamwill wrote in #300 (comment):

The problem I see with your approach, @kparal , is that we won't do the linter checks at all if the tests fail.

Ok, fixed by running linters first.

@jgroman wrote in #300 (comment):

The critical setting is fail-fast: false - this tells the runner to continue all matrix jobs even if one fails. Each matrix entry shows as a separate check.

According to documentation each of those also run as a separate job (full setup in each), so I believe this wouldn't help us (it would essentially be the same as having the static two jobs, like before).

@adamwill wrote in https://forge.fedoraproject.org/quality/blockerbugs/pulls/300#issuecomment-591966: > The problem I see with your approach, @kparal , is that we won't do the linter checks at all if the tests fail. Ok, fixed by running linters first. @jgroman wrote in https://forge.fedoraproject.org/quality/blockerbugs/pulls/300#issuecomment-592079: > The critical setting is fail-fast: false - this tells the runner to continue all matrix jobs even if one fails. Each matrix entry shows as a separate check. According to [documentation](https://forgejo.org/docs/latest/user/actions/reference/#jobsjob_idstrategymatrix) each of those also run as a separate job (full setup in each), so I believe this wouldn't help us (it would essentially be the same as having the static two jobs, like before).
Owner

@kparal You are right, I missed this bit in the docs.

@kparal You are right, I missed this bit in the docs.
kparal approved these changes 2026-03-25 15:29:05 +00:00
kparal left a comment

Thanks a lot for this, I know it took me a long time to process it (sorry)! I can merge this if everyone is happy with it.

Thanks a lot for this, I know it took me a long time to process it (sorry)! I can merge this if everyone is happy with it.
kparal force-pushed tox-ci-ai from c8a3a07109
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m32s
Run tests and linters / lint (pull_request) Failing after 1s
to 112db31ca1
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m25s
Run tests and linters / lint (pull_request) Failing after 1s
AI Code Review / ai-review (pull_request_target) Has been skipped
2026-03-25 15:42:40 +00:00
Compare
kparal merged commit 112db31ca1 into develop 2026-03-25 15:46:52 +00:00
kparal deleted branch tox-ci-ai 2026-03-25 15:46:53 +00:00
Author
Owner

Yup, good job everyone, we can fix any issues that show up as we go along.

Yup, good job everyone, we can fix any issues that show up as we go along.
Sign in to join this conversation.
No reviewers
No milestone
No project
3 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
quality/blockerbugs!300
No description provided.