This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[wip] Refactor repository model (part 4) #2040
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refactor the constructor that took IGitService into LocalRepositoryModel where it was used.
Move GenerateUrl from LocalRepositoryModel to LinkCommandBase.
Move LocalRepositoryModel construction tests to new home.
This property wasn't being used.
We Now only need the CreateLocalRepositoryModel(localPath) overload.
Previously the current branch was being read when CurrentBranch was fetched. This changes it to be read when the LocalRepositoryModel is created.
Remove redundant code and usings.
Previously CurrentBranch was created as the property was read. We now need a way to refresh it.
It appears VSGitExt.ActiveRepositoriesChanged is fired before the local repository has actually changed its branch. This means we can't read the branch information immediately!
Remove the ILocalRepositoryModel.CurrentBranch property and explicitly call IGitService.CreateCurrentBranchModel instead. Fix all the broken tests.
Convert GetPullRequestForCurrentBranch to return (string owner, int number). This allows the tuple to be compared directly.
We can now use GitService as a LocalRepositoryMode factory.
Be explicit about what it does.
Make ITeamExplorerServiceHolder responsible for holding references to services, but not watching for and marshaling repository change events. Delegate to ITeamExplorerContext for this.
This is no longer called by TeamExplorerServiceHolder.
Contains a call chain that results in a call to a virtual method defined by the class.
Make log message a bit less bit yoda-y.
Removed dead and buggy code from BranchModel constructorer. We construct BranchModel from the HEAD branch, which isn't a remote branch. No need to construct a RepositoryModel from a URL.
BranchModel is now a pure model. 🎉
RepositoryModel and RemoteRepositoryModel are now pure models without interfaces.
Convert them from using NSubstitute to creating the model object.
Not sure why branch in PullRequestCreationViewModel.Branches is coming up null in unit test. Need to investigate.
Tests started throwing null reference exceptions when we stopped using an interface for BranchModel. This makes PrepareTestData default to return no branches.
Remove Octokit.Repository dependency from RemoteRepositoryModel.
Fix warnings in LocalRepositoryModelDesigner and RemoteRepositoryModelDesigner.
7 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO: This PR should target
refactor/repository-model-part3(set this after first commit).Depends on #2008
Depends on #2025
Depends on #2028
Still to do
RemoteRepositoryModelwhen we read the PR model from GraphQL, that way we can fix Fails to check out PR branch. #1986RemoteRepositoryModel.OwnerAccountto be aActorModelinstead of anIAccount(@grokys)Octiconfrom the model Refactor repository models (repository refactor part 1) #2008 (comment)VisualStudio/src/GitHub.Exports/Models/BranchModel.cs
Line 36 in e3f8114
RemoteRepositoryModelto continue implementingIEquatable<RemoteRepositoryModel>andIComparable<RemoteRepositoryModel>?TrimEndneeded here Refactor repository models (repository refactor part 1) #2008 (comment)originremote I get an exception at this line: Remove repository responsibilities from TeamExplorerServiceHolder (repository refactor part 2) #2025 (comment)Possible bugs
LocalRepositoryModel.GetHashCodeandEqualsshould use consistent comparisonsVisualStudio/src/GitHub.Exports/Models/LocalRepositoryModel.cs
Line 36 in e3f8114
VisualStudio/src/GitHub.Exports/Models/LocalRepositoryModel.cs
Line 55 in e3f8114
OrdinalIgnoreCaseorInvariantCultureIgnoreCasemaybe?