Screwdriver: Pipeline status become unknown after [skip ci]

Created on 27 Feb 2019  路  7Comments  路  Source: screwdriver-cd/screwdriver

What happened:
After #1447 fixed, [skip ci] creates an empty event. It might make a pipeline status to unknown. It also brakes a badge status.

What you expected to happen:

  • Set another status for [skip ci] event.
  • Or get a status before [skip ci] event.

How to reproduce it:

  • commit with [skip ci]
  • show a badge of the pipeline

Related: https://github.com/screwdriver-cd/screwdriver/issues/1447

bug

Most helpful comment

@tk3fftk This also applies to sourcePaths.

I think the correct behavior would be get the status before [skip ci] event.

All 7 comments

@tk3fftk This also applies to sourcePaths.

I think the correct behavior would be get the status before [skip ci] event.

It can be realized by executing lastEvent = events.pop() until lastEvent.getBuilds() is not empty.
https://github.com/screwdriver-cd/screwdriver/blob/6cdfabb996d895f8eeb64602f09ab9e3f4d7a0f5/plugins/pipelines/badge.js#L108

I think that there is no part that #1447 had an adverse effect other than the badge. I will try to fix it in the future, so please let me know if I have overlooked something.

The badge that was the number one issue has been corrected.

The status of Event itself is not owned anywhere. For now, as far as I investigated, non-empty event ID is not required anywhere except for api of badge. I think that there is no need to fix to possess the ID of empty event if it is useless. We should think when we need it. I think it is good to close the issue ticket, how is it?

The response of GET /v4/pipelines/<id> is as follows.

{
  id: 1,
  name: 'wahapo/wahapo-repository',
  scmUri: 'github.url:1:master',
  scmContext: 'github:github.url',
  scmRepo:
  {
    branch: 'master',
    name: 'wahapo/wahapo-repository',
    url: 'https://github.url/wahapo/wahapo-repository/tree/master'
  },
  createTime: '2019-03-18T04:00:00.000Z',
  admins: { wahapo: true },
  workflowGraph: { nodes: [Array], edges: [Array] },
  annotations: {},
  lastEventId: 4,
  configPipelineId: undefined,
  childPipelines: undefined,
  prChain: false
}

And the response of GET /v4/events/<id> is as follows.

{
  id: 4,
  causeMessage": 'Merged by wahapo',
  commit: {
    author: {
      avatar: 'avatar.url',
      name: 'wahapo',
      username: 'wahapo',
      url: 'https://github.url/wahapo'
    },
    message: '[skip ci]test',
    url: 'https://github.url/wahapo/wahapo-repository/commit/sha'
  },
  createTime: '2019-03-18T05:00:00.000Z',
  creator: {
    avatar: 'avatar.url',
    name: 'wahapo',
    username: 'wahapo',
    url: 'https://github.url/wahapo'
  },
  meta: {},
  pipelineId: 1,
  sha": 'sha',
  configPipelineSha: 'sha',
  startFrom": '~commit',
  type: 'pipeline',
  workflowGraph: { nodes: [Array], edges: [Array] },
  pr: {}
}

I agree to @wahapo.

The pipeline's status is now affected by [skip ci], but this issue is able to be closed now. We should rethink it when we try to scale the pipeline's status.

@jithin1987 Could you check out this issue?

This should be good to close.
There are couple of separate issues wrt badges

  1. Broken when a job is blocked.
  2. Shows unkown when pipeline is started from middle and job is still running.

Thank you for confirmation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yoshwata picture yoshwata  路  5Comments

jeffreytolar picture jeffreytolar  路  3Comments

catto picture catto  路  6Comments

wahapo picture wahapo  路  7Comments

nkatzman picture nkatzman  路  3Comments