Skip to content

Running a build against a shelved CL that doesn't exist should give a nicer error than a stacktrace. #215

Description

@petemounce

Versions of relevant software used

4.4.0 bk plugin

What happened

Python stacktrace

What you expected to happen

Something like

ERROR: your CL (75176) does not exist in perforce.

How to reproduce it (as minimally and precisely as possible):

Trigger a build of a shelved CL where that does not exist.

Full logs to relevant components

DetailsLogs

Running plugin perforce checkout hook | 5s
-- | --
  | # A hook runner was written to "/var/lib/buildkite-agent/tmp/20693f98-b9ca-44d8-a1de-a880198dba21/buildkite-agent-bootstrap-hook-runner-571790165" with the following:
  | $ /var/lib/buildkite-agent/tmp/20693f98-b9ca-44d8-a1de-a880198dba21/buildkite-agent-bootstrap-hook-runner-571790165
  | You are using pip version 8.1.1, however version 20.2.4 is available.
  | You should consider upgrading via the 'pip install --upgrade pip' command.
  | 10:12:41 p4python INFO: p4 trust -y
  | 10:12:42 p4python INFO: p4 client -o bk-p4-something-something
  | 10:12:42 p4python INFO: p4 client -i
  | 10:12:43 p4python INFO: Client bk-p4-something-something not changed.
  | 10:12:43 p4python INFO: p4 revert -w //...
  | 10:12:43 p4python WARNING: //... - file(s) not opened on this client.
  | 10:12:43 p4python INFO: p4 sync --parallel=threads=0 //my-depot/my-folder/my-second-folder/.buildkite/...@75176
  | 10:12:43 p4python WARNING: //my-depot/my-folder/my-second-folder/.buildkite/...@75176 - file(s) up-to-date.
  | 10:12:44 p4python INFO: p4 describe -S 75177
  | Traceback (most recent call last):
  | File "/var/lib/buildkite-agent/plugins/github-com-improbable-eng-perforce-buildkite-plugin-v4-4-0/hooks/../python/checkout.py", line 47, in <module>
  | main()
  | File "/var/lib/buildkite-agent/plugins/github-com-improbable-eng-perforce-buildkite-plugin-v4-4-0/hooks/../python/checkout.py", line 37, in main
  | repo.p4print_unshelve(changelist)
  | File "/var/lib/buildkite-agent/plugins/github-com-improbable-eng-perforce-buildkite-plugin-v4-4-0/python/perforce.py", line 291, in p4print_unshelve
  | depotfiles = changeinfo['depotFile']
  | KeyError: 'depotFile'

Anything else we need to know

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions