Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to update if commit is null #35

Open
jbaker-nca opened this issue Jan 10, 2019 · 1 comment
Open

Fails to update if commit is null #35

jbaker-nca opened this issue Jan 10, 2019 · 1 comment
Labels

Comments

@jbaker-nca
Copy link

The /jobs API can return null for a commit if that branch has been removed from the source control. This is not a usual situation, but has happened to us where a backup went awry.

However, if the commit object is null, then the Gitlab Dashboard fails to parse and stops updating any projects after the project with the null commit. The error message in the console is:

Polling failed with error: Failed to parse jobs: (NonEmptyList (NonEmpty (ErrorAtProperty "commit" (ErrorAtProperty "short_id" (TypeMismatch "object" "object"))) Nil))

And a sample response from the /jobs API with this problem is:

{"id":36068,"status":"failed","stage":"build","name":"build","ref":"master_merge_2018-06-13-12-55-18","tag":false,"coverage":null,"created_at":"2019-01-10T11:46:38.043Z","started_at":"2019-01-10T11:46:39.825Z","finished_at":"2019-01-10T11:46:44.817Z","duration":4.9919,"user":{"id":4,"name":"James","username":"bakerj","state":"active","avatar_url":"https://gitlab.local/uploads/-/system/user/avatar/4/avatar.png","web_url":"https://gitlab.local/bakerj","created_at":"2018-07-05T08:38:59.015Z","bio":"","location":"","public_email":"","skype":"","linkedin":"","twitter":"","website_url":"","organization":""},"commit":null,"pipeline":{"id":650,"sha":"053ac952b64d5649ba4d7992d8b47475500086dc","ref":"master_merge_2018-06-13-12-55-18","status":"failed","web_url":"https://gitlab.local/ABC/DEF/pipelines/650"},"web_url":"https://gitlab.local/ABC/DEF/-/jobs/36068","artifacts":[{"file_type":"trace","size":895,"filename":"job.log","file_format":null}],"runner":{"id":1,"description":"docker-runner-1","ip_address":"XYZ.XYZ.XYZ.XYZ","active":true,"is_shared":true,"name":"gitlab-runner","online":true,"status":"online"},"artifacts_expire_at":null},
@f-f f-f added the bug label Jan 10, 2019
@f-f
Copy link
Member

f-f commented Jan 10, 2019

Yep, this sounds like a bug in the way we model the API in the types: here the commit field should be a Maybe Commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants