Commit graph

883 commits

Author SHA1 Message Date
8083446687 ci.yml: Update checkout action to v7, don't check out all history
All checks were successful
Run tests and linters / test (pull_request) Successful in 2m28s
We only need the last commit to run the tests.

Related: quality/tickets#928
2026-08-05 14:37:24 +02:00
8c4ab44083 ruff: Use older default ruleset from ruff 0.15
All checks were successful
Run tests and linters / test (pull_request) Successful in 2m29s
Adjusting to the new ruleset will be considerable work. Keep the original ruleset for now.

Fixes: #322
2026-08-05 11:15:33 +02:00
55c22b71a6 Add munch comment to requirements
All checks were successful
Run tests and linters / test (pull_request) Successful in 2m24s
- add explanation comment why much is still required

Fixes #318
2026-06-30 14:57:17 +02:00
faf72c2a77 Run app tests in the builder image
All checks were successful
Run tests and linters / test (pull_request) Successful in 2m24s
- Set testing image to ubi9/python-311
- Skip installing packages which are already present in the image

Fixes #313

Assisted-by: Claude Code
2026-06-25 14:37:22 +02:00
30089575e2 Fix missing release field on admin interface
- Force SQLAlcheny relationships init before rendering the form
- Add tests covering this problem

Fixes #279

Assisted-by: Claude Code
2026-06-22 15:47:27 +02:00
3fbc4de037 requirements: remove unused imports, move some to devel reqs
All checks were successful
Run tests and linters / test (pull_request) Successful in 2m48s
These requirements are no longer needed. Move pytest and munch to devel reqs,
because they are only needed for tests.

Related: #306
Co-authored-by: Kamil Páral <kparal@redhat.com>
2026-06-15 22:00:54 +02:00
c473662b4a ci.yml: Use ./run, fail for linters, other touches
Changes:
 - Convert to a single job where linter step fails the job
 - Use ./run script to run tests and linters the same way as a developer does
 - Use `set -e` to fail for any failed command, not just the last one
 - Install only requirements-development.txt (already includes requirements.txt)
 - Formatting improvements

Fixes: #315
Related: #306

Co-authored-by: Jaroslav Groman <jgroman@redhat.com>
2026-06-15 17:32:30 +02:00
f79993230f Fix linter problems
- Fix ruff check warnings
- Fix mypy warnings
- Move mypy config from setup.cfg to pyproject.toml and update it

Fixes: #306

Assisted-by: Claude Code
Co-authored-by: Kamil Páral <kparal@redhat.com>
2026-06-15 17:30:46 +02:00
de4c2ba778 Reformat all source code using ruff
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m55s
Run tests and linters / lint (pull_request) Failing after 2s
No functional changes were performed, only formatting changes.

Related: #306
2026-06-08 16:13:00 +02:00
3d54a63596 Add ruff configuration and docs
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m58s
Run tests and linters / lint (pull_request) Failing after 2s
Co-authored-by: Kamil Paral <kparal@redhat.com>
Related: #306
2026-06-08 15:56:11 +02:00
37d657aa39 Fix tests failing on sqlite 2026-06-02 15:43:47 -07:00
0825933f91 Skip db preload on healtchcheck requests
Some checks failed
Run tests and linters / test (pull_request) Successful in 3m3s
Run tests and linters / lint (pull_request) Failing after 2s
1.16
Every web request triggers a db query to preload app header data. In case of health checks
we do not need to preload anything and can safely skip the @app.before_request.

Fixes #310
2026-05-26 09:49:53 +02:00
c2c9d51a59 Create health check endpoint
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m47s
Run tests and linters / lint (pull_request) Failing after 2s
This is to prevent livenessProbe spamming of index page
2026-05-18 13:00:25 +02:00
7121e89d56 Use obj.is_(True) for SQLAlchemy objects
Some checks failed
Run tests and linters / test (pull_request) Successful in 3m17s
Run tests and linters / lint (pull_request) Failing after 2s
This replaces `obj == True`, which needs `# noqa: E712` attached.
2026-05-18 10:57:08 +02:00
017ed319a5 improve code nesting for bug_image()
Some checks failed
Run tests and linters / test (pull_request) Successful in 3m0s
Run tests and linters / lint (pull_request) Failing after 2s
2026-05-15 15:16:19 +02:00
d009979c45 Fix proposed bugs link reuse
Some checks failed
Run tests and linters / test (pull_request) Successful in 3m35s
Run tests and linters / lint (pull_request) Failing after 2s
- Fix problem with proposed bugs with different milestones of the same release creating two different tickets
- Add tests covering this usecase

Fixes #304

Assisted-By: Claude Code
2026-05-14 09:37:55 +02:00
6fc0c5835d config: improve Forgejo discussion ticket template
Some checks failed
AI Code Review / ai-review (pull_request_target) Has been skipped
Run tests and linters / test (pull_request) Successful in 3m11s
Run tests and linters / lint (pull_request) Failing after 2s
1.15
Add spaces between the URL and </strong>, otherwise the mentioned URL is
incorrect when the ticket is previewed, e.g. on Matrix.
2026-05-04 12:01:47 +02:00
5a6f2b5736 Switch from Pagure to Forge for blocker review discussions
Some checks failed
Run tests and linters / test (pull_request) Successful in 3m13s
Run tests and linters / lint (pull_request) Failing after 2s
This drops Pagure integration for creating and processing blocker discussion
tickets and replaces it with a Fedora Forge (Forgejo) integration.

Additional related changes are:
- Testing is now performed through containers (Forgejo is one of those
  containers now)
- docs/source/blockerbugs-workflow.md is added for a quick architecture overview
  for people and AI
- docs/source/usage.md is added for a similar purpose documenting usage hints
- docs/source/blockerbugscli.rst is extended for all commands
- development setup instructions changed, using a different DB container with
  different variables
- pytest configuration was moved from setup.cfg to pyproject.toml due to syntax
  escaping issues
- a new pyforgejo dependency is added

Related #296
Merges #299
Assisted-By: Claude Code
2026-04-29 16:27:49 +02:00
112db31ca1 Set up CI and AI pull request review via Forgejo actions
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
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.

Closes #300

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-03-25 16:41:51 +01:00
e28e119d77 Disable a mypy error code in models files
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.

Closes #300

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-03-25 16:40:23 +01:00
603872a5e6 requirements.txt: upgrade Flask and Werkzeug
The test suite was crashing, caused by old Werkzeug. Flask needs to updated
with it. Upgrade both to latest versions.
(The "match production" comment needs to re-evaluated, tbd later).
2026-03-12 15:21:44 +01:00
6e5f048739 fix references after migration to Forge
Related to #295
2026-01-16 17:04:31 +01:00
Lukas Brabec
e7516aadca docs: add how to use tiny stage to test OIDC 2025-06-10 11:12:59 +02:00
db0fdc2d16 gitignore: add conf/oidc.json 1.14 2025-06-10 10:24:02 +02:00
Lukas Brabec
cd69409bbe add path to client_secrets.json in openshift 2025-04-24 16:39:56 +02:00
Lukas Brabec
a41ba60165 clarify usage of OPENSHIFT_PROD env var 2025-04-24 16:06:31 +02:00
3d1266d94c Migrate authentication to OIDC
Authentication now uses [Flask-OIDC](https://flask-oidc.readthedocs.io/)
instead of the deprecated FAS OpenID library.

Fixes: #288

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2025-04-24 15:59:30 +02:00
Lukas Brabec
6f7d039c85 fix typo in blockerbugs/util/bug_sync.py 1.13 2025-04-24 13:23:51 +02:00
06bfb4e060 Fix duplication of bugs in fetch_single_bug (#286)
This code will create duplicate entries when handling a bug
with multiple tracker types that does not currently exist. On
each trip through the `for tracker in trackers:` loop we create
a new bug.

Instead of using `oldbug` and `newbug` to refer to (respectively)
a db bug entry that existed before the function ran and one that
is being created by the function, let's use `dbbug` for both,
which solves the problem because on any loop iteration after the
first has created the db bug entry, `dbbug` will exist and we
will go down the other branch, where we update it.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-04-24 12:52:38 +02:00
f699d81f5f Reapply "Sync proposals done through the app instantly"
This reverts commit d56e8bbdf7.
We'll fix the dupe problem in the next commit.
2025-04-24 12:52:38 +02:00
Lukas Brabec
5ef141be4e pin WTForms to version 3.1.2 1.12
WTForms 3.2.0 broke our admin UI.

Fixes: https://pagure.io/fedora-qa/blockerbugs/issue/291
Merges: https://pagure.io/fedora-qa/blockerbugs/pull-request/292
2025-03-25 11:52:06 +01:00
d56e8bbdf7 Revert "Sync proposals done through the app instantly" 1.11
This reverts commit 38ac5941a3.

We're getting duplicate entries in the web view:
https://pagure.io/fedora-qa/blockerbugs/issue/286

This is the only change in a long time, a likely culprit. Let's try to revert it
for the moment.
2025-03-10 10:26:52 +01:00
1b275366f2 setup.cfg: sqlmypy plugin not needed, ignore build/ for flake8
The typing hints plugin for SQLAlchemy should no longer be needed, see
97aaf01f14.
2025-01-03 21:18:39 +01:00
d6f9f13f20 run: update "run setup" for F40 blocker numbers
Because staging Bugzilla only contains F40 as the latest items.
2025-01-03 21:15:02 +01:00
931f8a7778 docs: gcc is needed for installing requirements
Also highlight the need to set your own password for the DB.
2025-01-03 21:13:38 +01:00
38ac5941a3 Sync proposals done through the app instantly
Split out from https://pagure.io/fedora-qa/blockerbugs/pull-request/261#
2024-08-21 19:42:57 +02:00
ccb8649241 gunicorn: Bump to 22.0.0 2024-05-20 11:51:20 +02:00
76b87b30bb irc format -> meeting format 1.10
Change the references from IRC to a general "meeting", and change the syntax
from IRC to current Matrix format.

Fixes: https://pagure.io/fedora-qa/blockerbugs/issue/281
2024-01-11 13:54:24 +01:00
ad51cce6ca bug status email: polish the code, add tests 1.9
Merges: https://pagure.io/fedora-qa/blockerbugs/pull-request/280
2023-12-05 11:26:53 +01:00
6ec86a4db2 Add a template for the blocker bug status email
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2023-12-05 10:03:03 +01:00
319f149650 resolve deprecation warnings, mostly related to datetime.utcnow()
For third-party libraries, just use a blanket ignore for all DeprecationWarning
in that library. There seems to be no benefit in explicitly listing them in
setup.cfg.
2023-11-30 16:52:21 +01:00
0aa1459e31 docs: use postgresql tools from the container
The host system tools are often at a different version, which can present issues
when dumping or restoring the database (e.g. unknown option errors). Change
the docs to always use postgresql tools from the container.
2023-11-30 15:55:12 +01:00
0802422362 Bump gunicorn to support Python 3.11
Merges: https://pagure.io/fedora-qa/blockerbugs/pull-request/278
2023-09-01 17:06:20 +02:00
aceaddd6cf requests: add "Releng commands" section 1.8
Based on releng request, this adds a section to Requests showing the exact
commands releng should run. When creating a releng ticket, QA will have to make
sure the FE and Releng sections match, if any of the FEs are filtered out by QA.

This will only work as long as Bodhi defaults to populate each Bodhi update
title with a space-delimited list of NVRs. If they stop doing that, we'll have
to switch to a more proper approach.

Fixes: https://pagure.io/fedora-qa/blockerbugs/issue/275
Merges: https://pagure.io/fedora-qa/blockerbugs/pull-request/276
Related: https://pagure.io/fedora-qa/blockerbugs/pull-request/271
Related: https://pagure.io/fedora-qa/blockerbugs/issue/277

Co-authored-by: Kevin Fenzi <kevin@scrye.com>
Co-authored-by: František Zatloukal <fzatlouk@redhat.com>
2023-09-01 16:08:36 +02:00
fc83b20ef8 merge develop and master together 1.7 2023-06-23 08:54:28 +02:00
4c7de08f19 log format: make it easier to read, add module info to DEBUG 2023-06-22 11:57:48 +02:00
b34af75fa4 Add .gitconfig to allow git usage in OpenShift
Versioneer was failing because git now checks for user ownership on a git folder
and refuses to work if the ownership isn't correct. This file definitely
shouldn't be in the source repo, but at this moment, we're not sure how to make
it part of the deployment scripts (Frantisek promises to look at it really
soon(tm)).
2023-06-20 16:43:26 +02:00
8dbb3fce4e update versioneer to 0.28 2023-06-20 16:41:33 +02:00
35f5cdc005 requirements: bump Flask and Werkzeug 2023-06-20 13:41:51 +02:00
1356ef59c4 requirements: require SQLAlchemy ~= 2.0.0
The minor release bumps were causing breakages for us in the past (Frantisek
says), so only allow the patch number to increase.
2023-06-20 13:35:45 +02:00