chart-testing-action icon indicating copy to clipboard operation
chart-testing-action copied to clipboard

No chart changes detected

Open SapiensAnatis opened this issue 2 years ago • 9 comments

Hey, I'm probably messing something up here, but every run of the action on my chart repo is saying that nothing has changed when it has.

Take for instance this run: https://github.com/SapiensAnatis/helm-charts/actions/runs/4033008969

which was triggered by this commit: https://github.com/SapiensAnatis/helm-charts/commit/47289587c35a1bad55d4e46ff6b3d1d59563fe2c

It says that nothing has changed when I've clearly updated one of the templates. Additionally, I think my directory structure is sound, with

Git repository
├───.github
│   └───workflows
└───charts
    └───dragalia-api
        ├───charts
        └───templates
            └───tests

Feel free to look at the repo itself but summarily the chart depends on two bitnami charts (redis and postgresql) and has the following ct.yaml

remote: origin
chart-dirs:
  - charts
chart-repos:
  - bitnami=https://charts.bitnami.com/bitnami
helm-extra-args: --timeout 600s

When I run the same command that the action is running, ct list-changed --target-branch master --config ct.yaml --remote=origin after making a change, I see the chart in the list of changes so not sure what's going on

SapiensAnatis avatar Jan 29 '23 00:01 SapiensAnatis

I took a look at your repo and cloned that and run locally the ct with a chart change and that works fine.

does that still an issue? otherwise lets close this issue, thanks!

cpanato avatar Mar 24 '23 10:03 cpanato

I can verify that this affects me too.

Locally:

$ ct list-changed --target-branch master --config ct.yaml --remote=origin
containers/helm

But, initial PR where I try to use this action doesn't detect any changes. And no checking is done.

IMHO, it's not very obvious what I'm doing wrong. And it seems by this, I'm not the only that have problems.

MindTooth avatar Oct 31 '23 21:10 MindTooth

I can verify that this affects me too.

Locally:

$ ct list-changed --target-branch master --config ct.yaml --remote=origin
containers/helm

But, initial PR where I try to use this action doesn't detect any changes. And no checking is done.

IMHO, it's not very obvious what I'm doing wrong. And it seems by this, I'm not the only that have problems.

@MindTooth made a comment in your PR, that change should work, i've tested in a fork and works for me

cpanato avatar Nov 01 '23 08:11 cpanato

@SapiensAnatis i dont see the job in the repo to reproduce the issue

cpanato avatar Nov 01 '23 08:11 cpanato

I can verify that this affects me too. Locally:

$ ct list-changed --target-branch master --config ct.yaml --remote=origin
containers/helm

But, initial PR where I try to use this action doesn't detect any changes. And no checking is done. IMHO, it's not very obvious what I'm doing wrong. And it seems by this, I'm not the only that have problems.

@MindTooth made a comment in your PR, that change should work, i've tested in a fork and works for me

I saw. Thank you! 🙏🏻 Any reason why I need --config ct.yaml? I thought that it was the standard file that ct parsed.

Notice that if no config file is specified, then ct.yaml (or any of the supported formats) is loaded from the current directory, $HOME/.ct, or /etc/ct, in that order, if found.

MindTooth avatar Nov 01 '23 08:11 MindTooth

you also can set CT_CONFIG_DIR

cpanato avatar Nov 01 '23 09:11 cpanato

@SapiensAnatis is right; changes are not being detected.

      - name: Run chart-testing (list-changed)
        id: list-changed
        run: |
          changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
          if [[ -n "$changed" ]]; then
            echo "changed=true" >> "$GITHUB_OUTPUT"
          fi

Maybe detected but although I replace "true" operators with "false", the steps don't work:

  ```
  • name: Run chart-testing (lint) if: steps.list-changed.outputs.changed == 'true' run: ct lint --target-branch ${{ github.event.repository.default_branch }}

    - name: Create kind cluster
      if: steps.list-changed.outputs.changed == 'true'
      uses: helm/[email protected]
    
    - name: Run chart-testing (install)
      if: steps.list-changed.outputs.changed == 'true'
      run: ct install --target-branch ${{ github.event.repository.default_branch }}
    

tirelibirefe avatar May 09 '24 17:05 tirelibirefe

I added --config .github/ct.yaml, I think it works now.

tirelibirefe avatar May 09 '24 22:05 tirelibirefe

It seems like this is being caused by CT_CONFIG_DIR being set in ct.sh.

This feels like an anti-pattern, since chart-testing supports .ct/ct.yaml without further configuration.

znd4 avatar Jun 06 '24 14:06 znd4