199 Commits

Author SHA256 Message Date
e78db48ba2 reparent: unit tests 2026-02-03 17:39:57 +01:00
8678167498 reparent: reorganize logic 2026-02-03 17:18:46 +01:00
842284505b reparent: work on issues, not notifications 2026-02-03 15:13:35 +01:00
2d52659223 test: move NewController to common/test_util subpackage
We want to share the NewController logging setup with other tests
across utilities
2026-02-03 14:25:07 +01:00
5abb1773db reparent: move reparent to common interface 2026-02-01 05:08:17 +01:00
c6aa9ea392 Can use values from model instead of our own 2026-01-31 12:49:52 +01:00
a97603b5a7 common: no longer need cast 2026-01-31 12:35:02 +01:00
ed63b37baa common: regenerate client code for Gitea 1.25.4 2026-01-31 12:29:01 +01:00
f47da62481 common: replace legacy logger with standard impl
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 27s
2026-01-31 10:18:14 +01:00
79e5345ac6 test: refactor loggin in unit tests
Use test logger when running under a test.
2026-01-31 10:04:08 +01:00
790540d6c5 common: test fixes after rebase 2026-01-30 16:44:11 +01:00
a13f57e464 common: add test for cloning hashes 2026-01-30 16:44:11 +01:00
b147fc7622 common: add test for directory listing 2026-01-30 16:44:11 +01:00
240d79a4d6 pr: new package handling 2026-01-30 16:44:11 +01:00
d2e9abde6e common: more unit tests fixes
TZ needs to be defined, otherwise it was assumed to be local which
then resulted in unpredictable commit hashes. We define it to UTC
for unit tests

PR have state "open" not "opened"
2026-01-30 16:44:11 +01:00
a4f677690a pr: fix more unit tests 2026-01-30 16:44:10 +01:00
70460813f5 pr: merge new package 2026-01-30 16:44:10 +01:00
0651fe01d4 pr: implement first part of issue processing 2026-01-30 16:44:10 +01:00
e03fd0bdcf wip: process issues 2026-01-30 16:44:10 +01:00
c2709e1894 fix unit tests and mocks
All checks were successful
go-generate-check / go-generate-check (push) Successful in 8s
2026-01-28 10:50:36 +01:00
2620aa3ddd Merge branch 'always-review'
Some checks failed
go-generate-check / go-generate-check (push) Failing after 8s
2026-01-27 15:44:30 +01:00
a0c51657d4 pr: reset timeline cache when fetching PRSet
Some checks failed
go-generate-check / go-generate-check (pull_request) Failing after 8s
go-generate-check / go-generate-check (push) Failing after 23s
2026-01-26 15:34:46 +01:00
edd8c67fc9 obs-staging-bot: allow build-disabling repositories in the QA projects
Some checks failed
go-generate-check / go-generate-check (push) Failing after 25s
go-generate-check / go-generate-check (pull_request) Has been cancelled
Using the BuildDisableRepos configuration, it is now possible to
define which repositories to build-disable in the QA project meta.

This is for example useful for the SLES development workflow, where
the product repository should only be enabled after the packagelist
definitions have been built - so it is not desirable to have them
built as soon as the QA project is created.

Example:

    {
      "ObsProject": "SUSE:SLFO:Main",
      "StagingProject": "SUSE:SLFO:Main:PullRequest",
      "QA": [
        {
          "Name": "SLES",
          "Origin": "SUSE:SLFO:Products:SLES:16.1",
          "BuildDisableRepos": ["product"]
        }
      ]
    }

Signed-off-by: Eugenio Paolantonio <eugenio.paolantonio@suse.com>
2026-01-21 19:05:48 +01:00
51403713be pr: always require review, if configured
Implement ReviewRequired option to workflow.config. This will
always require a review by maintainer, unless no other maintainers
are available.

By default, AlwaysRequireReview is false
2026-01-20 19:17:10 +01:00
51b0487b29 pr: parse ADD issue body
Validation of repository and org and other names is for the
consumer of this call. Maybe this can change later.
2025-12-16 18:33:22 +01:00
01e4f5f59e pr: fix error reporting for timeline PrjGit parse 2025-12-11 18:45:56 +01:00
19d9fc5f1e pr: request staging only when staging.config is there
If the project git does not have a staging.config, then there is
no reason to request reviews by the staging bot.
2025-12-11 17:01:15 +01:00
c4e184140a pr: handle case when reviews is nil 2025-12-09 17:19:38 +01:00
56c492ccdf PR: do not remove maintainer if also a reviewer
Maintainer review is only required if the PR is created by non-maintainer
or ProjetGit PR is created by non-bot. If maintainer review is not required,
but the maintainer is also listed as a Reviewer, then we cannot remove
this review request from the PR.
2025-12-08 18:03:00 +01:00
3a6009a5a3 pr: review requests cannot be stale
Yes, gitea marks these as stale too, but we should just ignore this
flag in case of requests. Stale requests are still pending.
2025-12-05 10:15:02 +01:00
2c4d25a5eb pr: remove maintainers if submitter is maintainer
If we have case where reviews are already there, for whatever reason
(eg. upgrade from older bot), remove the pending reviews if they
are not needed
2025-12-05 09:36:38 +01:00
052ab37412 common: Loading pending reviews when loading reviews 2025-12-04 19:02:21 +01:00
925f546272 pr: check all reviews, not just ones tagged reviewers 2025-12-04 18:21:32 +01:00
71fd32a707 pr: fix debug statements 2025-12-04 18:04:51 +01:00
581131bdc8 pr: request and unrequest reviewers
Move the function to request and unrequest reviewers to a different
function. This will allow later simplification of the function
that determines if all reviews are complete.

Unrequesting of reviews is only possible in case of bot issued
review requests. The rest are left as-is.
2025-12-03 18:55:10 +01:00
495ed349ea common: refactor: FetchPRSet also fetches Reviews 2025-12-03 18:55:10 +01:00
350a255d6e pr: allow to fetch reviews in PRSet loader 2025-12-03 18:55:10 +01:00
e3087e46c2 PR: skip maintainer review if not needed
If project or package maintainer already reviewed the PR, as
appropriate, they are no longer re-added to the PR. We also need
to remove reviewers, but only if they were previously requested
by the bot and not something else.
2025-12-03 18:55:10 +01:00
86acfa6871 pr: set staging auto label according to config
falls back to staging/Auto if nothing is set
2025-11-20 16:25:06 +01:00
7f09b2d2d3 common: match project config before packages
We need to cycle through all project configs before we try to
match non-project config branches/packages. If we have multiple
project gits in one org, this coudl match wrong config
2025-11-20 13:22:40 +01:00
f3a37f1158 pr: case fold 2025-11-19 19:32:55 +01:00
162ae11cdd common: init the cache so not null 2025-11-19 15:29:52 +01:00
3ed5ecc3f0 pr: add staging/Auto on new PRs
also, cache timeline fetches
2025-11-17 11:01:45 +01:00
4293181b4e pr: improve logging of review errors
when user is missing, log only the missing user
2025-11-12 21:39:26 +01:00
d3ba579a8b common: fix systemd execution
In case when we are running under older systemd that does not set
transient home, we need to improvise when connecting via SSH
and passing the identity file explicitly
2025-11-09 23:10:08 +01:00
0e06ba5993 common: classifying rm branches on name
Branches with suffixes

  -rm
  -removed
  -deleted

are now classified as removed. This is important in case project
config refers to default branch names which must exist so we need
to be able to classify such branches to either use them or ignore
them
2025-11-04 18:00:21 +01:00
Jan Zerebecki
e5cad365ee Run go tests from rpm check
Skip some failing tests to be able to run the rest.
Add missing config to make git commit succeed inside rpmbuild.
2025-10-27 14:42:21 +01:00
Jan Zerebecki
5ce92beb52 Add go generate result 2025-10-24 10:39:34 +02:00
fa647ab2d8 status: do not marshall empty XMLName in json 2025-10-15 18:24:52 +02:00
19902813b5 status: fix xml output 2025-10-15 18:09:21 +02:00