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

list-changed command fails without error #69

Closed
sundowndev opened this issue Jun 10, 2021 · 7 comments · Fixed by #75
Closed

list-changed command fails without error #69

sundowndev opened this issue Jun 10, 2021 · 7 comments · Fixed by #75

Comments

@sundowndev
Copy link

sundowndev commented Jun 10, 2021

I try to set up a basic helm chart repo but I'm stuck with this issue :

image

I also tried running ct list-changed directly but it does not show anything.

my workflow:

name: Lint and Test Charts

on:
  pull_request:
    paths-ignore:
      - 'README.md'
      - 'charts/**/README.md'
      - 'LICENSE'

jobs:
  lint-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0        

      - name: Install Helm
        uses: azure/setup-helm@v1
        with:
          version: v3.4.0

      - name: Set up chart-testing
        uses: helm/chart-testing-action@v2.0.1

      - name: Run chart-testing (list-changed) # <- stuck here
        id: list-changed
        run: |
          changed=$(ct list-changed)
          if [[ -n "$changed" ]]; then
            echo "::set-output name=changed::true"
          fi

      - name: Run chart-testing (lint)
        id: lint
        if: steps.list-changed.outputs.changed == 'true'
        run: ct lint --config ct.yaml

      - name: Create kind cluster
        uses: helm/kind-action@v1.1.0
        with:
          install_local_path_provisioner: true
        if: steps.list-changed.outputs.changed == 'true'

      - name: Run chart-testing (install)
        id: install
        if: steps.list-changed.outputs.changed == 'true'
        run: ct install --config ct.yaml

ct.yaml

helm-extra-args: --timeout 600s
chart-dirs:
  - charts
target-branch: main

file structure :

$ tree
.
├── charts
│   └── driftctl
│       ├── Chart.yaml
│       ├── templates
│       │   ├── _helpers.tpl
│       │   ├── job.yaml
│       │   ├── NOTES.txt
│       │   └── volume-cm.yaml
│       └── values.yaml
├── ct.yaml
├── LICENSE
└── README.md

3 directories, 9 files
@sundowndev sundowndev changed the title chart testing (list-changed) fails without error list-changed command fails without error Jun 10, 2021
@afritzler
Copy link

Running into the same issue here. @sundowndev where you able to fix the problem?

@sundowndev
Copy link
Author

sundowndev commented Jun 21, 2021

Running into the same issue here. @sundowndev where you able to fix the problem?

No. I ended up removing this step from my workflow.

@wissamataleh
Copy link

Same issue

@AymanMagdy
Copy link

It's working fine with me and returns the changed charts under dir helm/ [ where all my charts are listed ]
changed=$(ct list-changed --remote origin --target-branch=staging --chart-dirs helm/)

You must pass the following:
--remote, for your where your source code
--target-branch, [ optional and its default is main/master ]
--chart-dirs, where you point to the helm chart dir

@mathewmeconry
Copy link

@sundowndev , @wissamataleh , @afritzler you probably have the same issues as we had.
Github changed the naming of the default branch from master to main. This causes an issue because cts default target branch is master and not main

To get it working add the option --target-branch and the value main

      - name: Run chart-testing (list-changed)
        id: list-changed
        run: |
          changed=$(ct list-changed --target-branch main)
          if [[ -n "$changed" ]]; then
            echo "::set-output name=changed::true"
          fi

the same thing applies to the ct lint and ct install command.

@sundowndev
Copy link
Author

@mathewmeconry Look at my OP, I have this option in the ct.yaml

helm-extra-args: --timeout 600s
chart-dirs:
  - charts
target-branch: main

@troyfontaine
Copy link

@mathewmeconry Look at my OP, I have this option in the ct.yaml

helm-extra-args: --timeout 600s
chart-dirs:
  - charts
target-branch: main

After testing it looks like ct.yaml is ignored/not used by chart tester in this action. You must specify the flags for the commands individually.

lemeurherve added a commit to lemeurherve/chart-testing-action that referenced this issue Dec 8, 2021
lemeurherve pushed a commit to lemeurherve/chart-testing-action that referenced this issue Dec 8, 2021
lemeurherve pushed a commit to lemeurherve/chart-testing-action that referenced this issue Dec 8, 2021
Fixes helm#69

Signed-off-by: Hervé Le Meur <hlemeur@cloudbees.com>
lemeurherve pushed a commit to lemeurherve/chart-testing-action that referenced this issue Dec 8, 2021
Fixes helm#69

Signed-off-by: Hervé Le Meur <hlemeur@cloudbees.com>
cpanato pushed a commit that referenced this issue Mar 14, 2022
Fixes #69

Signed-off-by: Hervé Le Meur <hlemeur@cloudbees.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants