This commit is contained in:
Adam Majer 2024-07-21 22:15:11 +02:00
parent bce3b68b76
commit 54e418acaf
4 changed files with 513 additions and 54 deletions

View File

@ -11926,13 +11926,13 @@ paths:
title: test 1 title: test 1
who: Administrator who: Administrator
state: new state: new
when: 2021-09-30 09:12:02.000000000 +02:00 when: 2021-09-30 07:12:02.000000000 +00:00
event_type: review_wanted event_type: review_wanted
- id: 25 - id: 25
title: test 2 title: test 2
who: User 2 who: User 2
event_type: comment_for_package event_type: comment_for_package
when: 2021-09-27 09:16:19.000000000 +02:00 when: 2021-09-27 07:16:19.000000000 +00:00
'401': '401':
description: | description: |
Unauthorized. Unauthorized.
@ -13329,7 +13329,7 @@ paths:
description: 'Token description. It helps to identify a token from the rest description: 'Token description. It helps to identify a token from the rest
of the tokens of a user. of the tokens of a user.
' '
example: Rebuild gchz example: Rebuild gchz
- in: query - in: query
name: project name: project
@ -17210,7 +17210,7 @@ paths:
description: 'Diff relative to a given superseded request. State the id of description: 'Diff relative to a given superseded request. State the id of
the corresponding superseded request. the corresponding superseded request.
' '
example: 10401 example: 10401
- in: query - in: query
name: view name: view
@ -18522,7 +18522,7 @@ paths:
owner: owner:
login: user_1 login: user_1
email: user_1@example.com email: user_1@example.com
realname: realname:
- name: 4883 - name: 4883
created_at: 2018-12-11 03:22:54 UTC created_at: 2018-12-11 03:22:54 UTC
updated_at: 2018-12-11 03:22:54 UTC updated_at: 2018-12-11 03:22:54 UTC
@ -18693,7 +18693,7 @@ paths:
code: invalid_attribute code: invalid_attribute
summary: 'Attribute ''foo'' must be in the $NAMESPACE:$NAME style summary: 'Attribute ''foo'' must be in the $NAMESPACE:$NAME style
' '
'401': '401':
description: | description: |
Unauthorized. Unauthorized.
@ -18799,21 +18799,21 @@ paths:
type: string type: string
description: 'The name of a binary package whose owners you want to search. description: 'The name of a binary package whose owners you want to search.
' '
- in: query - in: query
name: user name: user
schema: schema:
type: string type: string
description: 'Search what this user is owner of. description: 'Search what this user is owner of.
' '
- in: query - in: query
name: group name: group
schema: schema:
type: string type: string
description: 'The title of a group. Search what this group is owner of. description: 'The title of a group. Search what this group is owner of.
' '
- in: query - in: query
name: limit name: limit
schema: schema:
@ -19014,7 +19014,7 @@ paths:
summary: 'The search needs at least a ''binary'', ''package'' summary: 'The search needs at least a ''binary'', ''package''
or ''user'' parameter or ''user'' parameter
' '
search root not set: search root not set:
summary: Search root is not set summary: Search root is not set
description: At least one of the projects in your instance should description: At least one of the projects in your instance should
@ -19023,7 +19023,7 @@ paths:
summary: 'The attribute OBS:OwnerRootProject is not set to define summary: 'The attribute OBS:OwnerRootProject is not set to define
default projects. default projects.
' '
'401': '401':
description: | description: |
Unauthorized. Unauthorized.
@ -19768,14 +19768,14 @@ paths:
matches: 2 matches: 2
project: project:
- name: home:Iggy - name: home:Iggy
title: title:
description: description:
person: person:
userid: Iggy userid: Iggy
role: maintainer role: maintainer
- name: home:Iggy:branches:home:Admin - name: home:Iggy:branches:home:Admin
title: East of Eden title: East of Eden
description: description:
'400': '400':
description: Bad Request description: Bad Request
content: content:
@ -20454,7 +20454,7 @@ paths:
description: 'Empty result, when there is no matches. For example: description: 'Empty result, when there is no matches. For example:
`?match=project=''home:bs-team:OBS''`. `?match=project=''home:bs-team:OBS''`.
' '
'400': '400':
description: Bad Request description: Bad Request
content: content:
@ -20624,7 +20624,7 @@ paths:
description: 'Empty result, when there is no matches. For example: description: 'Empty result, when there is no matches. For example:
`?match=project=''home:bs-team:OBS''`. `?match=project=''home:bs-team:OBS''`.
' '
'400': '400':
description: Bad Request description: Bad Request
content: content:
@ -21708,7 +21708,7 @@ paths:
when: '2022-08-22T09:37:09' when: '2022-08-22T09:37:09'
who: Requestor who: Requestor
by_group: group_1 by_group: group_1
comment: comment:
history: history:
who: Admin who: Admin
when: '2022-08-22T09:37:09' when: '2022-08-22T09:37:09'
@ -21744,7 +21744,7 @@ paths:
when: '2022-08-22T09:37:09' when: '2022-08-22T09:37:09'
who: Admin who: Admin
by_group: group_1 by_group: group_1
comment: comment:
history: history:
who: Admin who: Admin
when: '2022-08-22T09:37:09' when: '2022-08-22T09:37:09'
@ -21785,7 +21785,7 @@ paths:
when: '2022-08-22T09:37:09' when: '2022-08-22T09:37:09'
who: Admin who: Admin
by_group: group_1 by_group: group_1
comment: comment:
history: history:
who: Admin who: Admin
when: '2022-08-22T09:37:09' when: '2022-08-22T09:37:09'
@ -24848,8 +24848,8 @@ paths:
srcmd5: 6c73fc9ef8d43369f0778564617b4a93 srcmd5: 6c73fc9ef8d43369f0778564617b4a93
time: 1682497725 time: 1682497725
user: Admin user: Admin
comment: comment:
requestid: requestid:
'400': '400':
description: 'Error: Bad request.' description: 'Error: Bad request.'
content: content:
@ -24882,7 +24882,7 @@ paths:
summary: 'pattern validation error: 1:1: FATAL: Start tag expected, summary: 'pattern validation error: 1:1: FATAL: Start tag expected,
< not found < not found
' '
'401': '401':
description: | description: |
Unauthorized. Unauthorized.
@ -30026,7 +30026,7 @@ paths:
description: 'Passing the number of the revision, this endpoint displays the description: 'Passing the number of the revision, this endpoint displays the
attributes'' XML as it was at that point. attributes'' XML as it was at that point.
' '
example: 3 example: 3
- name: view - name: view
in: query in: query
@ -30052,7 +30052,7 @@ paths:
description: 'Passing `with_project`, the response displays the attributes description: 'Passing `with_project`, the response displays the attributes
of the package''s project in addition to the package ones. of the package''s project in addition to the package ones.
' '
example: 1 example: 1
responses: responses:
'200': '200':
@ -30438,7 +30438,7 @@ paths:
description: 'Passing the number of the revision, this endpoint displays the description: 'Passing the number of the revision, this endpoint displays the
attributes'' XML as it was at that point. attributes'' XML as it was at that point.
' '
example: 3 example: 3
- name: view - name: view
in: query in: query
@ -30465,7 +30465,7 @@ paths:
attribute of the package''s project, if any, in addition to the package attribute of the package''s project, if any, in addition to the package
one. one.
' '
example: 1 example: 1
responses: responses:
'200': '200':
@ -31231,6 +31231,13 @@ paths:
required: true required: true
description: Package name description: Package name
example: ctris example: ctris
- in: query
name: deleted
schema:
type: string
enum:
-
description: Set to retrieve the package metadata of a deleted package.
- in: query - in: query
name: meta name: meta
schema: schema:
@ -31920,7 +31927,7 @@ paths:
type: string type: string
description: 'Set to 1 to allow overwriting of a pre-existing package. description: 'Set to 1 to allow overwriting of a pre-existing package.
' '
example: 1 example: 1
- in: query - in: query
name: rev name: rev
@ -32247,7 +32254,7 @@ paths:
time: 1678785078 time: 1678785078
user: Admin user: Admin
comment: Copying the build environment from origin comment: Copying the build environment from origin
requestid: requestid:
'400': '400':
description: | description: |
Bad Request. Bad Request.
@ -32493,8 +32500,8 @@ paths:
version: 2.10~pre version: 2.10~pre
time: 1665060711 time: 1665060711
user: Admin user: Admin
comment: comment:
requestid: requestid:
'400': '400':
description: Bad Request. description: Bad Request.
content: content:
@ -32751,8 +32758,8 @@ paths:
version: 2.10~pre version: 2.10~pre
time: 1665060711 time: 1665060711
user: Admin user: Admin
comment: comment:
requestid: requestid:
'400': '400':
description: Bad Request. description: Bad Request.
content: content:
@ -33389,7 +33396,7 @@ paths:
- 0 - 0
description: Set to `1` to only show changed files, and not details inside description: Set to `1` to only show changed files, and not details inside
files. files.
example: example:
- in: query - in: query
name: olinkrev name: olinkrev
schema: schema:
@ -33733,7 +33740,7 @@ paths:
type: string type: string
description: 'Set to 1 to allow overwriting of a pre-existing package. description: 'Set to 1 to allow overwriting of a pre-existing package.
' '
example: 1 example: 1
- name: add_repositories_rebuild - name: add_repositories_rebuild
in: query in: query
@ -33879,7 +33886,7 @@ paths:
- getprojectservices - getprojectservices
responses: responses:
'200': '200':
description: description:
content: content:
application/xml; charset=utf-8: application/xml; charset=utf-8:
schema: schema:
@ -34475,7 +34482,7 @@ paths:
description: 'Link revision in base package. Set to `base` to use the commit description: 'Link revision in base package. Set to `base` to use the commit
revision. revision.
' '
example: base example: base
- in: query - in: query
name: rev name: rev
@ -34752,8 +34759,8 @@ paths:
version: 2.10~pre version: 2.10~pre
time: 1665060711 time: 1665060711
user: Admin user: Admin
comment: comment:
requestid: requestid:
'400': '400':
description: | description: |
Bad Request. Bad Request.
@ -34975,7 +34982,7 @@ paths:
description: 'Limit the release to a certain repository, set on the project description: 'Limit the release to a certain repository, set on the project
repository definitions. repository definitions.
' '
example: openSUSE_Tumbleweed example: openSUSE_Tumbleweed
- in: query - in: query
name: setrelease name: setrelease
@ -34984,7 +34991,7 @@ paths:
description: 'If this parameter is present, the release will be tagged with description: 'If this parameter is present, the release will be tagged with
this parameter''s value. this parameter''s value.
' '
example: Build8.18 example: Build8.18
- in: query - in: query
name: arch name: arch
@ -37888,8 +37895,8 @@ paths:
version: 1 version: 1
time: 1678787266 time: 1678787266
user: Admin user: Admin
comment: comment:
requestid: requestid:
'401': '401':
description: | description: |
Unauthorized. Unauthorized.
@ -39460,7 +39467,7 @@ paths:
obsolete requests as well as missing reviews, otherwise don''t pass this obsolete requests as well as missing reviews, otherwise don''t pass this
query parameter." query parameter."
' '
- name: status - name: status
in: query in: query
schema: schema:
@ -39470,7 +39477,7 @@ paths:
status xml (broken packages, missing reviews, checks, etc.), otherwise don''t status xml (broken packages, missing reviews, checks, etc.), otherwise don''t
pass this query parameter" pass this query parameter"
' '
- name: history - name: history
in: query in: query
schema: schema:
@ -39859,7 +39866,7 @@ paths:
obsolete requests as well as missing reviews, otherwise don''t pass this obsolete requests as well as missing reviews, otherwise don''t pass this
query parameter. query parameter.
' '
- name: status - name: status
in: query in: query
schema: schema:
@ -39870,7 +39877,7 @@ paths:
status xml (broken packages, missing reviews, checks, etc.), otherwise don''t status xml (broken packages, missing reviews, checks, etc.), otherwise don''t
pass this query parameter. pass this query parameter.
' '
- name: history - name: history
in: query in: query
schema: schema:
@ -40545,7 +40552,7 @@ paths:
summary: 'Request ID currently excluded from project project_name. summary: 'Request ID currently excluded from project project_name.
Use --remove-exclusion if you want to force this action. Use --remove-exclusion if you want to force this action.
' '
Unknown Request: Unknown Request:
value: value:
code: invalid_request code: invalid_request
@ -47425,7 +47432,7 @@ paths:
- name: x86_64:1a1f67b948b6:2 - name: x86_64:1a1f67b948b6:2
no_workers: no_workers:
summary: No Workers Satisfy the Constraints summary: No Workers Satisfy the Constraints
value: value:
'400': '400':
description: Bad Request. description: Bad Request.
content: content:

183
bots-common/obs_utils.go Normal file
View File

@ -0,0 +1,183 @@
package common
import (
"encoding/xml"
"fmt"
"io"
"log"
"net/http"
"net/url"
)
type ObsClient struct {
baseUrl *url.URL
client *http.Client
user, password string
cookie string
}
func NewObsClient(host, username, password string) (*ObsClient, error) {
baseUrl, err := url.Parse("https://" + host)
if err != nil {
return nil, err
}
return &ObsClient{
baseUrl: baseUrl,
client: &http.Client{},
user: username,
password: password,
}, nil
}
type RepositoryMeta struct {
Name string `xml:"name,attr"`
Arch []string `xml:"arch"`
Path []struct {
XMLName xml.Name `xml:"path"`
Project string `xml:"project,attr"`
Repository string `xml:"repository,attr"`
}
}
type ProjectMeta struct {
XMLName xml.Name `xml:"project"`
Name string `xml:"name,attr"`
Title string `xml:"title"`
Description string `xml:"description"`
ScmSync string `xml:"xmlsync"`
Repositories []Repository `xml:"repository"`
}
func parseProjectMeta(data []byte) (*ProjectMeta, error) {
var meta ProjectMeta
err := xml.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
return &meta, nil
}
func (c *ObsClient) GetProjectMeta(project string) (*ProjectMeta, error) {
req, err := http.NewRequest("GET", c.baseUrl.JoinPath("source", project, "_meta").String(), nil)
if err != nil {
return nil, err
}
req.SetBasicAuth(c.user, c.password)
res, err := c.client.Do(req)
if err != nil {
return nil, err
}
switch res.StatusCode {
case 200:
break
case 404:
return nil, nil
default:
return nil, fmt.Errorf("Unexpected return code: %d", res.StatusCode)
}
data, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}
return parseProjectMeta(data)
}
func (c *ObsClient) DeleteProject(project string) error {
req, err := http.NewRequest("DELETE", c.baseUrl.JoinPath("source", project).String(), nil)
if err != nil {
return err
}
req.SetBasicAuth(c.user, c.password)
res, err := c.client.Do(req)
if err != nil {
return err
}
if res.StatusCode != 200 {
return fmt.Errorf("Unexpected return code: %d", res.StatusCode)
}
return nil
}
type BuildStatus struct {
Package string `xml:"package,attr"`
Code string `xml:"code,attr"`
Details string `xml:"details"`
}
type BuildResult struct {
Project string `xml:"project,attr"`
Repository string `xml:"repository,attr"`
Arch string `xml:"arch,attr"`
Code string `xml:"code,attr"`
Status []BuildStatus `xml:"status"`
Binaries []BinaryList `xml:"binarylist"`
}
type Binary struct {
Size uint64 `xml:"size,attr"`
Filename string `xml:"filename,attr"`
Mtime uint64 `xml:"mtime,attr"`
}
type BinaryList struct {
Package string `xml:"package,attr"`
Binary []Binary `xml:"binary"`
}
type BuildResultList struct {
XMLName xml.Name `xml:"resultlist"`
Result []BuildResult `xml:"result"`
}
func parseBuildResults(data []byte) (*BuildResultList, error) {
result := BuildResultList{}
err := xml.Unmarshal(data, &result)
if err != nil {
return nil, err
}
return &result, nil
}
func (c *ObsClient) BuildStatus(project string) (*BuildResultList, error) {
u := c.baseUrl.JoinPath("build", project, "_result")
query := u.Query()
query.Add("view", "status")
query.Add("view", "binarylist")
query.Add("multibuild", "1")
u.RawQuery = query.Encode()
req, err := http.NewRequest("GET", u.String(), nil)
log.Print(u.String())
if err != nil {
return nil, err
}
req.SetBasicAuth(c.user, c.password)
res, err := c.client.Do(req)
if err != nil {
return nil, err
}
if res.StatusCode != 200 {
return nil, fmt.Errorf("Unexpected return code: %d", res.StatusCode)
}
data, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}
return parseBuildResults(data)
}

View File

@ -0,0 +1,266 @@
package common
import (
"testing"
)
func TestParseProjectMeta(t *testing.T) {
res, err := parseProjectMeta([]byte(metaPrjData))
if err != nil {
return t.Fatal(err)
}
if res.
}
func TestParsingOfBuildResults(t *testing.T) {
res, err := parseBuildResults([]byte(buildResultData))
if err != nil {
t.Fatal(err)
}
if res.Result[0].Project != "home:adamm" ||
res.Result[0].Status[1].Details != "nothing provides libBox2D-devel" ||
res.Result[0].Status[0].Code != "excluded" {
t.Fatal(res.Result)
}
if res.Result[0].Binaries[0].Package != "Nudoku" ||
len(res.Result[0].Binaries[0].Binary) != 0 {
t.Fatal(res.Result[0].Binaries[0])
}
}
const metaPrjData = `
<project name="home:adamm">
<title>Adam's Home Projects</title>
<description/>
<person userid="adamm" role="maintainer"/>
<build>
<enable/>
</build>
<publish>
<enable/>
</publish>
<repository name="openSUSE_Tumbleweed">
<path project="openSUSE:Tumbleweed" repository="standard"/>
<arch>x86_64</arch>
<arch>aarch64</arch>
</repository>
<repository name="containerfile">
<path project="openSUSE:Containers:Tumbleweed" repository="containers"/>
<path project="openSUSE:Factory:ARM" repository="standard"/>
<arch>aarch64</arch>
</repository>
<repository name="container">
<path project="openSUSE:Containers:Tumbleweed" repository="containers"/>
<path project="openSUSE:Factory:ARM" repository="standard"/>
<arch>aarch64</arch>
</repository>
</project>
`
const buildResultData = `
<resultlist state="4c058c53835d10cbbfc6f0ee546a921f">
<result project="home:adamm" repository="openSUSE_Tumbleweed" arch="x86_64" code="published" state="published">
<status package="Nudoku" code="excluded"/>
<status package="geekofall" code="unresolvable">
<details>nothing provides libBox2D-devel</details>
</status>
<status package="geekofall.1" code="unresolvable">
<details>nothing provides libBox2D-devel</details>
</status>
<status package="http-parser" code="failed"/>
<status package="minicoredumper" code="failed"/>
<status package="opensuse-dovecot-image" code="broken">
<details>conflict in file _service</details>
</status>
<status package="opensuse-nsd-image" code="disabled"/>
<status package="opensuse-opendkim-image" code="excluded"/>
<status package="test" code="broken">
<details>no source uploaded</details>
</status>
<status package="visual-studio-rpi-pico-sshd-image" code="excluded"/>
<binarylist package="Nudoku"/>
<binarylist package="geekofall">
<binary filename="_buildenv" size="162675" mtime="1613557547"/>
<binary filename="_statistics" size="955" mtime="1613557547"/>
<binary filename="geekofall-1536436213.a078a60-13.37.src.rpm" size="30213" mtime="1613557547"/>
<binary filename="geekofall-1536436213.a078a60-13.37.x86_64.rpm" size="87666" mtime="1613557547"/>
<binary filename="geekofall-debuginfo-1536436213.a078a60-13.37.x86_64.rpm" size="43740" mtime="1613557547"/>
<binary filename="rpmlint.log" size="990" mtime="1613557546"/>
</binarylist>
<binarylist package="geekofall.1">
<binary filename="_buildenv" size="161411" mtime="1613557546"/>
<binary filename="_statistics" size="955" mtime="1613557546"/>
<binary filename="geekofall-1.0-1.36.src.rpm" size="39526" mtime="1613557547"/>
<binary filename="geekofall-1.0-1.36.x86_64.rpm" size="87583" mtime="1613557547"/>
<binary filename="geekofall-debuginfo-1.0-1.36.x86_64.rpm" size="43907" mtime="1613557547"/>
<binary filename="rpmlint.log" size="308" mtime="1613557546"/>
</binarylist>
<binarylist package="http-parser">
<binary filename="_buildenv" size="13162" mtime="1490341842"/>
<binary filename="_statistics" size="702" mtime="1490341842"/>
<binary filename="http-parser-2.7.1-1.7.src.rpm" size="58213" mtime="1490341842"/>
<binary filename="libhttp_parser-devel-2.7.1-1.7.x86_64.rpm" size="11596" mtime="1490341843"/>
<binary filename="libhttp_parser2-2.7.1-1.7.x86_64.rpm" size="24523" mtime="1490341843"/>
<binary filename="rpmlint.log" size="322" mtime="1490341842"/>
</binarylist>
<binarylist package="minicoredumper">
<binary filename="_buildenv" size="160856" mtime="1631825754"/>
<binary filename="_statistics" size="952" mtime="1631825754"/>
<binary filename="libminicoredumper2-2.0.1-2.41.x86_64.rpm" size="11789" mtime="1631825754"/>
<binary filename="libminicoredumper2-debuginfo-2.0.1-2.41.x86_64.rpm" size="17071" mtime="1631825755"/>
<binary filename="minicoredumper-2.0.1-2.41.src.rpm" size="303867" mtime="1631825755"/>
<binary filename="minicoredumper-2.0.1-2.41.x86_64.rpm" size="41509" mtime="1631825755"/>
<binary filename="minicoredumper-debuginfo-2.0.1-2.41.x86_64.rpm" size="83137" mtime="1631825755"/>
<binary filename="minicoredumper-debugsource-2.0.1-2.41.x86_64.rpm" size="40197" mtime="1631825755"/>
<binary filename="minicoredumper-devel-2.0.1-2.41.x86_64.rpm" size="14717" mtime="1631825755"/>
<binary filename="minicoredumper-utils-2.0.1-2.41.x86_64.rpm" size="21336" mtime="1631825755"/>
<binary filename="minicoredumper-utils-debuginfo-2.0.1-2.41.x86_64.rpm" size="32338" mtime="1631825755"/>
<binary filename="rpmlint.log" size="1466" mtime="1631825754"/>
</binarylist>
<binarylist package="opensuse-dovecot-image"/>
<binarylist package="opensuse-nsd-image"/>
<binarylist package="opensuse-opendkim-image"/>
<binarylist package="test"/>
<binarylist package="visual-studio-rpi-pico-sshd-image"/>
</result>
<result project="home:adamm" repository="openSUSE_Tumbleweed" arch="aarch64" code="published" state="published">
<status package="Nudoku" code="excluded"/>
<status package="geekofall" code="unresolvable">
<details>nothing provides libBox2D-devel</details>
</status>
<status package="geekofall.1" code="unresolvable">
<details>nothing provides libBox2D-devel</details>
</status>
<status package="http-parser" code="failed"/>
<status package="minicoredumper" code="failed"/>
<status package="opensuse-dovecot-image" code="broken">
<details>conflict in file _service</details>
</status>
<status package="opensuse-nsd-image" code="disabled"/>
<status package="opensuse-opendkim-image" code="excluded"/>
<status package="test" code="broken">
<details>no source uploaded</details>
</status>
<status package="visual-studio-rpi-pico-sshd-image" code="excluded"/>
<binarylist package="Nudoku"/>
<binarylist package="geekofall"/>
<binarylist package="geekofall.1"/>
<binarylist package="http-parser"/>
<binarylist package="minicoredumper"/>
<binarylist package="opensuse-dovecot-image"/>
<binarylist package="opensuse-nsd-image"/>
<binarylist package="opensuse-opendkim-image"/>
<binarylist package="test"/>
<binarylist package="visual-studio-rpi-pico-sshd-image"/>
</result>
<result project="home:adamm" repository="containerfile" arch="aarch64" code="published" state="published">
<status package="Nudoku" code="excluded"/>
<status package="geekofall" code="excluded"/>
<status package="geekofall.1" code="excluded"/>
<status package="http-parser" code="excluded"/>
<status package="minicoredumper" code="excluded"/>
<status package="opensuse-dovecot-image" code="broken">
<details>conflict in file _service</details>
</status>
<status package="opensuse-nsd-image" code="disabled"/>
<status package="opensuse-opendkim-image" code="excluded"/>
<status package="test" code="broken">
<details>no source uploaded</details>
</status>
<status package="visual-studio-rpi-pico-sshd-image" code="succeeded"/>
<binarylist package="Nudoku"/>
<binarylist package="geekofall"/>
<binarylist package="geekofall.1"/>
<binarylist package="http-parser"/>
<binarylist package="minicoredumper"/>
<binarylist package="opensuse-dovecot-image"/>
<binarylist package="opensuse-nsd-image"/>
<binarylist package="opensuse-opendkim-image"/>
<binarylist package="test"/>
<binarylist package="visual-studio-rpi-pico-sshd-image">
<binary filename="_blob.sha256:9ea20f002e582c3fc8d14062450a6c4a4165317961d2af9b9e7b0d4e080f1c3c" size="38617846" mtime="1719856307"/>
<binary filename="_blob.sha256:9f9058a297fba8e8d5234de28cee922e039e4f622722514d7012f36d5a4eabd9" size="312194914" mtime="1721404809"/>
<binary filename="_blob.sha256:ac4e7722af8bc4c504a796b53ff48c5071b52de2da633845cd0c74cfd32dec9f" size="6845" mtime="1721404809"/>
<binary filename="_buildenv" size="144706" mtime="1721404745"/>
<binary filename="_statistics" size="1012" mtime="1721404745"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.basepackages" size="19094" mtime="1721404745"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.cdx.json" size="102955" mtime="1721404745"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.containerinfo" size="1364" mtime="1721404809"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.obsbinlnk" size="701" mtime="1721404809"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.packages" size="30189" mtime="1721404745"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.report" size="66947" mtime="1721404745"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.spdx.json" size="13509128" mtime="1721404745"/>
<binary filename="rpi-pico-vscode.aarch64-6.182.tar" size="350823936" mtime="1721404745"/>
</binarylist>
</result>
<result project="home:adamm" repository="container" arch="aarch64" code="published" state="published">
<status package="Nudoku" code="excluded"/>
<status package="geekofall" code="excluded"/>
<status package="geekofall.1" code="excluded"/>
<status package="http-parser" code="excluded"/>
<status package="minicoredumper" code="excluded"/>
<status package="opensuse-dovecot-image" code="broken">
<details>conflict in file _service</details>
</status>
<status package="opensuse-nsd-image" code="failed"/>
<status package="opensuse-opendkim-image" code="unresolvable">
<details>have choice for /usr/bin/openssl needed by opendkim: libressl openssl-1_0_0 openssl-3</details>
</status>
<status package="test" code="broken">
<details>no source uploaded</details>
</status>
<status package="visual-studio-rpi-pico-sshd-image" code="excluded"/>
<binarylist package="Nudoku"/>
<binarylist package="geekofall"/>
<binarylist package="geekofall.1"/>
<binarylist package="http-parser"/>
<binarylist package="minicoredumper"/>
<binarylist package="opensuse-dovecot-image">
<binary filename="_blob.sha256:6b4fea0b9f77d0a5b66de148fb28109c5012e0831d30ff14fefa953fd06b3bfb" size="4545634" mtime="1715975625"/>
<binary filename="_blob.sha256:b1e156fe04a0d30d27c7989c6403346f343212f39cc3ffdb0ab31207b3a11734" size="2579" mtime="1716584488"/>
<binary filename="_blob.sha256:c6588a65781845c90cda432251b7b098a64b94e98261a39306451c8318c9e130" size="31074584" mtime="1716584488"/>
<binary filename="_buildenv" size="144566" mtime="1716584481"/>
<binary filename="_statistics" size="1011" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.basepackages" size="9920" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.docker.cdx.json" size="48775" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.docker.containerinfo" size="1485" mtime="1716584488"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.docker.obsbinlnk" size="745" mtime="1716584488"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.docker.spdx.json" size="2008180" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.docker.tar" size="35627520" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.docker.tar.sha256" size="125" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.docker.tar.sha256.asc" size="481" mtime="1716584489"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.packages" size="15559" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.report" size="33131" mtime="1716584481"/>
<binary filename="opensuse-dovecot-image.aarch64-1.0.0-Build15.21.verified" size="156" mtime="1716584481"/>
</binarylist>
<binarylist package="opensuse-nsd-image">
<binary filename="_blob.sha256:109084b53bf1ad4a0d98db0cb442ecb197d73fe946351001a6b4b756369ce074" size="4545407" mtime="1712925763"/>
<binary filename="_blob.sha256:8fdaf68f1e41f06656875fc0f29fc248e7011cef766fbdda2a2061a6b0722b9c" size="2531" mtime="1713297940"/>
<binary filename="_blob.sha256:db672aec4faacd3c9cefb56bde6795ed638c5239cc1aa3160f87e0965b0f03cd" size="9675022" mtime="1713297940"/>
<binary filename="_buildenv" size="142894" mtime="1713297937"/>
<binary filename="_statistics" size="1009" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.basepackages" size="9920" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.docker.cdx.json" size="41631" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.docker.containerinfo" size="1453" mtime="1713297940"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.docker.obsbinlnk" size="710" mtime="1713297940"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.docker.spdx.json" size="549331" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.docker.tar" size="14226944" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.docker.tar.sha256" size="120" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.docker.tar.sha256.asc" size="481" mtime="1713297940"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.packages" size="13321" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.report" size="28055" mtime="1713297937"/>
<binary filename="opensuse-nsd-image.aarch64-1.0.0-Build7.86.verified" size="156" mtime="1713297937"/>
</binarylist>
<binarylist package="opensuse-opendkim-image"/>
<binarylist package="test"/>
<binarylist package="visual-studio-rpi-pico-sshd-image"/>
</result>
</resultlist>
`

View File

@ -8,7 +8,6 @@ import (
"src.opensuse.org/autogits/common" "src.opensuse.org/autogits/common"
"src.opensuse.org/autogits/common/gitea-generated/models" "src.opensuse.org/autogits/common/gitea-generated/models"
"src.opensuse.org/autogits/common/obs"
) )
const ( const (
@ -65,16 +64,12 @@ func processPullNotification(h *common.RequestHandler, notification *models.Noti
switch review.State { switch review.State {
case common.ReviewStateUnknown, common.ReviewStateRequestReview: case common.ReviewStateUnknown, common.ReviewStateRequestReview:
// start review -- create project in OBS
obsClient, _ := obs.NewClient("api.opensuse.org", obs.WithBaseURL("api.opensuse.org"))
// obsClient.GetSourceProjectNameMeta
case common.ReviewStatePending: case common.ReviewStatePending:
// waiting for build results // waiting for build results
case common.ReviewStateApproved: case common.ReviewStateApproved:
// done, mark notification as read // done, mark notification as read
case common.ReviewStateRequestChanges: case common.ReviewStateRequestChanges:
// build failures, mark notification as read // build failures, mark notification as read
} }
} }
} }
@ -114,6 +109,14 @@ func main() {
pollWorkNotifications() pollWorkNotifications()
c, _ := common.NewObsClient("api.opensuse.org", "autogits_obs_staging_bot", "?E3N9']$YaC9~uR1")
status, err := c.BuildStatus("home:adamm")
if err != nil {
log.Printf("err: %v\n", err)
} else {
log.Print(*status)
}
stuck := make(chan int) stuck := make(chan int)
<-stuck <-stuck
} }