SHA256
1
0

213 Commits

Author SHA256 Message Date
c7840ddd47 obs: Adding new linkedbuild mode 2026-03-03 19:58:08 +01:00
d0056ed461 tests: fix tests 2026-03-03 18:03:20 +01:00
ef5db8ca28 pr: No need to try to merge changes
We can reset current worktree and clobber it with the merged changes.
We want to emulate `git merge -s theirs` strategy while
`git merge -Xtheirs` only picks `theirs` in case of conflicts.
So, resetting the changes and reading exact is sufficient

`git read-tree -u` updates the current work tree so we do not have
unstaged changes.
2026-03-02 11:04:22 +01:00
10f74f681d pr: add function that checks and prepares PRs 2026-03-02 11:04:22 +01:00
b514f9784c pr: add merge modes documentation and config parsing 2026-03-02 11:04:22 +01:00
88aa8c32fd Merge commit 'refs/pull/149/head' of src.opensuse.org:git-workflow/autogits 2026-02-27 15:51:34 +01:00
99d27a48ff Support remote source in pull requests
This requires write permission by maintainer there
2026-02-27 15:50:31 +01:00
af2ff0bdd2 common: check for old pending request reviews
Timeline events will contain Reviews and ReviewRequests and
ReviewDismissed events. We need to handle this at event parsing
time and not to punt this to the query functions later on.

If the last event is an actual review, we use this.
If no review, check if last event associated with the reviewer
is Dismissed or Requested Review but not if a dismissed Review
preceeds it.
2026-02-27 01:03:26 +01:00
5669083388 pr: handle case of nil user in reviews
This can happen when a review request is assigned automatically via
CODEOWNERS or perhaps the requesting user has account removed.
2026-02-26 13:15:58 +01:00
582df2555b Merge branch 'staging-updates' 2026-02-25 14:48:56 +01:00
f1b807fbf6 common: replace legacy logger with standard impl 2026-02-25 12:50:26 +01:00
e5441bf489 test: refactor loggin in unit tests
Use test logger when running under a test.
2026-02-25 12:50:21 +01:00
b8740047c9 common: test fixes after rebase 2026-02-25 12:48:48 +01:00
9f405c2022 common: add test for cloning hashes 2026-02-25 12:48:48 +01:00
75760efbc1 common: add test for directory listing 2026-02-25 12:48:48 +01:00
85927ad76d pr: new package handling 2026-02-25 12:48:48 +01:00
92162f7d89 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-02-25 12:48:47 +01:00
ec0eefb868 pr: fix more unit tests 2026-02-25 12:48:47 +01:00
5ae2bd8fd7 pr: merge new package 2026-02-25 12:48:47 +01:00
45f2b55e53 pr: implement first part of issue processing 2026-02-25 12:48:47 +01:00
c83a3a454f wip: process issues 2026-02-25 12:48:47 +01:00
82d4e2ed5d staging: mock interface setup 2026-02-23 14:17:53 +01:00
06772ca662 common: Add ObsClientInterface
This allows for dependency injection for future unit tests.
2026-02-23 13:43:23 +01:00
17b67b8133 tests: Add unit tests for some utility functions 2026-02-22 13:11:51 +01:00
c16d1f9940 pr: move env fetch functions to common code
We can use these functions in all daemon.
2026-02-22 13:09:47 +01:00
868c28cd5a staging: Allow host names via env file
or we can run it only for OBS via packages...
2026-02-06 20:30:40 +01:00
7729b845b0 Fix project meta rendering
* support project links
* ommit scmsync if empty
2026-02-06 20:27:28 +01:00
c662b2fdbf staging: Add support for filtering QA projects via Labels 2026-02-06 20:26:38 +01:00
139f40fce3 pr: fix maintainership data corruption
With group expansion, we were not operating on a copy of the slice
but the original slice. This results in the original data being
modified instead of the copy as intended.
2026-02-06 16:56:03 +01:00
23be3df1fb common: fix timeline cache invalidation 2026-02-03 17:11:24 +01:00
68b67c6975 Merge branch 'maintainer-update' 2026-02-03 13:10:16 +01:00
c2709e1894 fix unit tests and mocks 2026-01-28 10:50:36 +01:00
2620aa3ddd Merge branch 'always-review' 2026-01-27 15:44:30 +01:00
a0c51657d4 pr: reset timeline cache when fetching PRSet 2026-01-26 15:34:46 +01:00
86a176a785 common: precise key removal 2026-01-24 18:11:43 +01:00
bb9e9a08e5 common: only change maintainership lines that changed 2026-01-24 17:52:00 +01:00
edd8c67fc9 obs-staging-bot: allow build-disabling repositories in the QA projects
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