Skip to content

Commit

Permalink
Merge pull request #32 from nuclearcat/add-platformfilter-new
Browse files Browse the repository at this point in the history
Add platformfilter option support and documentation
  • Loading branch information
aliceinwire authored Oct 16, 2024
2 parents 2045fca + 9d3d76b commit 2eb9424
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 1 deletion.
75 changes: 75 additions & 0 deletions docs/checkout.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,82 @@ Where:
- `branch` is the branch of the git repository to test.
- `commit` is the commit hash to test.
- `jobfilter` is the job filter to use for the test (optional parameter)
- `platformfilter` is the platform filter (usually it is name of hardware platform for group of devices) to use for the test (optional parameter)

To figure out correct jobfilter and platformfilter, you need to check test json node. For example:
```json
{
"id": "670f0c27493b6b8188c7667c",
"kind": "job",
"name": "tast-mm-misc-arm64-qualcomm",
"path": [
"checkout",
"kbuild-gcc-12-arm64-chromeos-qualcomm",
"tast-mm-misc-arm64-qualcomm"
],
"group": "tast-mm-misc-arm64-qualcomm",
"parent": "670f0782493b6b8188c7621c",
"state": "done",
"result": "pass",
"artifacts": {
"lava_log": "https://kciapistagingstorage1.file.core.windows.net/staging/tast-mm-misc-arm64-qualcomm-670f0c27493b6b8188c7667c/log.txt.gz?sv=2022-11-02&ss=f&srt=sco&sp=r&se=2024-10-17T19:19:12Z&st=2023-10-17T11:19:12Z&spr=https&sig=sLmFlvZHXRrZsSGubsDUIvTiv%2BtzgDq6vALfkrtWnv8%3D",
"callback_data": "https://kciapistagingstorage1.file.core.windows.net/staging/tast-mm-misc-arm64-qualcomm-670f0c27493b6b8188c7667c/lava_callback.json.gz?sv=2022-11-02&ss=f&srt=sco&sp=r&se=2024-10-17T19:19:12Z&st=2023-10-17T11:19:12Z&spr=https&sig=sLmFlvZHXRrZsSGubsDUIvTiv%2BtzgDq6vALfkrtWnv8%3D"
},
"data": {
"error_code": null,
"error_msg": null,
"test_source": null,
"test_revision": null,
"platform": "sc7180-trogdor-lazor-limozeen",
"device": "sc7180-trogdor-lazor-limozeen-cbg-7",
"runtime": "lava-collabora",
"job_id": "16081547",
"job_context": null,
"regression": null,
"kernel_revision": {
"tree": "kernelci",
"url": "https://github.com/kernelci/linux.git",
"branch": "staging-mainline",
"commit": "c862449c840a37bbe797a0b719881449beac75ca",
"describe": "staging-mainline-20241016.0",
"version": {
"version": 6,
"patchlevel": 12,
"sublevel": null,
"extra": "-rc3-45-gc862449c840a3",
"name": null
},
"patchset": null,
"commit_tags": [
"staging-mainline-20241016.0"
],
"commit_message": "staging-mainline-20241016.0",
"tip_of_branch": false
},
"arch": "arm64",
"defconfig": "cros://chromeos-6.6/arm64/chromiumos-qualcomm.flavour.config",
"config_full": "+lab-setup+arm64-chromebook+CONFIG_MODULE_COMPRESS=n+CONFIG_MODULE_COMPRESS_NONE=y",
"compiler": "gcc-12",
"kernel_type": "image"
},
"debug": null,
"jobfilter": null,
"platform_filter": null,
"created": "2024-10-16T00:43:19.079000",
"updated": "2024-10-16T02:22:58.113000",
"timeout": "2024-10-16T06:43:19.079000",
"holdoff": null,
"owner": "staging.kernelci.org",
"submitter": "service:pipeline",
"treeid": "f53af2a7273aed52629647124c95e8ddc79a317b93bced2ee36837bde03d88af",
"user_groups": []
}
```

In this example, the jobfilter is `tast-mm-misc-arm64-qualcomm` for test, if you look into path, you can figure out also build job named and the platformfilter is `kbuild-gcc-12-arm64-chromeos-qualcomm` and in data/platform: `sc7180-trogdor-lazor-limozeen`. So complete command to test this job would be:
```sh
kci-dev checkout --giturl https://github.com/kernelci/linux.git --branch staging-mainline --commit c862449c840a37bbe797a0b719881449beac75ca --jobfilter tast-mm-misc-arm64-qualcomm --jobfilter kbuild-gcc-12-arm64-chromeos-qualcomm --platformfilter sc7180-trogdor-lazor-limozeen
```

Other options:

Expand Down
11 changes: 10 additions & 1 deletion kci-dev/subcommands/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def send_checkout_full(baseurl, token, **kwargs):
"commit": kwargs["commit"],
"jobfilter": kwargs["jobfilter"],
}
if "platformfilter" in kwargs:
data["platformfilter"] = kwargs["platformfilter"]
jdata = json.dumps(data)
print(jdata)
try:
response = requests.post(url, headers=headers, data=jdata, timeout=30)
except requests.exceptions.RequestException as e:
Expand Down Expand Up @@ -192,8 +195,13 @@ def retrieve_tot_commit(repourl, branch):
help="Job filter to trigger",
multiple=True,
)
@click.option(
"--platformfilter",
help="Platform filter to trigger",
multiple=True,
)
@click.pass_context
def checkout(ctx, giturl, branch, commit, jobfilter, tipoftree, watch):
def checkout(ctx, giturl, branch, commit, jobfilter, platformfilter, tipoftree, watch):
cfg = ctx.obj.get("CFG")
instance = ctx.obj.get("INSTANCE")
url = api_connection(cfg[instance]["pipeline"])
Expand Down Expand Up @@ -221,6 +229,7 @@ def checkout(ctx, giturl, branch, commit, jobfilter, tipoftree, watch):
branch=branch,
commit=commit,
jobfilter=jobfilter,
platformfilter=platformfilter,
watch=watch,
)
if resp and "message" in resp:
Expand Down

0 comments on commit 2eb9424

Please sign in to comment.