mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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: 0f1474a30f741b760ca81c19dd1d8f3bd5647251) 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>
This commit is contained in:
committed by
Richard Purdie
parent
62a3a7172a
commit
112a37e6a9
@@ -20,6 +20,27 @@ class PRAsyncClient(bb.asyncrpc.AsyncClient):
|
||||
if response:
|
||||
return response["value"]
|
||||
|
||||
async def test_pr(self, version, pkgarch, checksum):
|
||||
response = await self.invoke(
|
||||
{"test-pr": {"version": version, "pkgarch": pkgarch, "checksum": checksum}}
|
||||
)
|
||||
if response:
|
||||
return response["value"]
|
||||
|
||||
async def test_package(self, version, pkgarch):
|
||||
response = await self.invoke(
|
||||
{"test-package": {"version": version, "pkgarch": pkgarch}}
|
||||
)
|
||||
if response:
|
||||
return response["value"]
|
||||
|
||||
async def max_package_pr(self, version, pkgarch):
|
||||
response = await self.invoke(
|
||||
{"max-package-pr": {"version": version, "pkgarch": pkgarch}}
|
||||
)
|
||||
if response:
|
||||
return response["value"]
|
||||
|
||||
async def importone(self, version, pkgarch, checksum, value):
|
||||
response = await self.invoke(
|
||||
{"import-one": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "value": value}}
|
||||
@@ -44,7 +65,7 @@ class PRAsyncClient(bb.asyncrpc.AsyncClient):
|
||||
class PRClient(bb.asyncrpc.Client):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._add_methods("getPR", "importone", "export", "is_readonly")
|
||||
self._add_methods("getPR", "test_pr", "test_package", "importone", "export", "is_readonly")
|
||||
|
||||
def _get_async_client(self):
|
||||
return PRAsyncClient()
|
||||
|
||||
Reference in New Issue
Block a user