github-pr-resource icon indicating copy to clipboard operation
github-pr-resource copied to clipboard

Names used in example pipeline are ambiguous

Open steadysupply opened this issue 5 years ago • 1 comments

It's great that a self-contained example is provided here. However, since the name of the resource-type and the resource itself are the same, it remains unclear as to how to use the resource type offered by this repo, if only to a newbie Concourse user. I've added commentary to the reproduced example pipeline below to illustrate the abiguity.

resource_types:
- name: pull-request  # the name of the resource type
  type: docker-image
  source:
    repository: teliaoss/github-pr-resource

resources:
- name: pull-request  # the name is the same as the resource type name
  type: pull-request  # when i see this again it's not clear if we're
                      # talking about the resource type or the name of
                      # a concrete resource
  check_every: 24h
  webhook_token: ((webhook-token))
  source:
    repository: itsdalmo/test-repository
    access_token: ((github-access-token))

jobs:
- name: test
  plan:
  - get: pull-request  # ok, we are clearly talking about the name of
                       # a concrete resource here
    trigger: true
    version: every
  - put: pull-request  # but here, is it the name of the resource type
                       # or concrete resource?
    params:
      path: pull-request  # and here? name of type or name of resource?
      status: pending
  - task: unit-test
    config:
      platform: linux
      image_resource:
        type: docker-image
        source: {repository: alpine/git, tag: "latest"}
      inputs:
        - name: pull-request
      run:
        path: /bin/sh
        args:
          - -xce
          - |
            cd pull-request
            git log --graph --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s" > log.txt
            cat log.txt
    on_failure:
      put: pull-request
      params:
        path: pull-request
        status: failure
  - put: pull-request
    params:
      path: pull-request
      status: success

steadysupply avatar Aug 30 '20 12:08 steadysupply

Would it be possible for you to provide a PR with some suggestions?

rickardl avatar Oct 19 '20 00:10 rickardl