Skip to content

[WIP] Use Microsoft/VisualStudio-SharedProject as subtree - #733

Closed
enricosada wants to merge 2 commits into
dotnet:masterfrom
enricosada:use_vssharedproj_as_submodule
Closed

enricosada wants to merge 2 commits into
dotnet:masterfrom
enricosada:use_vssharedproj_as_submodule

Conversation

@enricosada

Copy link
Copy Markdown
Contributor

why do that? ref #496 ( fix folders, new interactive windows, show all files, drop and drop working, etc )

the Microsoft/VisualStudio-SharedProject repo contains the common code of Python Tools for Visual Studio and Node.js Tools for Visual Studio, .

Is the same codebase as visualfsharp, derived from MPF - Managed Package Framework for Projects, but a later version with a really solid implementation of the project system (for example folders are supported)

this is not the new CPS - Visual Studio Project System, i dont know how difficult is going to be convert to the new CPS, but i think is good to have the same codebase and roadmap when PTVS and nodejs move to CPS.
It's also possibile to support old vsprj system and new CPS in parallel (like c#, see CPS docs ) to make easier the migration.

I added the sharedproj as a submodule inside external/VisualStudio-SharedProject .

Why submodule:

  • easier merge for the others repo (fsharp, FCS) because need only to delete the .gitmodules file
  • few changes in the history

The idea is to replace the current code inside vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project with the code inside the submodule external\VisualStudio-SharedProject\Product\SharedProject (modulo bugfix of visualfsharp, who can be sent as pr to the shared repo)

A possible roadmap:

  1. cleanup the current code to minimized diff (comments,blanks,style,unused code,unused using)
    • easy to review, compile check (it's csharp, indentation is not a problem)
  2. replace namespace of current files with the one of sharedproj (and fix .fs files)
    • compiler check
  3. replace files
    • incrementally, starting from the one with less code/dependencies

we can also use a temporary fork of the sharedrepo, to make the migration easier and incremental

Continue to fix bugs already fixed in another similar codebase waste lot of time ( see #732 for example, or lots of vs extensions bugs ) and there is little contribution, with mixed results ( it's 2015, folders or showallfiles doesn't works ). Now the priority is coreclr, but the vs area need some love too.

@KevinRansom

Copy link
Copy Markdown
Contributor

Hey @mousetraps, look at this, we're getting your project system :-)

@enricosada Thanks for taking care of this mate.

Kevin

@forki

forki commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

please don't submodule things.

@enricosada

Copy link
Copy Markdown
Contributor Author

@forki why? Alternative ideas?

@forki

forki commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

Gitsubmodules sound awesome in the beginning, but in practice they are really really hard to handle. In our teams we found that even experienced git users run into big trouble from time to time. Newbies were completely lost. It requires really deep knowledge into the tooling. To make things more fun we had the issue that two submodules changed their url, so that we basically broke our complete history and had to git rewrite it.
We ended up removing all the submodules.

I guess these issues can be addressed with git subtree, but I didn't use it in practice.

Tbh I'd prefer to inline the code here and merge manually back and forth. This doesn't sound half the fun, but it's a process everyone understands.

@enricosada

Copy link
Copy Markdown
Contributor Author

Really thx for feedback @forki
Going to work, i'll answer later.

Inviato da Outlook

On Thu, Nov 19, 2015 at 11:39 PM -0800, "Steffen Forkmann" [email protected] wrote:

Gitsubmodules sound awesome in the beginning, but in practice they are really really hard to handle. In our teams we found that even experienced git users run into big trouble from time to time. Newbies were completely lost. It requires really deep knowledge into the tooling. To make things more fun we had the issue that two submodules changed their url, so that we basically broke our complete history and had to git rewrite it.
We ended up removing all the submodules.

I guess these issues can be addressed with git subtree, but I didn't use it in practice.

Tbh I'd prefer to inline the code here and merge manually back and forth. This doesn't sound half the fun, but it's a process everyone understands.


Reply to this email directly or view it on GitHub:
#733 (comment)

@enricosada

Copy link
Copy Markdown
Contributor Author

yes, submodules need some special care and are not transparent to contributors (who need to understand how submodule works).
I think submodules are great (when not used as replacement for a package manager) because make easier to contribute back to external repo and are clean.

But as @forki said, submodule need special care, require learning, there are some traps and maybe are not worth the effort here.

i'll push force an update with subtree instead of submodule

@enricosada

Copy link
Copy Markdown
Contributor Author

working on it, but i get the crlr issue ( .gitattributes ).

@enricosada enricosada changed the title Use Microsoft/VisualStudio-SharedProject as submodule Use Microsoft/VisualStudio-SharedProject as subtree Nov 26, 2015
@enricosada

Copy link
Copy Markdown
Contributor Author

sent pr Microsoft/VisualStudio-SharedProject#21 i'd like to add subtree after the line ending normalization if possible

@enricosada

Copy link
Copy Markdown
Contributor Author

ok, @mousetraps merged normalization of encoding, i'll update this pr next week.
i really think that's going to speedup fixes for the vs extensions

@dsyme

dsyme commented Jan 19, 2016

Copy link
Copy Markdown
Contributor

@enricosada I don't quite get this PR and suspect it's not the right way to start things w.r.t.the project system. In particular it doesn't feel right to incorporate code we are not yet using as a submodule.

I can see potential for bringing the updates and fixes across bit by bit, though we would best determine a common baseline which could be hard. Maybe we could even completely reconciling the two project system implementations. But such work seems long term and is worthy of a full feature branch or PR? Until we're sure it will work out I'm not sure using the submodule is right.

@mousetraps

Copy link
Copy Markdown

Btw an alternative to sub modules is subtrees, which only places the additional process burden on contributing back to SharedProject, not on external contributors. This is what we use in both NTVS and PTVS. I'm on my phone now but I can share some of the original reasoning behind this decision when I have the chance to dig through emails.

@dsyme

dsyme commented Jan 20, 2016

Copy link
Copy Markdown
Contributor

@enricosada

The idea is to replace the current code inside vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project with the code inside the submodule external\VisualStudio-SharedProject\Product\SharedProject...

To be clearer, this seems like a valuable goal, or at least a good thing to investigate. The Visual Studio team may decide to pursue CPS or some other project system - it's not clear what the right evolution is - but experimenting with the above seems valuable input.

It's just that a whole PR that does the job would be needed. Equally closing this one may discourage, which is not at all intended.

@enricosada

Copy link
Copy Markdown
Contributor Author

@mousetraps yes, we are doing it with subtree instead of submodule, other people like @forki said it's easier. Thx for feedback btw, and for the shared proj code!! great initiative

@enricosada

Copy link
Copy Markdown
Contributor Author

@dsyme the vs ide extensions is the component with the least improvements, and no roadmap.
It impact vs user a lot ( lots of bugs compared to other vs extensions ), and is a complex codebase ( no need to repeat why )
i tried to ask, discuss about future, possibile roadmap in #496 (someone else in #730), no answer in github from no one.
[RANT ON] That's happen often with discussion in this repo about roadmap/future, no answer or no actionable content, if the issue is not the current top priority. That really limit contribution from community. Show a roadmap, community can help with pr[RANT OFF]
I got some answer from @KevinRansom in the standup.

I can see potential for bringing the updates and fixes across bit by bit, though we would best determine a common baseline which could be hard. Maybe we could even completely reconciling the two project

Port every single bugfix one at time it's really complex, and no big gains. And we are in the same situation next bug. I tried with "open directory", complex and not really usefull.
That's one of the causes of little contribution in vs (complexity is another)
Also big fix ( like drag/drop, add files, show all files ) require more code.

I really think the real long term solution is converge to sharedproj source code, because the code is really similar ( visualfsharp it's the same codebase, but older ) but better quality (bugfix, features, style)

My possible workflow it's explained in #496 (comment)

@dsyme

dsyme commented Jan 25, 2016

Copy link
Copy Markdown
Contributor

@enricosada Just to close this out - I'm totally fine with code alignment with Microsoft/VisualStudio-SharedProject. But please not via git subtree... There's no intrinsic reason why we need to use subtree to do this is there?

@enricosada

Copy link
Copy Markdown
Contributor Author

@dsyme a subtree is not a submodule.
I can commit as source files only, it's pretty much the same as subtree.
subtree add the source commit id to the commit message (so subtree command can know what the original commit was ), but after that, we can change the files etc.

The pro is: easier to merge new changes from sharedprj, and contribute back to sharedproj.
For developers cloning the project it's the same, they doesnt know it's a subtree, no special command needed

some info: http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/

Let me show it, i'll push it to this branch, so you can review. If not ok, i'll commit files only without

@enricosada enricosada changed the title Use Microsoft/VisualStudio-SharedProject as subtree [WIP] Use Microsoft/VisualStudio-SharedProject as subtree Jan 25, 2016
@enricosada

Copy link
Copy Markdown
Contributor Author

added [WIP] untils it's ready

…0ecd6e

git-subtree-dir: external/VisualStudio-SharedProject
git-subtree-split: 70ecd6e27b3eeac0e2c1c39aa1476cf91df0abe1
@enricosada
enricosada force-pushed the use_vssharedproj_as_submodule branch from a5e94f0 to d9430a6 Compare January 26, 2016 15:12
@enricosada

Copy link
Copy Markdown
Contributor Author

ok, @dsyme it's pretty much the same as copy the source inside external/VisualStudio-SharedProject, it's a normal commit, but with subtree i can do:

git subtree pull --prefix external/VisualStudio-SharedProject https://github.com/Microsoft/VisualStudio-SharedProject.git master --squash

to pull new version from VisualStudio-SharedProject (or to send pr back to sharedproj, see the short example https://gist.github.com/kvnsmth/4688345 ). Obv we import lot of files, but are inside an isolated directory and text files, so not an issue

the diff:

  • vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project
  • external/VisualStudio-SharedProject/Product/SharedProject

another good is in external\VisualStudio-SharedProject\Product\ReplWindow the same repl as c#/python and node.

or external/VisualStudio-SharedProject/Product/SharedProject/AllFilesProjectElement.cs etc

maybe it's not a solution, obv need work, but i think if we can import this codebase, lots of bugs can be fixed. We can start to minimize diff with style pr only, after that, we can discuss how to proceed in multiple iterations.
If doesnt works, we can delete the external/VisualStudio-SharedProject directory.

it's ready for me this pr

@enricosada enricosada changed the title [WIP] Use Microsoft/VisualStudio-SharedProject as subtree Use Microsoft/VisualStudio-SharedProject as subtree Jan 26, 2016
@dsyme

dsyme commented Jan 27, 2016

Copy link
Copy Markdown
Contributor

@enricosada I'm not sure I understand. We can't commit 649 files into the tree without them actually being actively used and part of the product. Why would we add files that aren't part of what's built? You don't need to have the files in the master branch just to compare the source code, or work on rebuilding the project system on SPS.

For example, if the feature work is never completed then we would be left with 649 legacy files which need to be deleted.

I'm OK with PRs that textually align the source code of FSharp.LanguageService.Base and FSharp.ProjectSystem.Base so that we can see what's what. But we would only checkin a subtree or a copy of SPS as part of the completed, tested feature.

@enricosada

Copy link
Copy Markdown
Contributor Author

@dsyme i want a shared branch to do this work because i'd like to have some help.
i'll try to make example commits how to do it, so if someone want to help, it's easier to do it together.

We can do that in another branch, but i'd like to have in master because:

  • i want to integrate the sharedproj code in multiple interation, not a big bang when ready.
  • no need to sync with master branch changes, the risk is to waste the work or do more merge than work.
  • it's easier for contributors because there is only one branch for developmente, master, no need to switch
  • i cannot do it alone, it take lot of work and time to make slowly and safe, and long living branch are a risk of become useless

But as you wish, if for you @dsyme and @KevinRansom it's ok we can do that in another branch in this repo (more visible for contributors).
When are are ready (not complete but something useful) maybe we can merge the shared branch

@dsyme

dsyme commented Jan 27, 2016

Copy link
Copy Markdown
Contributor

@enricosada Thanks, I do think all those points above are valid, though they are in many ways in the nature of the beast.

When are are ready (not complete but something useful) maybe we can merge the shared branch

If it helps, the Microsoft model is that "main" is always intended to be in a ship-ready state, at least up to an intended alpha/beta/release-candidate quality. Work-in-progress doesn't get integrated into "main". I think it's always been clear that commits to "master" in this repo have to be feature-complete and as bug-free as possible.

If we have 5 major features going on we can't all do that in master, or even in this repo. And many of the same risks apply if the work is done in master too, e.g. all feature work runs the risk of dying, and integration is still necessary every time you pull from master,

But as you wish, if for you @dsyme and @KevinRansom it's ok we can do that in another branch in this repo (more visible for contributors).

Right now we're effectively giving feature work visibility via WIP PRs and feature branches. That's OK up to a certain level (but is admittedly badly affected by GitHub's size restrictions on showing diffs). Perhaps you could use that approach?

The natural thing would be to do this as a branch in your own repo or as a surrogate repo. Then you can pull PRs and recruit people to commit to that.. You could then submit a WIP PR showing the status of the work and to give it visibility - the PR could advertise how to commit to the feature. (I'd actually appreciate it if there were an active WIP PR for the coreclr branch so we could see the overall diff and status).

Thanks
Don

@dsyme dsyme changed the title Use Microsoft/VisualStudio-SharedProject as subtree [WIP] Use Microsoft/VisualStudio-SharedProject as subtree Jan 27, 2016
@enricosada

Copy link
Copy Markdown
Contributor Author

@dsyme diff of coreclr changes? you can diff branches (or commits) in github.

master...coreclr

coreclr as wip pull request can be ok (a pr is a branch, so not much different) because codebase doesnt change a lot, but i cannot do it, with a diff with 500file added, it's useless.

I need a base somewhere (with sharedprj) and additional work as diff.

I dont want to use a personal branch and develop there with pr, because no one it's gonna review it. That mean i am going to send a too big pull request and a big review (no thx, it's useless).

So i think is ok to diff locally the sharedprj and visualfsharp (so no need for this pr or import sharedproj codebase now) and send multiple pr to refactor.
We can integrate sharedproj when and if there is a big enough feature/improvement.

I'll close this pr, and start send small refactor pr.

Thx don for discussion, i know i tried to push a lot 😄

@enricosada enricosada closed this Jan 27, 2016
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.

6 participants