Commit Graph

189 Commits

Author SHA256 Message Date
98ac879aa6 common: test fixes after rebase
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 8s
2026-01-28 11:20:28 +01:00
c58f724edf common: add test for cloning hashes 2026-01-28 11:09:20 +01:00
e01e80ae42 common: add test for directory listing 2026-01-28 11:09:20 +01:00
125a74145a pr: new package handling 2026-01-28 11:09:19 +01:00
af2438e1f5 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-28 11:09:19 +01:00
c3ae95dc38 pr: fix more unit tests 2026-01-28 11:09:19 +01:00
bbe584ab0d pr: merge new package 2026-01-28 11:09:19 +01:00
2fb67549f3 pr: implement first part of issue processing 2026-01-28 11:09:19 +01:00
b8fa14f04e wip: process issues 2026-01-28 11:09:19 +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
d623844411 pr: do not fail checkout 2025-10-13 18:37:42 +02:00
04825b552e pr: use force-merge instead of force-push
The permission is to accept a change without required reviews, not
to actually force-push

Fixes 7bad8eb5a9
2025-10-12 10:22:49 +02:00
7bad8eb5a9 pr: Add config definitions for permission set 2025-10-09 18:43:56 +02:00
58da491049 common: handle translation to SSH if already SSH 2025-10-07 17:26:27 +02:00
1b9ee2d46a PR: ref requries PR fetch, and not in timeline 2025-10-02 15:13:43 +02:00
b7bbafacf8 PR: limit search to bot account for ProjectGit PRs 2025-10-02 13:45:31 +02:00
1390225614 PR: list missing PRs in the logs 2025-09-29 14:58:43 +02:00
2092fc4f42 Fix handling of all project flags
We skipped access and sourceaccess flags before
2025-09-24 09:33:29 +02:00
d2973f4792 PR: only consider open PR when creating new PRs 2025-09-21 23:21:40 +02:00
8af7e58534 common: handle group data in PR reviews 2025-09-16 18:13:35 +02:00