commitsar icon indicating copy to clipboard operation
commitsar copied to clipboard

Add 'docker run' example / incorrect docker result

Open tommyalatalo opened this issue 5 years ago • 20 comments

Could you add a "docker run ..." command example to the repository README.md docs? I've been trying to run commitsar with a direct docker run command, and I think I have it running correctly with this: docker run --rm --name="commitsar" -w /src -v "$(pwd)":/src commitsar/commitsar:0.10.0

But the result is incorrect. I ran the above container from a repository with a master branch containing 71 commits, but commitsar just finds the latest commit and reports 1 of 1 commits are not conventional commit compliant. Why are the other 70 commits ignored?

tommyalatalo avatar Feb 20 '20 08:02 tommyalatalo

First part I will add this week to the README. Thanks again for finding issues like this.

As for:

But the result is incorrect. I ran the above container from a repository with a master branch containing 71 commits, but commitsar just finds the latest commit and reports 1 of 1 commits are not conventional commit compliant. Why are the other 70 commits ignored?

Can you check the discussion here? https://github.com/outillage/commitsar/issues/167#issuecomment-584108836 We need to find a balance of how far to check on master due to repos not having adopted the conventional commit standard in the past.

fallion avatar Feb 20 '20 10:02 fallion

I'm going to add 2 flags which will sort this out. --all which is the use you're looking for and --limit which will limit the number of checked commits.

fallion avatar Feb 20 '20 16:02 fallion

I'm going to add 2 flags which will sort this out. --all which is the use you're looking for and --limit which will limit the number of checked commits.

That would work, but shouldn't "all" be the default behavior? Limiting the range of commits to be checked seems like perfect flag material. What would running commitsar without flags do otherwise?

tommyalatalo avatar Feb 20 '20 17:02 tommyalatalo

Currently it goes like this: on branch -> All commits are checked until the upstream on master -> Last commit is checked in order to not block all repositories that were not conventional commit compliant before

There was a suggestion to mirror GIT_DEPTH as well for how far to check on master. It's primarily an issue during adoption. After that it is fine, but if you have very large repositories you do not want to go too far back as it would constantly fail on master in those repositories.

fallion avatar Feb 20 '20 18:02 fallion

Currently it goes like this: on branch -> All commits are checked until the upstream on master -> Last commit is checked in order to not block all repositories that were not conventional commit compliant before

There was a suggestion to mirror GIT_DEPTH as well for how far to check on master. It's primarily an issue during adoption. After that it is fine, but if you have very large repositories you do not want to go too far back as it would constantly fail on master in those repositories.

Either way works I guess, I hope the --all flag can get implemented soon, I'm itching to get this into my pipeline for the master branch!

tommyalatalo avatar Feb 20 '20 19:02 tommyalatalo

It’ll be up tomorrow. :)

fallion avatar Feb 20 '20 19:02 fallion

It’ll be up tomorrow. :)

Fantastic

tommyalatalo avatar Feb 20 '20 19:02 tommyalatalo

@tommyalatalo sorry about the delay. Here it is: https://github.com/outillage/commitsar/releases/tag/v0.11.0

https://github.com/outillage/commitsar#flags

fallion avatar Feb 24 '20 17:02 fallion

Looking good! WIll you push a new image to docker hub?

tommyalatalo avatar Feb 24 '20 18:02 tommyalatalo

@tommyalatalo Pushed. I migrated this repo to GH Actions, but clearly forgot the docker hub push. 🤦‍♂

fallion avatar Feb 24 '20 20:02 fallion

There is no tag "0.11.0" on docker hub?

tommyalatalo avatar Feb 25 '20 22:02 tommyalatalo

0.11.1 (latest release) is. I’ll release 0.11.0 ASAP.

fallion avatar Feb 25 '20 22:02 fallion

0.11.1 (latest release) is. I’ll release 0.11.0 ASAP.

No its not, at least not tagged as "0.11.1"

docker pull commitsar/commitsar:0.11.1
Error response from daemon: manifest for commitsar/commitsar:0.11.1 not found: manifest unknown: manifest unknown

tommyalatalo avatar Feb 25 '20 22:02 tommyalatalo

I see the issue. https://hub.docker.com/r/outillage/commitsar

There was a rebranding under the outillage name. I’ll set up the backwards compatibility with the old namespace and set up a deprecation strategy.

fallion avatar Feb 25 '20 22:02 fallion

I need to improve communication on such issue, however I need to find the correct medium.

fallion avatar Feb 25 '20 22:02 fallion

@tommyalatalo It has been returned to the old namespace. Give 0.11.2 a try

fallion avatar Mar 02 '20 22:03 fallion

@tommyalatalo is it working ok for you? Can I close this after adding it to docs?

fallion avatar Jun 11 '20 16:06 fallion

https://commitsar.tech/docs/usage/docker

fallion avatar Jun 11 '20 19:06 fallion

It works, but you shouldn't really need to define the workdir though. If you just write the entrypoint to always run in /src then you can just state in the docs that you always mount the git repo to be checked into /src and you can skip setting the workdir. Would be one thing less to consider.

tommyalatalo avatar Jun 12 '20 08:06 tommyalatalo

Good point, will fix.

fallion avatar Jun 12 '20 08:06 fallion