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

A couple minor bugs with reporting in kapitan init #306

Closed
dsansot-ru opened this issue Jun 6, 2019 · 1 comment · Fixed by #918
Closed

A couple minor bugs with reporting in kapitan init #306

dsansot-ru opened this issue Jun 6, 2019 · 1 comment · Fixed by #918
Labels
bug enhancement enhancement to an existing feature

Comments

@dsansot-ru
Copy link

dsansot-ru commented Jun 6, 2019

Describe the bug/feature
There are a couple of issues with the output of kapitan init:

  1. It assumes the target directory was empty so shows all files in the target directory as being populated by init. I ran into this by running kapitan init in an empty git repo and was curious why kapitan was writing files to my .git directory.
  2. It doesn't actually show all the files it did populate. I think this is an issue with the way it walks the tree.

To Reproduce
Steps to reproduce the behavior:

  1. Run kapitan init

Expected behavior
Accurately log the files that were written.

Screenshots

On empty directory:

(venv) $ kapitan init --directory kapitan-init-test/
Populated kapitan-init-test/ with:
kapitan-init-test/
kapitan-init-test/inventory
kapitan-init-test/inventory/classes
	 common.yml
	 my_component.yml
kapitan-init-test/templates
kapitan-init-test/templates/scripts
	 my_script.sh
(venv) $ tree kapitan-init-test/
kapitan-init-test/
├── components
│   ├── my_component
│   │   └── my_component.jsonnet
│   └── other_component
│       ├── __init__.py
│       └── __pycache__
│           └── __init__.cpython-37.pyc
├── inventory
│   ├── classes
│   │   ├── common.yml
│   │   └── my_component.yml
│   └── targets
│       └── my_target.yml
└── templates
    ├── docs
    │   └── my_readme.md
    └── scripts
        └── my_script.sh

10 directories, 8 files

If it's a bug (please complete the following information):

  • python --version:
    Python 3.7.2
  • pip3 --version:
    pip 19.1.1
  • Are you using pyenv or virtualenv?
    python3 -m venv venv
@dsansot-ru
Copy link
Author

BTW

$ kapitan --version
0.23.1

@adrianchifor adrianchifor added enhancement enhancement to an existing feature bug labels Feb 24, 2020
jkrzemin added a commit to jkrzemin/kapitan that referenced this issue Jan 4, 2023
Former implementation showed all files in target directory and skipped
some of generated files. Now only files generated are shown and
formatting has been changed to more tree [1] like - from [2] to [3]

Closes kapicorp#306

[1] https://linux.die.net/man/1/tree

[2]
Populated /tmp/fake with:
/tmp/fake
/tmp/fake/templates
/tmp/fake/templates/docs
         my_readme.md
/tmp/fake/components
/tmp/fake/components/other_component
         __init__.py

[3]
Populated /tmp/fake with:
inventory
    classes
        common.yml
        my_component.yml
    targets
        my_target.yml
templates
    scripts
        my_script.sh
    docs
        my_readme.md
components
    my_component
        my_component.jsonnet
    other_component
        __init__.py

fixes ae0b444
jkrzemin added a commit to jkrzemin/kapitan that referenced this issue Jan 14, 2023
Former implementation showed all files in target directory and skipped
some of generated files. Now only files generated are shown and
formatting has been changed to more tree [1] like - from [2] to [3]

Closes kapicorp#306

[1] https://linux.die.net/man/1/tree

[2]
Populated /tmp/fake with:
/tmp/fake
/tmp/fake/templates
/tmp/fake/templates/docs
         my_readme.md
/tmp/fake/components
/tmp/fake/components/other_component
         __init__.py

[3]
Populated /tmp/fake with:
inventory
    classes
        common.yml
        my_component.yml
    targets
        my_target.yml
templates
    scripts
        my_script.sh
    docs
        my_readme.md
components
    my_component
        my_component.jsonnet
    other_component
        __init__.py

fixes ae0b444
ramaro added a commit that referenced this issue Jan 31, 2023
…918)

Former implementation showed all files in target directory and skipped
some of generated files. Now only files generated are shown and
formatting has been changed to more tree [1] like - from [2] to [3]

Closes #306

[1] https://linux.die.net/man/1/tree

[2]
Populated /tmp/fake with:
/tmp/fake
/tmp/fake/templates
/tmp/fake/templates/docs
         my_readme.md
/tmp/fake/components
/tmp/fake/components/other_component
         __init__.py

[3]
Populated /tmp/fake with:
inventory
    classes
        common.yml
        my_component.yml
    targets
        my_target.yml
templates
    scripts
        my_script.sh
    docs
        my_readme.md
components
    my_component
        my_component.jsonnet
    other_component
        __init__.py

fixes ae0b444

Co-authored-by: Ricardo Amaro <ricardo.amaro@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement enhancement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants