#916 `clone-tag` doesn't preserve tagging order
Closed: Fixed 5 years ago Opened 5 years ago by julian8628.

for example:

brew clone-tag --all rhel-8.0-llvm-toolset-candidate rhel-8.0-alpha-llvm-toolset-candidate
$ brew latest-build rhel-8.0-build mesa
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
mesa-18.0.2-1.el8+5                       rhel-8.0-llvm-toolset-candidate  ajackson

$ brew latest-build rhel-8.0-alpha-build mesa
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
mesa-17.3.6-1.el8+5                       rhel-8.0-alpha-llvm-toolset-candidate  ignatenk
$ brew list-history --tag rhel-8.0-llvm-toolset-candidate --package mesa
Wed Mar  7 09:49:57 2018 mesa-17.3.6-1.el8+5 tagged into rhel-8.0-llvm-toolset-candidate by tmlcoch [still active]
Wed Mar 14 19:02:53 2018 mesa-17.3.6-2.el8+5 tagged into rhel-8.0-llvm-toolset-candidate by tstellar
Thu Mar 15 09:09:27 2018 mesa-17.3.6-2.el8+5 untagged from rhel-8.0-llvm-toolset-candidate by tmlcoch
Wed Apr  4 21:47:21 2018 mesa-17.3.6-2.el8+5 tagged into rhel-8.0-llvm-toolset-candidate by tstellar [still active]
Tue May  1 21:42:40 2018 mesa-18.0.2-1.el8+5 tagged into rhel-8.0-llvm-toolset-candidate by ajackson [still active]

$ brew list-history --tag rhel-8.0-alpha-llvm-toolset-candidate --package mesa
...
Wed May  2 08:00:35 2018 mesa-17.3.6-2.el8+5 tagged into rhel-8.0-alpha-llvm-toolset-candidate by tmlcoch [still active]
Wed May  2 08:00:35 2018 mesa-18.0.2-1.el8+5 tagged into rhel-8.0-alpha-llvm-toolset-candidate by tmlcoch [still active]
Wed May  2 08:00:35 2018 mesa-17.3.6-1.el8+5 tagged into rhel-8.0-alpha-llvm-toolset-candidate by tmlcoch [still active]

@tkopecek @mikem
should we clone tagged builds with tagging order(maybe preserving event) at the top level, and tag inheritance as well, instead of tagging all builds into the top level tag?

@julian8628 Not sure if I understand. Are you proposing to copy tag inheritance chain? I don't think there is any use for such behaviour.

@tkopecek yes.
here are 2 proposals from me.
1. clone builds with tagging order (with or without preserving event)
2. clone tag inheritance chain. it's not related to keep tagging order but it could be useful more or less for mbs I guess. umm.. maybe another command for this use

Cloning in depth (#2) would be a very different process. Also, we'd have to devise a way to determine all the new tag names. Unless mbs specifically asks for this, I don't think we need to go here.

  1. clone builds with tagging order (with or without preserving event)

Preserving the event is not possible or desirable. The new tag was not created at that event.

We should be careful with terminology. "Tagging order" is only part of ordering when there is inheritance in place. The order of builds is inheritance order first and tagging order second. With clone-tag flattening the content into a single new tag, we should mimic the full ordering.

When I clone a single tag, it appears to get the order exactly backwards.

This is because readTaggedBuilds() returns builds in latest first order. The clone code takes that order as-is and tags any missing ones in that same order.

Adding a reversal in the command is trivial, but there are deeper issues here. Mostly this stems from the clone command not really being a clone command. It's more of a flattening copy/sync.

Longer term, we should probably replace clone-tag with a more carefully designed and better-named tool.

For now, simply adding a reverse in the correct spot of this command might be sufficient.

Metadata Update from @mikem:
- Issue tagged with: bug, discussion

5 years ago

I suspect this is a fairly longstanding bug in koji.

candidate short term fix: PR #952

Metadata Update from @mikem:
- Issue status updated to: Open (was: Closed)

5 years ago

Metadata Update from @julian8628:
- Issue set to the milestone: 1.17

5 years ago

Metadata Update from @franzh:
- Issue set to the milestone: 1.16.1 (was: 1.17)

5 years ago

Login to comment on this ticket.

Metadata