summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv/client.py
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2024-04-12 11:02:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-12 18:04:00 +0100
commit0087b3e7291428f80ede303e0edcfb114611eed5 (patch)
tree4bf64f846082443b3c6148f060c01b35eba53211 /bitbake/lib/prserv/client.py
parent0154036c061b1d50531bf6a1ba9dd4e226f77a54 (diff)
downloadpoky-0087b3e7291428f80ede303e0edcfb114611eed5.tar.gz
bitbake: prserv: add extra requests
Useful for connecting a PR server to an upstream one - "test-package" checks whether the specified package version and arch is known in the database. - "test-pr" checks a specified output hash is found in the database. Otherwise it returns 'None' instead of a new value. - "max-package-pr" returns the highest PR number for (version, arch) entries in the database, and None if not found Add new DB functions supporting the above, plus test_value() which tells whether a given value is available for the specified package and architecture. (Bitbake rev: c65b5d9056e3f8b9869b3fdc8689f43a0b83b10e) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Cc: Joshua Watt <JPEWhacker@gmail.com> Cc: Tim Orling <ticotimo@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv/client.py')
-rw-r--r--bitbake/lib/prserv/client.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/bitbake/lib/prserv/client.py b/bitbake/lib/prserv/client.py
index 7bc5188c53..8471ee3046 100644
--- a/bitbake/lib/prserv/client.py
+++ b/bitbake/lib/prserv/client.py
@@ -20,6 +20,27 @@ class PRAsyncClient(bb.asyncrpc.AsyncClient):
20 if response: 20 if response:
21 return response["value"] 21 return response["value"]
22 22
23 async def test_pr(self, version, pkgarch, checksum):
24 response = await self.invoke(
25 {"test-pr": {"version": version, "pkgarch": pkgarch, "checksum": checksum}}
26 )
27 if response:
28 return response["value"]
29
30 async def test_package(self, version, pkgarch):
31 response = await self.invoke(
32 {"test-package": {"version": version, "pkgarch": pkgarch}}
33 )
34 if response:
35 return response["value"]
36
37 async def max_package_pr(self, version, pkgarch):
38 response = await self.invoke(
39 {"max-package-pr": {"version": version, "pkgarch": pkgarch}}
40 )
41 if response:
42 return response["value"]
43
23 async def importone(self, version, pkgarch, checksum, value): 44 async def importone(self, version, pkgarch, checksum, value):
24 response = await self.invoke( 45 response = await self.invoke(
25 {"import-one": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "value": value}} 46 {"import-one": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "value": value}}
@@ -44,7 +65,7 @@ class PRAsyncClient(bb.asyncrpc.AsyncClient):
44class PRClient(bb.asyncrpc.Client): 65class PRClient(bb.asyncrpc.Client):
45 def __init__(self): 66 def __init__(self):
46 super().__init__() 67 super().__init__()
47 self._add_methods("getPR", "importone", "export", "is_readonly") 68 self._add_methods("getPR", "test_pr", "test_package", "importone", "export", "is_readonly")
48 69
49 def _get_async_client(self): 70 def _get_async_client(self):
50 return PRAsyncClient() 71 return PRAsyncClient()