errordeveloper / imagine

a high-level container image build tool
Other
7 stars 0 forks source link

semver tags rebuild logic is broken when `--without-tag-suffix` is set #28

Open errordeveloper opened 2 years ago

errordeveloper commented 2 years ago
 [0] >> git init hubble-otel-test                         
Initialized empty Git repository in /Users/ilya/Code/otel/hubble-otel-test/.git/
 [0] >> cd hubble-otel-test 
 [0] >> git remote add origin https://github.com/cilium/hubble-otel
 [0] >> git config --local gc.auto 0
 [0] >> git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin '+refs/heads/*:refs/remotes/origin/*' '+refs/tags/*:refs/tags/*'
remote: Enumerating objects: 12347, done.
remote: Counting objects: 100% (12347/12347), done.
remote: Compressing objects: 100% (7815/7815), done.
remote: Total 12347 (delta 4075), reused 11806 (delta 3648), pack-reused 0
Receiving objects: 100% (12347/12347), 20.56 MiB | 8.24 MiB/s, done.
Resolving deltas: 100% (4075/4075), done.
From https://github.com/cilium/hubble-otel
 * [new branch]      main        -> origin/main
 * [new branch]      user-guides -> origin/user-guides
 * [new tag]         v0.1.0-rc.1 -> v0.1.0-rc.1
 [0] >> git checkout --progress --force refs/tags/v0.1.0-rc.1
Updating files: 100% (6730/6730), done.
Note: switching to 'refs/tags/v0.1.0-rc.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 4a74e1c Do not run tests during image build
$ make images.otelcol
/Users/ilya/Code/otel/hubble-otel-test/.gopath/bin/imagine build \
        --builder=$(cat .buildx_builder) \
        --base ./ \
        --root \
        --dockerfile=./images/otelcol/Dockerfile \
        --upstream-branch=origin/main \
        --name=otelcol \
        --registry=ghcr.io/cilium/hubble-otel \
        --without-tag-suffix=false \
        --push=false
rebuilding as remote image "ghcr.io/cilium/hubble-otel/otelcol:v0.1.0-rc.1" is not present
...
^C
$ make images.otelcol WITHOUT_TAG_SUFFIX=true
/Users/ilya/Code/otel/hubble-otel-test/.gopath/bin/imagine build \
        --builder=$(cat .buildx_builder) \
        --base ./ \
        --root \
        --dockerfile=./images/otelcol/Dockerfile \
        --upstream-branch=origin/main \
        --name=otelcol \
        --registry=ghcr.io/cilium/hubble-otel \
        --without-tag-suffix=true \
        --push=false
no need to rebuild
/Users/ilya/Code/otel/hubble-otel-test/.gopath/bin/imagine image \
        --base=./ \
        --root \
        --upstream-branch=origin/main \
        --name=otelcol \
        --registry=ghcr.io/cilium/hubble-otel \
        --without-tag-suffix=true \
        > image-otelcol.tag
$
errordeveloper commented 2 years ago

This will need to be validated after work on build config is merged into main branch, doesn't make much sense to address it before that as quite a few things are being reworked.