harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
32.07k stars 2.79k forks source link

RFC: repo status per build step #2441

Open jmccann opened 6 years ago

jmccann commented 6 years ago

Summary

This is a proposal to add the ability for every step in a Drone pipeline to be able to create a repo status. Currently only 1 "global" status is created for the entire pipeline (e.g. all steps together).

I feel this could be extremely valuable combined with new ability to allow for a single step not to fail the pipeline (#2071).

Goals

Here are some goals I envision. There are details in each goal that could be tweaked, for example naming of things.

Example Pipeline

pipeline:
  # Does not create a status
  restore-cache:
    image: plugins/drone-s3-cache

  # Creates a status with default context
  lint:
    image: node
    group: test
    status: true
    commands:
      - lint command

  # Creates a status with default context
  test:
    image: node
    group: test
    status: true
    commands:
      - test command

  # Does not create a status
  rebuild-cache:
    image: plugins/drone-s3-cache

  # Create a status with custom context
  build:
    image: plugins/docker
    status: continuous-delivery/docker

  # Create a status with custom context
  deploy-test:
    group: deploy
    status: continuous-delivery/k8s/test

  # Create a status with custom context
  deploy-master:
    group: deploy
    status: continuous-delivery/k8s/master
tboerger commented 6 years ago

Did you already know about https://github.com/drone/drone-plugin-index/pull/125?

jmccann commented 6 years ago

No ... wish I did ... wouldn't have created my own 😢

https://github.com/jmccann/drone-github-status/blob/master/DOCS.md

tboerger commented 6 years ago

Now there are two of this plugins, you should also submit your plugin to the registry ;)

bradrydzewski commented 6 years ago

I also wonder how this feature relates to the Checks API. If we publish every step to the checks API would this still be necessary? I feel like there might be some feature overlap, although I'm not sure yet :)

s0undt3ch commented 5 years ago

If the checks API is supported, several status against the same commit will likely become an obsolete request/need/requirement.

But until checks support is missing, status it is :)

donny-dont commented 5 years ago

I feel like if there was a plugins/status that this issue would solve itself. We could think of it like the git plugin which is implicitly added. If you want to control how status gets reported then you'd just put it at different parts of the pipeline. Or have a status per pipeline.

Honestly in general it would be nice if there was a way to have drone/scm run as a service that pipelines can then interact with. This would open up a lot of different things like checks. So you could make a plugin that would run a linter and then pick up the results and report that back.

bradrydzewski commented 5 years ago

Would support for GitHub Checks supersede this request? With GitHub checks you can report the individual step status directly in the check details section. Example pictured below:

screenshot

s0undt3ch commented 5 years ago

I believe checks would supersede this.