Bug 297491 - Provide support for storing named branch points, also called tags
Summary: Provide support for storing named branch points, also called tags
Status: ASSIGNED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.13   Edit
Hardware: Other All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-10 10:17 EST by Lothar Werzinger CLA
Modified: 2020-12-11 10:46 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lothar Werzinger CLA 2009-12-10 10:17:09 EST
Users have problems accessing historic revision, as the required timestamps are not user friendly.
I propose to support 'tags' to map revisions by mapping a string to a timestamp.

I propose that CDO maintains a regular EMF/CDO object with a feature containing a map from string to long. This allows to create 'tags' that refer to historic revisions by storing the timestamp of the revision. The benefit of storing the tags in a regular EMF object are:

 * easy to implement
 * works with any CDO store
 * tags itself get revisioned in audit mode and one can get a historic tag with an audit view. And if bug 256649 is implemented even who created the tag.
 * tags can be enumerated (via regular EMF API) e.g. to display them in an UI.

I also propose that CDO offers an API to create and query (return the EMap) the tags.
Comment 1 Eike Stepper CLA 2009-12-10 15:28:00 EST
I think that named tags for commits (not revisions) are a good thing. The solution you proposed should already be possible. You can create a model with that standard EClass with a map feature. After a commit you can ask transaction.getLastCommitTime() and use the resulting long value in your map. If that's what you mean I'd close this bugzilla as WORKSFORME. 

But I think that special CDO API for this makes sense as well. In this case we can keep this bug open as a reminder. Would you like to contribute a patch?
Comment 2 Stefan Winkler CLA 2009-12-11 04:34:52 EST
(In reply to comment #1)
> I think that named tags for commits (not revisions) are a good thing. The
> solution you proposed should already be possible. You can create a model with
> that standard EClass with a map feature. After a commit you can ask
> transaction.getLastCommitTime() and use the resulting long value in your map.
> If that's what you mean I'd close this bugzilla as WORKSFORME. 
> 
> But I think that special CDO API for this makes sense as well. In this case we
> can keep this bug open as a reminder. Would you like to contribute a patch?

It's the latter. We talked on the phone yesterday and he is already implementing the custom solution. However, I thought it might be a good idea to introduce tagging into the CDO API - this might also be convenient for the UI. Maybe Vik is also interested in this?
Comment 3 Victor Roldan Betancort CLA 2009-12-11 08:28:22 EST
(In reply to comment #2)
> (In reply to comment #1)
> > I think that named tags for commits (not revisions) are a good thing. The
> > solution you proposed should already be possible. You can create a model with
> > that standard EClass with a map feature. After a commit you can ask
> > transaction.getLastCommitTime() and use the resulting long value in your map.
> > If that's what you mean I'd close this bugzilla as WORKSFORME. 
> > 
> > But I think that special CDO API for this makes sense as well. In this case we
> > can keep this bug open as a reminder. Would you like to contribute a patch?
> 
> It's the latter. We talked on the phone yesterday and he is already
> implementing the custom solution. However, I thought it might be a good idea to
> introduce tagging into the CDO API - this might also be convenient for the UI.
> Maybe Vik is also interested in this?

We aren't using the Audit mode in our solution, but I also find this enhacement quite convenient.
Comment 4 Egidijus Vaisnora CLA 2009-12-15 10:22:37 EST
(In reply to comment #0)
> Users have problems accessing historic revision, as the required timestamps are
> not user friendly.

Do you mean version number as a tag? Or it is "free" tagging by giving name to some revision? 
We also deal with historical revision and in order to make historical revisions understandable for user, we introduced class which holds version number. However our desire is to have versions created and stored on server, instead of changing versions on client side and putting it on custom class. 
So if it is request for tags AKA version numbers, then it would be nice if server could introduce versioning strategy with predefined versions storage (let say in system resource) and access to it from client. Versioning strategy could be changeable by custom code to define versions numbering style and scope of versioned elements. What do you think?
Comment 5 Eike Stepper CLA 2009-12-15 11:37:28 EST
I think this is really moreabout assigning names to timestamps (and branches in the future).
Comment 6 Stefan Winkler CLA 2009-12-16 04:00:29 EST
Both proposals do not have to be contradictionary:

a. We could invent the concept of the named commit: Every commit is assigned an internal name - and we could also have the naming scheme configurable as Egidijus proposed. We could also add an API for assigning aliases (and maybe a comment?) to the named versions, so one can assign user-readable tags.

b. We could just stick to only assign tags to timestamps. In this case, if the user wants version numbers, he would have to create the logic to assign version number-tags himself.

Just as a remark: I like the idea of an additional comment for a commit or tag operation, because that makes the history (e.g. import jobs etc.) more understandable.
Comment 7 Eike Stepper CLA 2009-12-16 04:16:37 EST
Sounds good, seems related with bug 256649
Comment 8 Lothar Werzinger CLA 2009-12-16 04:59:26 EST
My original intent was to associate a tag with a timestamp to allow the user to use names for (historic) audit views. As today the audit view needs a timestamp and the timestamp is hard/impossible to memorize for end users.

I like the idea of comments, too. It should be easy to create a small struct that not only contains the timestamp, but also a comment.

I don't think we need a tag for every commit, so I initially proposed to get the timestamp of a commit that needs taging by asking the transaction and then create another small transaction and commit the tag with the comment itself.
Comment 9 Stefan Winkler CLA 2009-12-16 05:11:48 EST
(In reply to comment #8)
> I don't think we need a tag for every commit, so I initially proposed to get
> the timestamp of a commit that needs taging by asking the transaction and then
> create another small transaction and commit the tag with the comment itself.

Is there a reason for having a separate transaction for the tag operation?
Wouldn't it make sense to have an API like

transaction = session.openTransaction();
transaction.setTag("Import-2009-12-16");
transaction.setComment("Import of foobar data.");
// do something with the resource ....
transaction.commit(); // <- commit changes and set tag

for immediate setting tags.


The question is, where should be put API calls to tag commits post-hoc.

session.addTag(timestamp, tagname, comment)

maybe?
Comment 10 Eike Stepper CLA 2009-12-16 06:37:34 EST
Why shouldn't a timestamp have more than one name? The only restriction should be that a name is unique per branch (currently per repository, as we have only one main branch).

I'd put the management API for tags into the session as it is really not related with objects or transactions (other than transactions also produce timestamps).

If we associate tags with commits upfront, we should enable the user to specify more than one.
Comment 11 Egidijus Vaisnora CLA 2009-12-16 07:13:12 EST
Isn't repository too big scope for uniqueness? Repository can contain many logical projects (logical scope) and it will be to restrictive to allow unique tag names among these projects.
Comment 12 Eike Stepper CLA 2009-12-16 07:49:47 EST
I would like to avoid making any assumptions on usage-specific scopes like projects, houses, etc... IMHO these are application-managed string policies.
Comment 13 Lothar Werzinger CLA 2009-12-16 08:18:12 EST
(In reply to comment #9)
> Is there a reason for having a separate transaction for the tag operation?
> Wouldn't it make sense to have an API like
> 
> transaction = session.openTransaction();
> transaction.setTag("Import-2009-12-16");
> transaction.setComment("Import of foobar data.");
> // do something with the resource ....
> transaction.commit(); // <- commit changes and set tag
> 
> for immediate setting tags.

The reason that I proposed a separate transaction was that:
 - one could want to tag a timestamp after the fact (e.g. after a QA step)
 - the person who creates tags is a different one than the one that commited the changes (e.g. QA approved)
Comment 14 Lothar Werzinger CLA 2009-12-16 08:21:52 EST
(In reply to comment #10)
> Why shouldn't a timestamp have more than one name? The only restriction should
> be that a name is unique per branch (currently per repository, as we have only
> one main branch).

With my proposes solution one could create as many tags with the same timestamp as one likes. One can also change the timestamp (retag) which is useful if e.g. an application should always work on the latest "released" QA approved version of the repo. This could be done by reassigning the latest QA approved timestamp to the "released" tag. 

> I'd put the management API for tags into the session as it is really not
> related with objects or transactions (other than transactions also produce
> timestamps).

As it would change or add new objects to the repo I would keep it on a CDO transaction object rather than a session.
Comment 15 Lothar Werzinger CLA 2009-12-16 08:24:00 EST
(In reply to comment #11)
> Isn't repository too big scope for uniqueness? Repository can contain many
> logical projects (logical scope) and it will be to restrictive to allow unique
> tag names among these projects.

I see it similar to a SVN repository that can contain many projects as well, but the tags are repository wide. It's also easier to implement.

I would not implement anything more complex unless someone has already a real use case for the more complex use case where she can not use multiple repositories.
Comment 16 Eike Stepper CLA 2009-12-16 09:47:28 EST
(In reply to comment #14)
> > I'd put the management API for tags into the session as it is really not
> > related with objects or transactions (other than transactions also produce
> > timestamps).
> 
> As it would change or add new objects to the repo I would keep it on a CDO
> transaction object rather than a session.

That's true only under the premise that we use E/CDOObjects to model the tags. But I don't like that idea as it only add complication rather than value.
Comment 17 Lothar Werzinger CLA 2009-12-16 10:08:46 EST
(In reply to comment #16)
> (In reply to comment #14)
> > > I'd put the management API for tags into the session as it is really not
> > > related with objects or transactions (other than transactions also produce
> > > timestamps).
> > 
> > As it would change or add new objects to the repo I would keep it on a CDO
> > transaction object rather than a session.
> 
> That's true only under the premise that we use E/CDOObjects to model the tags.
> But I don't like that idea as it only add complication rather than value.

As long as it's visible who created or modified a tag (via bug 256649) I would not care if it's implemented with E/CDOObjects or not, but via E/CDOObjects and the current audit mode we would get that for free.

We have a requirement where a part of the system we build must only access an approved version of the repository and it would be easy to do that with the proposed way via re-taging. But if re-taging is used then the history of who created and modified a tag is important to us. That's why I came up with the idea to use regular E/CDOObjects to model the taging and just wrap it in a nice API for creating, changing, deleting and querying tags.
Comment 18 Eike Stepper CLA 2009-12-16 10:20:57 EST
> As long as it's visible who created or modified a tag (via bug 256649) I would
> not care if it's implemented with E/CDOObjects or not, but via E/CDOObjects and
> the current audit mode we would get that for free.

That information is in the session, so we *could* use it.

> We have a requirement where a part of the system we build must only access an
> approved version of the repository and it would be easy to do that with the
> proposed way via re-taging. But if re-taging is used then the history of who
> created and modified a tag is important to us. That's why I came up with the
> idea to use regular E/CDOObjects to model the taging and just wrap it in a nice
> API for creating, changing, deleting and querying tags.

I don't think that we'll have a history of tag operations, only info about the last operation, e.g. time/userID.
Comment 19 Lothar Werzinger CLA 2009-12-16 10:39:33 EST
(In reply to comment #18)

> I don't think that we'll have a history of tag operations, only info about
> the last operation, e.g. time/userID.

As I outlined we have a requirement to track re-taging and it looks like your proposal would not support that. If the tags are implemented E/CDOObjects we would get that for free. Why do you not like the idea to model the taging infrastructure with E/CDOObjects? It looks to me that it would add some value after all.
I would hate to have to roll my own taging facility, that's why I opened this bug for discussions and requirement gathering.
Comment 20 Eike Stepper CLA 2009-12-16 10:48:13 EST
> As I outlined we have a requirement to track re-taging and it looks like your
> proposal would not support that. 

No, I don't think this is of general usefulness. But others might convince me ;-)

> If the tags are implemented E/CDOObjects we
> would get that for free. Why do you not like the idea to model the taging
> infrastructure with E/CDOObjects? It looks to me that it would add some value
> after all.

For example you'd always have to setup a CDOView to do anything with the tags.

> I would hate to have to roll my own taging facility, that's why I opened this
> bug for discussions and requirement gathering.

If you really have this very special requirement it would be rather trivial to create a model that perfectly suits your needs and map it to the tags that we will maintain internally.
Comment 21 Lothar Werzinger CLA 2009-12-16 11:27:42 EST
(In reply to comment #20)
> > As I outlined we have a requirement to track re-taging and it looks like
> > your proposal would not support that. 
> 
> No, I don't think this is of general usefulness. But others might convince
> me ;-)
> 
> > If the tags are implemented E/CDOObjects we
> > would get that for free. Why do you not like the idea to model the taging
> > infrastructure with E/CDOObjects? It looks to me that it would add some
> > value after all.
> 
> For example you'd always have to setup a CDOView to do anything with the tags.

Yes, that's why I would add the read API to CDOView and the write API to CDOTransaction.

I also think it's important if you query the tags on an audit view that you can only see the tags made until the time that the audit view uses. Any modifications after the time should be hidden. I think that would be necessary to preserve the way audit mode works.
If your implementation would be used, then a tag that existed in an audit view but was revised later would point to an invalid timestamp (relative to the audit view that is used to read the tag). I think that is undesirable.

> > I would hate to have to roll my own taging facility, that's why I opened
> > this bug for discussions and requirement gathering.
> 
> If you really have this very special requirement it would be rather trivial
> to create a model that perfectly suits your needs and map it to the tags
> that we will maintain internally.

As outlined above your strategy looses information, so I could not use it at all and would have to completely roll my own.
Comment 22 Eike Stepper CLA 2009-12-16 13:02:42 EST
As I said, I'dd like to hear what others think. I still think versioning/auditing the tags is irritating for users who expect this to work as in CVS or Subversion. My current vote is -1 for that, sorry ;-(
Comment 23 Lothar Werzinger CLA 2009-12-16 13:22:11 EST
(In reply to comment #22)
> As I said, I'dd like to hear what others think. I still think
> versioning/auditing the tags is irritating for users who expect this to work as
> in CVS or Subversion. My current vote is -1 for that, sorry ;-(

Actually SVN does exactly what I asked for.

If you do a 'svn ls -r <revision> svn+ssh://repo/tags' then you will only see the tags that were created or changed before and including the revision that was specified. And as you can remove and recreate entries (usually directories) in svn+ssh://repo/tags 'svn ls svn+ssh://repo/tags' will show what's current and there a directory with the same tag name can contain different files than the one in revision <revision>. If you doubt that, test it for yourself.


$ svn ls -r 50000 http://svn.apache.org/repos/asf/spamassassin/tags | wc -l
45

$ svn ls -r 60000 http://svn.apache.org/repos/asf/spamassassin/tags | wc -l
46

$ svn ls http://svn.apache.org/repos/asf/spamassassin/tags | wc -l
963
Comment 24 Eike Stepper CLA 2009-12-16 13:58:01 EST
Ok, give me some time to think about it. Feedback from others is highly appreciated ;-)
Comment 25 Saulius Tvarijonas CLA 2009-12-17 01:48:56 EST
Hi All,

We are developing similar functionality to put comment on commit/transaction/timestamp. These comments are editable. I believe principals are very similar to Lothar's proposal for tags.
It is not possible to read data + comment in the same AuditView. Comment has different lifecycle/history and normally user wants to see latest version of comment/tag even for the very old commit.
A requirement to put tag after commit looks reasonable also. Change or remove tag also.
Finally I am personally confused where is disagreement :) Seems like we moved too far into technical side while haven't found agreement on requirements.

Regards,
Saulius

(In reply to comment #24)
> Ok, give me some time to think about it. Feedback from others is highly
> appreciated ;-)
Comment 26 Henrik önsson CLA 2009-12-18 10:50:12 EST
(In reply to comment #25)

> Finally I am personally confused where is disagreement :) Seems like we moved
> too far into technical side while haven't found agreement on requirements.

I agree. We also need this feature. I don't understand the details, but I should vote for a simple and open solution.
Comment 27 Eike Stepper CLA 2010-06-29 04:50:50 EDT
Rebasing all outstanding enhancements requests to version 4.0
Comment 28 Eike Stepper CLA 2011-06-23 03:58:18 EDT
Moving all open enhancement requests to 4.1
Comment 29 Eike Stepper CLA 2012-08-14 22:56:49 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 30 Eike Stepper CLA 2013-06-27 04:07:27 EDT
Moving all outstanding enhancements to 4.3
Comment 31 Eike Stepper CLA 2014-08-19 09:25:57 EDT
Moving all open enhancement requests to 4.4
Comment 32 Eike Stepper CLA 2014-08-19 09:36:24 EDT
Moving all open enhancement requests to 4.4
Comment 33 Eike Stepper CLA 2015-07-14 02:20:04 EDT
Moving all open bugzillas to 4.5.
Comment 34 Eike Stepper CLA 2016-07-31 01:02:54 EDT
Moving all unaddressed bugzillas to 4.6.
Comment 35 Eike Stepper CLA 2017-12-28 01:20:37 EST
Moving all open bugs to 4.7
Comment 36 Eike Stepper CLA 2019-11-08 02:12:13 EST
Moving all unresolved issues to version 4.8-
Comment 37 Eike Stepper CLA 2019-12-13 12:49:52 EST
Moving all unresolved issues to version 4.9
Comment 38 Eike Stepper CLA 2020-07-12 06:30:24 EDT
This bugzilla is closest to what I'm currently implementing. I'll not implement everything that was proposed here initially, or how in detail it was proposed. But I'm sure you'll be happy with it...
Comment 39 Eike Stepper CLA 2020-12-11 10:46:22 EST
Moving to 4.13.