Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

substitute tilde ~ with at @ for git tags #386

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Blaimi
Copy link

@Blaimi Blaimi commented Sep 11, 2020

Closes: #377

This is probably not the cleanest solution but tito build --rpm --tag="foo-1~beta1-1" works. I didn't test anything else.

@FrostyX
Copy link
Member

FrostyX commented Sep 16, 2020

Hello @Blaimi,
thank you for the PR and sorry for the late reply.

Replacing ~ with @ suggested also @praiskup in #377, so I think we can go with it even though it is not the cleanest. But when I am trying this code, I still get errors when running

tito tag --use-version=2~dev1

@FrostyX
Copy link
Member

FrostyX commented Oct 12, 2020

bump @Blaimi,
can I do something to help you with this PR?

@Blaimi
Copy link
Author

Blaimi commented Oct 12, 2020

I need some more time to better get into the code. Since we are creating the tags and the .tito/packages-file with our ci instead of tito tag this PR fixes our problem with tito build. We absolutely don't want to monkeypatch tito everytime we use it, so this PR will absolutely receive some more attention by us ;)

@FrostyX
Copy link
Member

FrostyX commented Oct 12, 2020

Alright :-)
I am glad to hear that.

If you need anything, let me know.

@Blaimi
Copy link
Author

Blaimi commented Oct 15, 2020

I fixed the problem with tito tag. the resulting git tag is now with @ while the version number/tagname in .tito/packages/foo still has ~ – which is fine.

I'm not yet sure, if all the replaces in common.py are really necessary, some of the methods are receiving already replaced names. I'm not having the meta-view on the project yet and I'm not sure if I can find enough time for it in a near time.

What is missing:

  • unittests
  • automatic version bump (e.g. 1.2.3~beta1 -> 1.2.3~beta2)
  • testing, testing, testing
  • cleanup of some uneccessary replace() if any
  • error-messages or autocorrect if someone uses tito tag --use-version=2@dev1 (it fails becaus the rpm validator fails with error: line 2: Illegal char '@' (0x40) in: Version: 2@dev4)

@ebreiner
Copy link

Hello @FrostyX ,

I would like to know if I can help finish this MR if something is missing.

@Blaimi
Copy link
Author

Blaimi commented May 17, 2021

I would like to know if I can help finish this MR if something is missing.

  • unittests
  • automatic version bump (e.g. 1.2.3~beta1 -> 1.2.3~beta2)
  • testing, testing, testing
  • cleanup of some uneccessary replace() if any
  • error-messages or autocorrect if someone uses tito tag --use-version=2@dev1 (it fails becaus the rpm validator fails with error: line 2: Illegal char '@' (0x40) in: Version: 2@dev4)

:-p

“testing” means especially the parts beside build. I did not get all the abstractions, i.e. where a tag is converted to a version and vice versa, there seem to be multiple places.

@bryce-carson
Copy link

bryce-carson commented Aug 19, 2022

    def _validate_options(self):
        if self.options.keep_version and self.options.use_version:
            error_out("Cannot combine --keep-version and --use-version")

        if '@' in self.args.use_version or '@' in self.args.use_release:
            error_out("Cannot use symbol '@' in release or tag. Use '~'.")

Would adding the second condition (as shown above) to the _validate_options method of the TagModule be sufficient to resolve this TODO?

  • error-messages or autocorrect if someone uses tito tag --use-version=2@dev1 (it fails becaus the rpm validator fails with error: line 2: Illegal char '@' (0x40) in: Version: 2@dev4)

I'm refreshing my Python skills. I normally code in R, and I'm still unfamiliar with using Tito, so I'm cautious about opening a PR.

At ~7000 lines Tito is a good project for me to study.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow tagging pre-release versions with ~ tilde character
4 participants