norwoodj / helm-docs

A tool for automatically generating markdown documentation for helm charts
GNU General Public License v3.0
1.29k stars 178 forks source link

Not able to ignore chart folder even after adding entry in .helmdocsignore file #206

Open Pallavi028 opened 6 months ago

Pallavi028 commented 6 months ago

Is there an existing issue for this?

Current Behavior

Hi ,

I'm trying to ignore one directory (helm-chart) under charts folder using .helmdocsignore file but upon running helm-docs cli command, it is still considering those directories which needs to be ignored and generating the README.md file for them.

Here is my .helmdocsignore file look like - charts/app-portal charts/app-portal/Chart.yaml

My directory structure looks like this ls -altr total 48 drwxr-xr-x 3 pallavipratik staff 96 Dec 6 21:10 env -rw-r--r-- 1 pallavipratik staff 20 Dec 6 21:10 properties.yaml drwxr-xr-x 12 pallavipratik staff 384 Dec 6 21:10 templates drwxr-xr-x 12 pallavipratik staff 384 Dec 6 21:10 .. -rw-r--r-- 1 pallavipratik staff 664 Dec 7 11:42 values.yaml -rw-r--r-- 1 pallavipratik staff 396 Dec 7 12:53 Chart.lock -rw-r--r-- 1 pallavipratik staff 277 Dec 7 14:21 Chart.yaml drwxr-xr-x 7 pallavipratik staff 224 Dec 7 14:29 charts -rwxrwxrwx 1 pallavipratik staff 47 Dec 7 14:31 .helmdocsignore -rw-r--r-- 1 pallavipratik staff 1564 Dec 7 14:42 README.md drwxr-xr-x 11 pallavipratik staff 352 Dec 7 15:31 .

Under charts folder I have my dependency charts, (where I want to ignore one of the depdendent chart.) ls -ltr charts/ total 416 -rw-r--r-- 1 pallavipratik staff 114938 Dec 7 14:23 common-1.0.60.tgz -rw-r--r-- 1 pallavipratik staff 92088 Dec 7 14:24 app-portal-1.0.38.tgz drwxr-xr-x 14 pallavipratik staff 448 Dec 7 14:28 common drwxr-xr-x 11 pallavipratik staff 352 Dec 7 14:30 app-portal

When running helm-docs, getting below logs helm-docs -i .helmdocsignore

INFO[2023-12-07T14:42:56+05:30] Found Chart directories [., charts/app-portal, charts/app-portal/charts/banking-prometheus-rules, charts/app-portal/charts/banking-prometheus-rules/charts/common, charts/app-portal/charts/common, charts/common] INFO[2023-12-07T14:42:56+05:30] Generating README Documentation for chart charts/app-portal/charts/banking-prometheus-rules INFO[2023-12-07T14:42:56+05:30] Generating README Documentation for chart charts/app-portal/charts/common INFO[2023-12-07T14:42:56+05:30] Generating README Documentation for chart .
INFO[2023-12-07T14:42:56+05:30] Generating README Documentation for chart charts/common INFO[2023-12-07T14:42:56+05:30] Generating README Documentation for chart charts/app-portal/charts/banking-prometheus-rules/charts/common INFO[2023-12-07T14:42:56+05:30] Generating README Documentation for chart charts/app-portal

One thing to note that its not printing log msg like No ignore file found at helm-charts/.helmdocsignore, using empty ignore rules

helm-docs version I'm using is helm-docs --version helm-docs version 1.11.3

Expected Behavior

Expected behaviour would be , helm-docs should ignore app-portal folder under charts directory as I have made an entry in the ..helmdocsignore file .

Reference Chart

NA

Reference Template

No response

Environment

Link to helm-docs Logs

No response

Further Information

No response

borisrizov-zf commented 6 months ago

I can confirm the behaviour. I have a charts/pgadmin4 folder in my main charts/project folder. Ignoring does nothing. Might be useful to add a flag to ignore a folder without setting a .helmdocsignore file, e.g. --ignore-dir some-dir/.

The only thing that doesn't happen is to add the sub-documentation to the main documentation. Maybe that's the intended behaviour?

norwoodj commented 4 months ago

This is not intended behavior, however I cannot reproduce this. Can one of you send me a tar archive of your repository, or make one of these repositories publicly available in some way so I can test against your setup?

borisrizov-zf commented 4 months ago

Hi, the repository where I had the issue: https://github.com/eclipse-tractusx/managed-identity-wallet

norwoodj commented 4 months ago

@borisrizov-zf in your case, the .helmdocsignore file is at the wrong location:

$ find . -name .helmdocsignore
./charts/managed-identity-wallet/.helmdocsignore
$ cat $(!!)
charts/
$ helm-docs -l debug
DEBU[2024-03-02T13:43:41Z] No ignore file found at /tmp/managed-identity-wallet/.helmdocsignore, using empty ignore rules 
...

The .helmdocsignore file is like a .gitignore file, it must be at the root of the repository.

$ mv charts/managed-identity-wallet/.helmdocsignore .
$ echo charts/managed-identity-wallet/charts > .helmdocsignore 
$ helm-docs -l debug
DEBU[2024-03-02T13:46:38Z] Found ignore file at /tmp/managed-identity-wallet/.helmdocsignore, using those ignore rules 
DEBU[2024-03-02T13:46:38Z] Ignoring directory /tmp/managed-identity-wallet/.git 
DEBU[2024-03-02T13:46:38Z] Ignoring directory /tmp/managed-identity-wallet/charts/managed-identity-wallet/charts 

I wouldn't be surprised if this is also @Pallavi028's problem, but I'm having trouble understanding for sure from their comment.

borisrizov-zf commented 4 months ago

@norwoodj Hey, awesome! Thank you so much, I'll make sure to fix that right away.