Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Change kuksa-client version handling #618

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

erikbosch
Copy link
Contributor

@erikbosch erikbosch commented Jul 21, 2023

The reason is that all docker builds on master previously got version v0.1.6 which gave odd behavior if downloading kuksa-client:master or even latest

Current behavior

If downloading kuksa-client:master and running it then it will report Welcome to Kuksa Client version 0.1.6
This also occurs if downloading kuksa-client:latest

Expected behavior

Either real tag or something that shows that it is not tagged.

With this PR in CI the version will be like:

0.3.1.post84+git.3cba9d41

i.e. 84 commits after v 0.3.1

I have not tested that it reports right version for tagged versions on official repository

How to reproduce

erik@debian3:~/kuksa.val/kuksa-client$ docker pull ghcr.io/eclipse/kuksa.val/kuksa-client:master
...
Status: Downloaded newer image for ghcr.io/eclipse/kuksa.val/kuksa-client:master

erik@debian3:~/kuksa.val/kuksa-client$ docker run --rm -it --net=host ghcr.io/eclipse/kuksa.val/kuksa-client:master --ip 127.0.0.1 --port 55555 --protocol grpc
Welcome to Kuksa Client version 0.1.6

@erikbosch erikbosch marked this pull request as draft July 21, 2023 14:15
Does the following:

- For Docker copy whole repo so we get the expected version from tag
  (previously always 0.1.6)
- Using 0.1.6 as default version does not make sense,
  0.0.0 works better to show that version lookup failed
- Tag pattern seems to be difficult to get correct, it always complain
  and seems to have no effect
- Aligning grpcio-tools version with what is defined in setup.cfg

The reason is that all docker build on master
previously got v0.1.6 except possible if that specific version was tagged, which
gives odd behavior if downloading kuksa-client:master
@erikbosch erikbosch marked this pull request as ready for review July 24, 2023 14:07
@erikbosch erikbosch added the 0.5.0 Suggested/Required for release v0.5.0 label Jul 25, 2023
@lukasmittag
Copy link
Contributor

@erikbosch
Copy link
Contributor Author

It seems that https://github.com/eclipse/kuksa.val/blob/master/kuksa-client/kuksa_client/_metadata.py is doing the right thing. I think it originates from here: https://github.com/eclipse/kuksa.val/blob/58dd5d1c46cc337e64652b69601dea84fb8f64ff/kuksa-client/pyproject.toml#L10C1-L12C36 But i do not know how this works.

In general the tag filtering seems to work, like when creating a PyPi package. The filtering however does not work. If I understand it correctly the intention is that it shall filter out tags that does not have the wanted syntax, but that does not work and you get a warning, like in the example below where it selects a local tag even if it does not match the filter completely. That is why I removed the tag filter.

user@debian:~/kuksa.val/kuksa-client$ python -m setuptools_git_versioning
[2023-04-13 10:51:37,352]  WARNING: tag_filter is not a valid function reference: Wrong reference name: [0-9]+.[0-9]+.[0-9]+
[2023-04-13 10:51:37,481]  WARNING: tag_filter is not a valid function reference: Wrong reference name: [0-9]+.[0-9]+.[0-9]+
0.4.0a1

But the real problem is related to how we build the docker image where we had two problems. First we did just a shallow check-out, so we did not get the tags, secondly we copied some directories (but nor .git) so we lost all tag information. That is why the docker container for 0.3.1 still reports version 0.1.6. Hopefully, with this PR, when we push 0.4.0 to master it will be able to pick up that version, without any "post" or "dirty" segments

Copy link
Contributor

@lukasmittag lukasmittag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise looks good couldn't verify because we disabled ttl.sh push

@erikbosch erikbosch merged commit 8422c1f into eclipse-archived:master Jul 25, 2023
@SebastianSchildt
Copy link
Contributor

Checked, works in master now after the merge. "Fetch depth 0" is not very efficient, but currently the only option, there is theoretically a fix here actions/checkout#579 but that guy has been ignored by MS/Github for more than a year. I admire his patience and perseverance.... Anyway, just a reminder, we want to take a look again if hell freezes over.

@erikbosch erikbosch deleted the erik_version branch September 29, 2023 09:29
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
0.5.0 Suggested/Required for release v0.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants