Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327381 - Add support for Eclipse-SourceReferences header
Summary: Add support for Eclipse-SourceReferences header
Status: VERIFIED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 major with 1 vote (vote)
Target Milestone: 2.0   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL: https://git.eclipse.org/r/#/c/4899/
Whiteboard:
Keywords:
Depends on: 356448 365425 372020
Blocks: 345670 351817 351819 359069
  Show dependency tree
 
Reported: 2010-10-09 04:01 EDT by Gorkem Ercan CLA
Modified: 2012-06-01 03:44 EDT (History)
22 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gorkem Ercan CLA 2010-10-09 04:01:18 EDT
Projects that are using Git repos in releng builds need Git implementation of the IFetchFactory to start generating values for the source references. This can possibly be also addressed on bug 289838. Egit also needs to implement IBundleImporterDelegate for the UI extension point

More information on the Eclipse-SourceReferences can be found here
  http://wiki.eclipse.org/PDE/UI/SourceReferences
Comment 1 Chris Aniszczyk CLA 2011-02-07 10:34:43 EST
This will be looked at in 0.12 with the rest of PDE stuff.
Comment 2 Paul Webster CLA 2011-06-13 07:48:12 EDT
Some discussion on bug 345670 comment #4 about how the syntax (which is based on the maven syntax) could look.

PW
Comment 3 Kim Moir CLA 2011-07-07 14:37:14 EDT
Is there a timeframe for the implementation of this feature?  We have started building some projects from git starting today and now their source references in the manifests will be broken.  It would be nice if this could be fixed so our SR1 bundles still retain their source references :-) Willing to send chocolate for bug fixes...
Comment 4 Paul Webster CLA 2011-07-14 06:54:01 EDT
The git fetch factory currently generates a source header:

Eclipse-SourceReferences: scm:git:git://git.eclipse.org/gitroot/platform/eclipse.platform.ui.git;path="bundles/org.eclipse.ui.workbench";tag=v20110712-1754

which looks fine.  We're still trying to figure out if we want to use one tag for the repo for the build and propagate that to the source header, bug 351819

PW
Comment 5 Alex Blewitt CLA 2011-07-18 08:30:18 EDT
We should prefer to use http rather than git for the checkouts. There's no performance degredation these days on using http instead of git, and it's more universally accessible behind firewalls and the like. This may be something that can be changed at build time instead of needing the fetch factory to handle specifically though.

Also, we shouldn't be recording tags, we should be recording commit hashes. A commit hash will always be relevant; a tag may not be (especially if the set of tags haven't been cloned from a remote server).
Comment 6 Dani Megert CLA 2011-07-18 10:17:41 EDT
Chris, do you still plan to work on this?
Comment 7 Chris Aniszczyk CLA 2011-07-18 12:15:57 EDT
It's not on my priority list atm.
Comment 8 Dani Megert CLA 2011-08-26 06:34:57 EDT
This should be addressed for Juno, otherwise the support to fetch the source for the SDK bundles will no longer work compared to Indigo.
Comment 9 Szymon Brandys CLA 2011-09-01 07:28:07 EDT
From my point of view when we migrate Eclipse SDK bundles to Git repo, this issue is no more an enhancement request, but major regression for the Eclipse SDK user. So if Chris does not have it in the plan, is there any other EGit commiter who is going to work on it for Juno?
Comment 10 Thomas Watson CLA 2011-09-01 08:46:48 EDT
(In reply to comment #8)
> This should be addressed for Juno, otherwise the support to fetch the source
> for the SDK bundles will no longer work compared to Indigo.

Just to be clear, it will also cease to work for Indigo SR1 because we have migrated the source for SR1 for most of Eclipse/Equinox.
Comment 11 Szymon Brandys CLA 2011-09-08 11:01:25 EDT
Changing the severity. See comment 8, 9 and 10.
Comment 12 Szymon Brandys CLA 2011-09-26 08:07:25 EDT
(In reply to comment #11)
> Changing the severity. See comment 8, 9 and 10.

Ping? What is the target milestone for it?
Comment 13 Szymon Brandys CLA 2011-11-03 05:57:15 EDT
Double ping!
Comment 14 Szymon Brandys CLA 2011-11-09 07:05:38 EST
Just to remind, as Dani said in comment 8: "This should be addressed for Juno, otherwise the support to fetch the source for the SDK bundles will no longer work compared to Indigo."
Comment 15 John Arthorne CLA 2011-11-09 14:35:09 EST
Szymon, can you describe concretely what needs to be done here? Some things are unclear to me:

1) As mentioned in comment #4 we are already generating Eclipse-SourceReference headers. Are we asking for this format to be changed to http or left alone?

2) The other part is providing an IBundleImporterDelegate implementation. Now team.core provides a default class BundleImporterDelegate, which makes use of project sets to implement the import. Since eGit does provide a project set capability, it seems like eGit just needs a trivial subclass that lists the supported repository types. Is this all we're waiting for? It would be nice if bundle import delegate extensions could specify these two values programatically and not even need to write a line of code (specify repository type and list of supported repository values). This would also avoid them needing to depend on provisional API in team to implement this.
Comment 16 Tomasz Zarna CLA 2011-11-10 05:02:39 EST
(In reply to comment #15)
> 1) As mentioned in comment #4 we are already generating Eclipse-SourceReference
> headers. Are we asking for this format to be changed to http or left alone?

I think that as long as the format is compatible with the maven documentation (http://maven.apache.org/scm/git.html) or with its slight variation we agreed on (see bug 345670) it can be left alone.
 
> 2) The other part is providing an IBundleImporterDelegate implementation. Now
> team.core provides a default class BundleImporterDelegate, which makes use of
> project sets to implement the import. Since eGit does provide a project set
> capability, it seems like eGit just needs a trivial subclass that lists the
> supported repository types. Is this all we're waiting for? 

The missing subclass of BundleImporterDelegate is one thing, another thing that comes to my mind is the fact that EGit's project set capability doesn't override #asReference(URI, String). It converts SCM URLs into reference strings used to load projects into the workspace. See bug 356448, it shouldn't be too hard either.

> It would be nice if bundle import delegate extensions could specify these two values 
> programatically and not even need to write a line of code (specify repository type 
> and list of supported repository values).

Good idea!
Comment 17 Markus Keller CLA 2011-11-10 11:53:15 EST
An additional complication to consider in the Git case is that multiple projects can share the same repo. When the user imports a single project, the implementation has to clone the whole repository, check out the right tag, and then import the project into the workspace.

Now suppose the user tries to import a second project from the same Git repository. In this case, the repo has already been cloned and it can point to a different tag. You cannot simply switch the whole repo to another tag, since the user may already have applied changes in the first project (committed, staged, or even unstaged). The only thing you can do is to detect the problem and ask the user what to do.

If the repo is already set to a tag or branch tip and has no uncommitted files, the user probably wants to switch to the latest of the possible tags, so this should be the pre-selected choice.
Comment 18 Tomasz Zarna CLA 2011-12-15 04:26:28 EST
(In reply to comment #15)
> It would be nice if bundle import delegate extensions could specify these two values 
> programatically and not even need to write a line of code (specify repository type 
> and list of supported repository values). This would also avoid them needing to depend on
> provisional API in team to implement this.

Filed bug 366790 for this. What you said about the provisional API is true, but still EGit will need to address bug 365425. Dropping 3.5 and moving to a newer version (preferably to 3.8) is a must in order to work with the extension point.
Comment 19 Szymon Brandys CLA 2011-12-16 08:46:53 EST
A possible solution, if EGit does not switch to Eclipse 3.8, see bug 365425, comment 5:

> 2) Just add these extensions to egit.core manifest. AFAIK if there is no right
> extension, they will be silently ignored. So for EGit on Eclipse prior to 3.8,
> it would do nothing.
Comment 20 Tomasz Zarna CLA 2011-12-16 10:52:16 EST
That would work for the extension point from o.e.team.core ie bundleImporters, but for the one from o.e.team.ui (scmUrlImportPages) a bundle dependency has do be specified as it requires an implementation of org.eclipse.team.ui.IScmUrlImportWizardPage. The good news is that in the latter case a dep on 3.7 should be enough.
Comment 21 Tomasz Zarna CLA 2012-01-02 11:46:15 EST
See http://egit.eclipse.org/r/4899 

Note that importing with a tag is not supported yet, see bug 367712. 

Hudson fails with "Missing requirement: org.eclipse.egit.core 1.3.0.qualifier requires 'bundle org.eclipse.team.core [3.6.100,4.0.0)' but it could not be found]", this is caused by bug 365425.
Comment 22 Markus Keller CLA 2012-01-11 13:04:30 EST
(In reply to comment #20)
If this bug is blocked for Juno due to 3.5 compatibility issues, then please try to put the GitScmUrlImportWizardPage into a (new) fragment for org.eclipse.egit.ui. The fragment could have a dependency on 3.7.
Comment 23 Szymon Brandys CLA 2012-01-11 15:33:46 EST
(In reply to comment #22)
> (In reply to comment #20)
> If this bug is blocked for Juno due to 3.5 compatibility issues, then please
> try to put the GitScmUrlImportWizardPage into a (new) fragment for
> org.eclipse.egit.ui. The fragment could have a dependency on 3.7.

I can't find the comment, but this is exactly what is going to happen. Tomek has been preparing an optional fragment for egit.ui with dependency to 3.7.
Comment 24 Tomasz Zarna CLA 2012-02-01 04:29:54 EST
(In reply to comment #23)
> Tomek has been preparing an optional fragment for egit.ui with dependency to 3.7.

It has been submitted to Gerrit some time ago, see https://git.eclipse.org/r/#/c/4899/ , sorry for not updating the bug.
Comment 25 Szymon Brandys CLA 2012-02-09 07:32:12 EST
Could someone from EGit team look at the contribution. It's quite big and we should start reviewing it to make it part of the release in June. Thanks.
Comment 26 Chris Aniszczyk CLA 2012-03-27 17:04:44 EDT
This changed as approved and supervised by the PMC.
Comment 27 Matthias Sohn CLA 2012-05-24 02:55:05 EDT
merged as 64417af7a7e0d74ee423d6642d40a5116f584fe1 on stable-2.0
Comment 28 Dani Megert CLA 2012-06-01 03:44:23 EDT
I verified that the initial Git import works using 3.8-I20120531-0600 and 4.2-I20120531-1500 together with the EGit RC2 support from http://download.eclipse.org/releases/staging/. However, there's a bug when trying a second import (bug bug 381321) and also the About info is wrong (bug 381319).