DEV Community

Jonas Brømsø
Jonas Brømsø

Posted on

Release 0.8.0 of stevedore - minor feature enhancement

I only just recently I published my first blog post on stevedore, now it is time for a follow up.

This is the first release since that blog post, which pretty much described release 0.7.0 of my side-project: stevedore (see: GitHub repository)

As the project matures I have come up with a few more ideas and I have extended the descriptions of some of the things I want to do.

gh issue list --state all --json number,title,state --template '{{range .}}{{tablerow .number .title .state}}{{"\n"}}{{end}}'
Enter fullscreen mode Exit fullscreen mode
21  Proposed feature: watch mode                                 OPEN
19  Handle issue with having . in the output                     CLOSED
18  Option to optimize output for improved ignorefile artefacts  OPEN
17  Proposed feature: Stacked ignore files                       OPEN
11  Proposed feature: configuration file                         OPEN
6   Proposed feature: output as tree structure                   OPEN
5   Proposed feature: read from STDIN                            CLOSED
4   Proposed feature: interactive edit mode                      OPEN
2   Dependency Dashboard                                         CLOSED
Enter fullscreen mode Exit fullscreen mode

Issue #5 has been implemented some time ago and with release 0.8.0 issue #19 was closed.

Starting to use stevedore on some of my other projects demonstrated that it was a bad idea to emit: "." for possible inclusion in a .dockerignore file, since what I am aiming for is something along the lines of:

stevedore --included . >> .dockerignore
Enter fullscreen mode Exit fullscreen mode

The files included in Docker image would be:

.
.DS_Store
.dockerignore
.editorconfig
.github
.github/ISSUE_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
.github/auto_assign.yml
.github/dependabot.yml
.github/renovate.json
.github/workflows
.github/workflows/markdownlint.yml
.github/workflows/publish.yml
.github/workflows/spellcheck.yml
.gitignore
.markdownlint.json
.spellcheck.yml
.stevedoreignore
.yakignore
.yaksums.json
CONTRIBUTING.md
_config.yml
assets
assets/ebirah_by_zappazee.png
cpanfile
cpanfile.snapshot
dictionary.dic
ebirah.code-workspace
Enter fullscreen mode Exit fullscreen mode

And the files already excluded by the .dockerignore file would be:

.wordlist.txt
CHANGELOG.md
CODE_OF_CONDUCT.md
Dockerfile
LICENSE
README.md
prototypes
prototypes/Dockerfile
prototypes/ebirah.sh
Enter fullscreen mode Exit fullscreen mode

Based on the existing .dockerignore file

CHANGELOG.md
Dockerfile
LICENSE
README.md
prototypes
.wordlist.txt
CODE_OF_CONDUCT.md
Enter fullscreen mode Exit fullscreen mode

But as you can see the "." was emitted from our invocation, which we wanted to use for updating our .dockerignore file.

From release 0.8.0 this is not longer the case. So now we can do:

stevedore --included . >> .dockerignore
Enter fullscreen mode Exit fullscreen mode
CHANGELOG.md
Dockerfile
LICENSE
README.md
prototypes
.wordlist.txt
CODE_OF_CONDUCT.md
.DS_Store
.dockerignore
.editorconfig
.github
.github/ISSUE_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
.github/auto_assign.yml
.github/dependabot.yml
.github/renovate.json
.github/workflows
.github/workflows/markdownlint.yml
.github/workflows/publish.yml
.github/workflows/spellcheck.yml
.gitignore
.markdownlint.json
.spellcheck.yml
.stevedoreignore
.yakignore
.yaksums.json
CONTRIBUTING.md
_config.yml
assets
assets/ebirah_by_zappazee.png
cpanfile
cpanfile.snapshot
dictionary.dic
ebirah.code-workspace
Enter fullscreen mode Exit fullscreen mode

Now we just need to do a manual change, since we need: cpanfile and cpanfile.snapshot to be included in the Docker image.

So our final .dockerignore files will look as follows:

CHANGELOG.md
Dockerfile
LICENSE
README.md
prototypes
.wordlist.txt
CODE_OF_CONDUCT.md
.DS_Store
.dockerignore
.editorconfig
.github
.github/ISSUE_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
.github/auto_assign.yml
.github/dependabot.yml
.github/renovate.json
.github/workflows
.github/workflows/markdownlint.yml
.github/workflows/publish.yml
.github/workflows/spellcheck.yml
.gitignore
.markdownlint.json
.spellcheck.yml
.stevedoreignore
.yakignore
.yaksums.json
CONTRIBUTING.md
_config.yml
assets
assets/ebirah_by_zappazee.png
!cpanfile
!cpanfile.snapshot
dictionary.dic
ebirah.code-workspace
Enter fullscreen mode Exit fullscreen mode

This is good, but we do need to address the issue of: cpanfile and .cpanfile being reported as not ignored, hence included, but these are handled, so I somehow need to indicate this, so it is back to the drawing board.

Running stevedore with --verbose:

stevedore --verbose .
. is ignored, but traversed by stevedore by default
path .DS_Store ignored and is not included in Docker image
path .dockerignore ignored and is not included in Docker image
path .editorconfig ignored and is not included in Docker image
.git have been ignored by stevedore, no traversal
path .github ignored and is not included in Docker image
path .github/ISSUE_TEMPLATE.md ignored and is not included in Docker image
path .github/PULL_REQUEST_TEMPLATE.md ignored and is not included in Docker image
path .github/auto_assign.yml ignored and is not included in Docker image
path .github/dependabot.yml ignored and is not included in Docker image
path .github/renovate.json ignored and is not included in Docker image
path .github/workflows ignored and is not included in Docker image
path .github/workflows/markdownlint.yml ignored and is not included in Docker image
path .github/workflows/publish.yml ignored and is not included in Docker image
path .github/workflows/spellcheck.yml ignored and is not included in Docker image
path .gitignore ignored and is not included in Docker image
path .markdownlint.json ignored and is not included in Docker image
path .spellcheck.yml ignored and is not included in Docker image
path .stevedoreignore ignored and is not included in Docker image
path .wordlist.txt ignored and is not included in Docker image
path .yakignore ignored and is not included in Docker image
path .yaksums.json ignored and is not included in Docker image
path CHANGELOG.md ignored and is not included in Docker image
path CODE_OF_CONDUCT.md ignored and is not included in Docker image
path CONTRIBUTING.md ignored and is not included in Docker image
path Dockerfile ignored and is not included in Docker image
path LICENSE ignored and is not included in Docker image
path README.md ignored and is not included in Docker image
path _config.yml ignored and is not included in Docker image
path assets ignored and is not included in Docker image
path assets/ebirah_by_zappazee.png ignored and is not included in Docker image
path cpanfile not ignored and is included in Docker image
path cpanfile.snapshot not ignored and is included in Docker image
path dictionary.dic ignored and is not included in Docker image
path ebirah.code-workspace ignored and is not included in Docker image
local have been ignored by stevedore, no traversal
path prototypes ignored and is not included in Docker image
path prototypes/Dockerfile ignored and is not included in Docker image
path prototypes/ebirah.sh ignored and is not included in Docker image
Enter fullscreen mode Exit fullscreen mode

Emits a verbose message on the new handling of ".".

. is ignored, but traversed by stevedore by default
Enter fullscreen mode Exit fullscreen mode

In addition to this new problem I need to handle, I would also like to emit a more intelligent proposal for the .dockerignore file. For example collapsing .github etc. I have already created an issue for this (#18).

Well .github should perhaps be included in .stevedoreignore as .git and local, but assets/ could be collapsed into a single: assets/ instead of listing all contents separately.

I know this will be more easy to maintain, I am however unsure whether it has any impact on performance, perhaps some benchmarking would be beneficial, before making a decision.

As mentioned in the change log (see below), I am not completely satisfied with the solution of hard-coding handling of "." inside stevedore, but it will do for now. Perhaps a better solution will show itself as stevedore evolves.

Change log for 0.8.0

0.8.0 2023-02-17 feature release, update not required

  • "." was included in the ignore pattern output, which does not really make sense, so it has been eliminated from the output. It is not super solution since it is no so flexible, but it will have to do for now, ref: #19

Top comments (0)