145 Commits

Author SHA256 Message Date
91d22f7eea staging: add tests for idempotency and label changes
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 33s
We do not want duplicate comments. And if we do have label changes,
new comments should be added.
2026-02-24 18:22:08 +01:00
913b8c8a4b staging: Match previous message format
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 28s
Match changes in older message format. That is,

    Build is started in https://host/project/show/SUSE:SLFO:2.2:PullRequest:2162 .

    Additional QA builds:
    https://host/project/show/SUSE:SLFO:2.2:PullRequest:2162:SLES
    https://host/project/show/SUSE:SLFO:2.2:PullRequest:2162:SL-Micro

Add unit test to verify this exact format.
2026-02-24 12:23:35 +01:00
e1825dc658 staging: CommentPROnce everywhere
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 32s
This replaces last usage of gitea.AddComment() where we do not
check if the comment already exists.
2026-02-23 19:16:40 +01:00
59965e7b5c staging: comment once on PRs using timeline
We need to comment once on PRs and verify using issue timeline
that only one comment is present

Furthermore, staging and secondary QA links should be present
in a single comment as tooling already expects this format.
2026-02-23 19:05:44 +01:00
24a4a592a7 staging: add PollWorkNotifications coverage 2026-02-23 16:01:47 +01:00
d3d9d66797 staging: add tests on commentOnPackagePR 2026-02-23 15:48:38 +01:00
7a2f7a6ee7 staging: test default projectgit repo 2026-02-23 15:44:45 +01:00
34a3a4795b staging: increase coverage of PulllRequest processing 2026-02-23 15:39:02 +01:00
bb5daebdfa staging: return correct error
Don't clobber our error before returning it
2026-02-23 15:37:41 +01:00
70bba5e239 staging: improve CreateQASubProject unit coverage 2026-02-23 15:11:30 +01:00
5793391586 staging: add core logic unit tests 2026-02-23 15:05:51 +01:00
d923db3f87 staging: tests for Notification and Review handling 2026-02-23 14:47:51 +01:00
fc4547f9a9 tests: sanitize check 2026-02-23 14:44:17 +01:00
6fa57fc4d4 staging: Fix logic error
We need to report only once all building is finished, and not partial
results. Partial results are not yet finalized, so we can only
report that build is still in progress.

Add unit tests to cover these scenarios
2026-02-23 14:33:51 +01:00
82d4e2ed5d staging: mock interface setup 2026-02-23 14:17:53 +01:00
8920644792 staging: Use interfaces allowing dependency injection
This includes also a few formatting changes
2026-02-23 14:10:10 +01:00
06772ca662 common: Add ObsClientInterface
This allows for dependency injection for future unit tests.
2026-02-23 13:43:23 +01:00
Bernhard M. Wiedemann
1b90299d94 obs-staging-bot: Add missing return
Some checks failed
go-generate-check / go-generate-check (push) Successful in 23s
go-generate-check / go-generate-check (pull_request) Has been cancelled
2026-02-16 17:52:32 +01:00
ba5a42dd29 staging: Adapt commit status link when QA fails
All checks were successful
go-generate-check / go-generate-check (push) Successful in 8s
but main project was successful (eg. package builds, but appliance
fails, eg. due to broken deps)
2026-02-06 20:32:28 +01:00
53cf2c8bad staging: Fix repeated QA project setups
Don't touch an already setup project
2026-02-06 20:32:00 +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
962c4b2562 staging: Set result to failed when we have missing packages
in that case no build failure may appear so it was handled as success

https://github.com/openSUSE/openSUSE-git/issues/228
2026-02-06 20:29:07 +01:00
57cb251dbc staging: Protection against broken staging.config
when having multiple projects  with same name
2026-02-06 20:28:49 +01:00
75c4fada50 staging: Support using source from pullrequest in QA project
A QA project can get configured to also rebuild the sources again based
on the binaries of other packages of the QA project.

This is esp. useful for bootstrap projects. We would keep the main
project in this case to ensure that the package itself is building
on current code base. But we would also test if it breaks other packages
or fail during bootstrap cycle.
2026-02-06 20:28:21 +01:00
7d13e586ac Support QA projects depend on each other 2026-02-06 20:27:51 +01:00
c662b2fdbf staging: Add support for filtering QA projects via Labels 2026-02-06 20:26:38 +01:00
Antonello Tartamo
4cedb37da4 fixed check for multiple repos and architectures, added a link to the OBS project 2026-02-06 20:26:09 +01:00
Antonello Tartamo
fe519628c8 fixed spamming comments on package PRs when build is in progress 2026-02-06 20:25:49 +01:00
Antonello Tartamo
ff18828692 Forward build status to package PR/s 2026-02-06 20:25:21 +01:00
6337ef7e50 staging: drop compare of build results of reference projects
it did not work reliable and is actually not wanted by SLFO release
managers
2026-02-06 20:20:20 +01:00
e9992d2e99 obs-staging: fix onlybuild for subdirectories
The parameter only takes a package name, but not a full subdirectory
string. So we hand over only the last part behind a / here
2026-02-06 20:19:59 +01:00
c44d34fdbe staging: handle OBS API downtime
All checks were successful
go-generate-check / go-generate-check (push) Successful in 23s
don't write "Cannot fetch reference project meta" endless
2026-02-05 16:45:24 +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
Antonello Tartamo
2f39fc9836 initial documentation review 2026-01-14 15:43:27 +01:00
5544a65947 obs-staging-bot: Expand possible branch of QA repos
That way a source merge of any product is not triggering rebuilds in
pull request QA sub projects. We may need a config option here to
enable/disable this.
2025-11-03 17:54:57 +01:00
f6fd96881d staging: improve docs 2025-10-02 17:40:00 +02:00
a03491f75c Keep maintainers from staging template project
They need to keep access as they might need to be able to modify the
stage project. They could grant access anyway, by adding themselfs
as they own the upper project. No reason to force them the
extra trip or to hide build results first to them
2025-09-24 10:39:07 +02:00
1d3ed81ac5 staging: use https cloning always
We can just pass the token, so SSH option for cloning is obsolete
2025-09-16 10:11:28 +02:00
49c4784e70 staging: handle case of no staging config 2025-09-15 17:58:21 +02:00
be15c86973 staging: use correct gitea token 2025-09-15 17:44:52 +02:00
72857db561 staging: add gitea token as user for cloning
For private repos, we need to identify ourselves to Gitea
2025-09-15 17:28:38 +02:00
56cf8293ed staging: clone via target repo only 2025-09-15 12:30:08 +02:00
fd5b3598bf Don't crash when new packages got added
The build result request of the base project is failing in this
situation, since the requested package does not exist.

Therefore we need to have seperate lists for proper handling.
2025-09-13 15:47:50 +02:00
9dd5a57b81 staging: fix no config case 2025-09-11 17:22:02 +02:00
3c20eb567b staging: allow wider character set in pr regex 2025-09-11 16:09:42 +02:00
ff7df44d37 staging: assume changed directories are packages
Ignore any non-top level direcotries here. This should be fixed
to handle _manifest files
2025-09-11 14:56:27 +02:00
f2089f99fc staging: use helper function to SetCommitStatus 2025-09-09 12:55:14 +02:00
10ea3a8f8f obs-staging-bot: Fix setting of commit status 2025-09-09 12:46:43 +02:00
9faa6ead49 Log errors on SetCommitStatus 2025-09-09 12:46:21 +02:00
29cce5741a staging: typo fix 2025-09-09 12:46:11 +02:00