Page MenuHomePhabricator

[toolforge-cli][build] show fails if the pipelinerun has no 'status'
Closed, ResolvedPublic3 Estimated Story Points

Description

When runing toolforge build show on a build entry that has no status, the cli breaks with:

dcaro@vulcanus$ toolforge build show  minikube-user-buildpacks-pipelinerun-jpgbk
Traceback (most recent call last):
  File "/home/dcaro/.virtualenvs/toolforge-cli-python3/bin/toolforge", line 8, in <module>
    sys.exit(main())
  File "/home/dcaro/Work/wikimedia/toolforge-cli/toolforge_cli/cli.py", line 563, in main
    toolforge()
  File "/home/dcaro/.virtualenvs/toolforge-cli-python3/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/dcaro/.virtualenvs/toolforge-cli-python3/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/dcaro/.virtualenvs/toolforge-cli-python3/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/dcaro/.virtualenvs/toolforge-cli-python3/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/dcaro/.virtualenvs/toolforge-cli-python3/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/dcaro/.virtualenvs/toolforge-cli-python3/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/dcaro/Work/wikimedia/toolforge-cli/toolforge_cli/cli.py", line 530, in build_show
    status = next(condition for condition in run["status"]["conditions"] if condition["type"] == "Succeeded")
KeyError: 'status'

See the full run object as json here:

1{
2 "apiVersion": "tekton.dev/v1beta1",
3 "kind": "PipelineRun",
4 "metadata": {
5 "creationTimestamp": "2022-11-18T12:56:53Z",
6 "generateName": "minikube-user-buildpacks-pipelinerun-",
7 "generation": 1,
8 "labels": {
9 "user": "minikube-user"
10 },
11 "managedFields": [
12 {
13 "apiVersion": "tekton.dev/v1beta1",
14 "fieldsType": "FieldsV1",
15 "fieldsV1": {
16 "f:metadata": {
17 "f:generateName": {},
18 "f:labels": {
19 ".": {},
20 "f:user": {}
21 }
22 },
23 "f:spec": {
24 ".": {},
25 "f:params": {},
26 "f:pipelineRef": {
27 ".": {},
28 "f:name": {}
29 },
30 "f:serviceAccountName": {},
31 "f:workspaces": {}
32 }
33 },
34 "manager": "python-requests",
35 "operation": "Update",
36 "time": "2022-11-18T12:56:53Z"
37 }
38 ],
39 "name": "minikube-user-buildpacks-pipelinerun-jpgbk",
40 "namespace": "image-build",
41 "resourceVersion": "200215",
42 "uid": "18427b43-4b2d-4559-b181-fd811336f3af"
43 },
44 "spec": {
45 "params": [
46 {
47 "name": "BUILDER_IMAGE",
48 "value": "docker-registry.tools.wmflabs.org/toolforge-bullseye0-builder"
49 },
50 {
51 "name": "APP_IMAGE",
52 "value": "192.168.1.111/minikube-user/dcaro:latest"
53 },
54 {
55 "name": "SOURCE_URL",
56 "value": "https://github.com/david-caro/wm-lol"
57 },
58 {
59 "name": "USER_ID",
60 "value": "61312"
61 },
62 {
63 "name": "GROUP_ID",
64 "value": "61312"
65 }
66 ],
67 "pipelineRef": {
68 "name": "buildpacks"
69 },
70 "serviceAccountName": "buildpacks-service-account",
71 "workspaces": [
72 {
73 "emptyDir": {},
74 "name": "source-ws"
75 },
76 {
77 "emptyDir": {},
78 "name": "cache-ws"
79 }
80 ]
81 }
82}

This object was created with a broken installation that did not start the runs (ex. with the tekton-controller stopped)

Related Objects

StatusSubtypeAssignedTask
ResolvedLucasWerkmeister
Resolvedmatmarex
ResolvedLegoktm
ResolvedLegoktm
Opendcaro
Resolveddcaro
ResolvedRaymond_Ndibe
ResolvedRaymond_Ndibe
ResolvedRaymond_Ndibe
ResolvedRaymond_Ndibe
ResolvedNone
Resolveddcaro
Resolveddcaro
ResolvedRaymond_Ndibe
Resolveddcaro
ResolvedRaymond_Ndibe
ResolvedRaymond_Ndibe

Event Timeline

dcaro updated the task description. (Show Details)
Slst2020 set the point value for this task to 3.Nov 23 2022, 4:43 PM

Related task that's already been resolved: T322190

Change 865607 had a related patch set uploaded (by Raymond Ndibe; author: Raymond Ndibe):

[cloud/toolforge/toolforge-cli@main] toolforge-cli: show better messaging if the pipelinerun has no 'status'

https://gerrit.wikimedia.org/r/865607

Change 865607 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] toolforge-cli: show better messaging if the pipelinerun has no 'status'

https://gerrit.wikimedia.org/r/865607

Change 866493 had a related patch set uploaded (by Raymond Ndibe; author: Raymond Ndibe):

[cloud/toolforge/toolforge-cli@main] toolforge-cli: show better messaging if the pipelinerun has no 'status'

https://gerrit.wikimedia.org/r/866493

Change 866493 merged by jenkins-bot:

[cloud/toolforge/toolforge-cli@main] toolforge-cli: show better messaging if the pipelinerun has no 'status'

https://gerrit.wikimedia.org/r/866493