Giter VIP home page Giter VIP logo

commitizen-docker-image's People

Contributors

bilelomrani1 avatar carlossg avatar evantill avatar woile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

commitizen-docker-image's Issues

KeyError: '0 is not registered'

I do my first steps with commitizen and decided to use the docker-image.

In one of my repos I hit errors, now I created a fresh git repo with only one file in it.

I get stuff like:

docker run --rm -v $(pwd):/app -v ~/.gitconfig:/etc/gitconfig -u $(id -u) commitizen/commitizen:latest /bin/sh -c 'cz --debug init'
Warning: Input is not a terminal (fd=0).
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 265, in _add_reader
    key = self._selector.get_key(fd)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/selectors.py", line 192, in get_key
    raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: '0 is not registered'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/input/vt100.py", line 176, in _attached_input
    loop.add_reader(fd, callback_wrapper)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 340, in add_reader
    self._add_reader(fd, callback, *args)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 267, in _add_reader
    self._selector.register(fd, selectors.EVENT_READ,
  File "/usr/local/lib/python3.11/selectors.py", line 359, in register
    self._selector.register(key.fd, poller_events)
PermissionError: [Errno 1] Operation not permitted

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/cz", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/commitizen/cli.py", line 407, in main
    args.func(conf, vars(args))()
  File "/usr/local/lib/python3.11/site-packages/commitizen/commands/init.py", line 29, in __call__
    config_path = self._ask_config_path()
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/commitizen/commands/init.py", line 68, in _ask_config_path
    ).ask()
      ^^^^^
  File "/usr/local/lib/python3.11/site-packages/questionary/question.py", line 70, in ask
    return self.unsafe_ask(patch_stdout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/questionary/question.py", line 92, in unsafe_ask
    return self.application.run()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 978, in run
    return loop.run_until_complete(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 885, in run_async
    return await _run_async(f)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 737, in _run_async
    with self.input.raw_mode(), self.input.attach(
  File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/input/vt100.py", line 185, in _attached_input
    raise EOFError
EOFError

context:

sgw in testrepo (main) [🗃️ ×1]  ✗  ls -la
insgesamt 4
drwxr-xr-x.  3 sgw  sgw   80 10. Jän 14:14 .
drwxrwxrwt. 29 root root 700 10. Jän 14:15 ..
drwxr-xr-x.  7 sgw  sgw  220 10. Jän 14:14 .git
-rw-r--r--.  1 sgw  sgw   10 10. Jän 14:14 README.md
sgw in testrepo (main) [🗃️ ×1]  ❯ git status .
Auf Branch main

Noch keine Commits

Zum Commit vorgemerkte Änderungen:
  (benutzen Sie "git rm --cached <Datei>..." zum Entfernen aus der Staging-Area)
	neue Datei:     README.md

This is on a Fedora 37 workstation, if that matters.

I randomly tried that with an older tags of the image, same issues.

Do I have some mistakes in my approach, what can I do? Thanks.

Error in Dockerfile's CMD

When running

docker run --rm -it -v $(pwd):/usr/src/project commitizen/commitizen:2   

the following error is raised:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"cz version\": executable file not found in $PATH": unknown.

Command in README and WORKDIR don't match

In the README, the command

docker run --rm -v $(pwd):/usr/src/project commitizen/commitizen:latest /bin/sh -c 'cz bump --changelog'

suggests to mount the current directory to /usr/src/project. But in the Dockerfile, the WORKDIR is set to /app and hence docker run -v $(pwd):/usr/src/project commitizen/commitizen git status raises

fatal: not a git repository (or any of the parent directories): .git

Latest versioned docker image is getting overwritten daily

The latest docker image is getting published daily by the GitHub actions, even if there is no release.

While the underlying build of the image has not changed, it does not inspire confidence when you see that the image is constantly being updated.

Currently, https://hub.docker.com/r/commitizen/commitizen/tags is showing that the following tags were updated 12 hours ago (Nov 8th 2022), even though the last release was 12 days ago (Oct 28th 2022).
Tags:

  • latest
  • 2.37.0
  • 2

The 2.35.0 tag shows as last updated on Oct 28th, even though it was released on Sep 12th as this is when the daily update stopped for that version. It's confusing for anyone looking and trying to verify the current image.

Tags for specific versions should be immutable - or at least you should not mutate them. Rolling tags are fine for latest, or major/minor specific tags, (e.g. 2, 2.37), the tags for specific versions should remain unchanged.

Even when rolling tags, they should only be updated when there is an actual underlying version change. By doing it daily, regardless of any changes, you introduce the problem that upstream problems could propagate into your images, that should not be changing.

For example, let's say your upstream image, python:3-alpine, changes. This is a rolling tag, so changes are expected. If this introduces a breaking change (It should not, but it could), then your images are now broken and any pipelines that depend on them may fail unexpectedly.

These problems can be super hard to track down - have done it many times :)

Summary of issue:

  • Don't rebuild & push images daily, unless there is a new version released
  • Don't allow specific version tags to be updated (Though I think in your case, this will be automatically fixed by the first point)

Note: I am not actually affected by this right now, just trying to help :). If needed, I can try to submit a PR for this later on if you need help trying to fix this.

Proposal: use an entrypoint

Hi,

Thank you for this docker image 👍.

Using an ENTRYPOINT when wrapping a cli tool using a docker image ease the use of the image

Example of an article that will explain it better than me https://spin.atomicobject.com/2015/11/30/command-line-tools-docker/

By using an ENTRYPOINT, all of the arguments to docker run following our image name are passed as arguments to our application.

I will be happy to make a PR if you agrre with this proposal.

Please let me know if you have any questions or concerns about this proposal.

Remove pip cache

We should probably use the --no-cache-dir option in the pip command.

fatal: not a git repository (or any of the parent directories): .git

Hello.
I've been trying to use the container, but only got the error:
fatal: not a git repository (or any of the parent directories): .git
commitizen-docker

Tried both ways:

  • Passing the command through the container call:
docker run --rm -v $(pwd):/app -v ~/.gitconfig:/etc/gitconfig commitizen/commitizen:latest /bin/sh -c 'cz bump --yes --changelog'
  • Creating a container and running the command on it:
docker run --rm -it -v $(pwd):/app --entrypoint /bin/sh commitizen/commitizen:latest
cz bump --yes --changelog

As shown in the screenshot, the .git folder is present.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.