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

get list_changed_files does not appear in .git/resources/ #272

Open
djcal460 opened this issue Nov 17, 2021 · 2 comments
Open

get list_changed_files does not appear in .git/resources/ #272

djcal460 opened this issue Nov 17, 2021 · 2 comments

Comments

@djcal460
Copy link

djcal460 commented Nov 17, 2021

When get my pr resource and set the params for list_changed_files: true this does not create a directory as stated in the documentation. For example,

  - get: git-pr
    trigger: true
    version: every
    params:
      list_changed_files: true

After I get the pr resource and put it into pending, I then pass the resource to a task and run a script:

  - task: find_input
    input_mapping:
      source-repo: git-pr
    config:
       ...
      inputs:
        - name: source-repo
      outputs:
        - name: dest-repo
      run:
        path: sh
        args:
          - -exc
          - |
            ls -la source-repo/.git/resource/  >> dest-repo/new_output.txt

Later in the output task, I cat dest-repo/new_output.txt. I do not see .git/resources/changed_files listed. Only the following:

Nov 17 18:41 .
Nov 17 18:41 ..
Nov 17 18:41 author
Nov 17 18:41 author_email
Nov 17 18:41 base_name
Nov 17 18:41 base_sha
Nov 17 18:41 head_name
Nov 17 18:41 head_sha
Nov 17 18:41 message
Nov 17 18:41 metadata.json
Nov 17 18:41 pr
Nov 17 18:41 state
Nov 17 18:41 title
Nov 17 18:41 url
Nov 17 18:41 version.json

Is this a bug or am I doing anything wrong? Thanks in advance!

@EdgeJ
Copy link

EdgeJ commented Apr 7, 2022

@djcal460 I had this same issue and took a while to figure out what was going on. The issue here is the implicit get done when you put the resource to set the status wipes out the previous metadata files for subsequent tasks. What I ended up doing in a similar situation was something like this:

- get: ci
  trigger: true
  version: every

- put: ci
  params:
    path: ci
    context: validation
    status: pending
  get_params:
    list_changed_files: true

- task: foo
...

Using list_changed_files in the put step instead of the get seemed to solve this problem.

@bgandon
Copy link

bgandon commented May 10, 2024

Glad you found an answer to your issue!

But this would also need an update in the docs, don't you think?

Recent news is that the Cloud Foundry community is now maintaining a fork of this resource at cloudfoundry-community/github-pr-resource.

On our Concourse installation at Gstack, that one is working fine. Could you give a try and submit a PR to the docs there?

(the new resource is a drop-in replacement; you only have to switch telia-ossto cfcommunity in in the resource_types: declaration, i.e. specify repository: cfcommunity/github-pr-resource)

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

No branches or pull requests

3 participants