Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable searching. #136

Conversation

dhoehna
Copy link
Contributor

@dhoehna dhoehna commented Mar 7, 2024

Summary of the pull request

Enables searching for repos.

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

Manually ran and validated I could clone repos.

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

src/AzureExtension/Strings/en-US/Resources.resw Outdated Show resolved Hide resolved
@kanismohammed kanismohammed self-requested a review March 18, 2024 20:27
@dhoehna dhoehna merged commit f595569 into feature/dhoehna/SearchOptionsForGettingRepositories Mar 18, 2024
1 of 3 checks passed
}

return _organizationsAndProjects[organization];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this locking code - is it right?

I see only one lock on '_getProjectsLock' but many users of '_organizationsAndProjects'.

And there's a double-checked lock - which is always super fishy (at least if the caller requires the returned information to be correct.)

}
if (developerId is not DeveloperId.DeveloperId azureDeveloperId)
{
var exception = new NotSupportedException("Authenticated user is not the an azure developer id.");
Copy link
Member

@jsidewhite jsidewhite Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var exception =

nit: isn't it more fun to just throw it and let the catch handler on 185 construct a weird result object?

}
if (defaultOrg != null)
{
server = _defaultSearchServerName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server

where is server var used?


_azureHierarchy ??= new AzureRepositoryHierarchy(azureDeveloperId);
_azureHierarchy ??= new AzureRepositoryHierarchy(azureDeveloperId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_azureHierarchy ??= new AzureRepositoryHierarchy(azureDeveloperId);

(i'm new to c# and ??= and Task.Run - so forgive my questions)

How does _azureHierarchy stay correct.

Say someone calls GetRepos with azureDeveloperId X, and that sets _azureHierarchy. Then someone calls GetRepositoriesAsync with azureDeveloperId Y.

Who is GetOrganizations [on line 171] being called for - user X or user Y?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm - I think i just don't understand line 162

developerId is not DeveloperId.DeveloperId azureDeveloperId

@dhoehna dhoehna mentioned this pull request Mar 20, 2024
3 tasks
dhoehna added a commit that referenced this pull request Mar 21, 2024
* Adding search functionality to repos (#117)

* Building with new SDK.  Have not tested

* WIP

* Handling the new SDK + .NET 8.0

* Adding comments

* Fixing some errors

* Using updated SDK

* Update src/AzureExtension/Providers/RepositoryProvider.cs

Co-authored-by: Branden Bonaby <[email protected]>

* Update src/AzureExtension/Providers/RepositoryProvider.cs

Co-authored-by: Branden Bonaby <[email protected]>

* Reverting .NET 8 changes

* Slipped through

* Removing IRepositoryProvider since IRepositoryProvider2 requires it.

* Using lock

* USing locks instead of tasks

* Moving return to inside the lock.

* typo

---------

Co-authored-by: Darren Hoehna <[email protected]>
Co-authored-by: Branden Bonaby <[email protected]>

* Enable searching. (#136)

* Eeeyyy, it works. :)

* Removing local source

* Adding comments to explain the server search code.

* Addressing comments.

* Update src/AzureExtension/Strings/en-US/Resources.resw

Co-authored-by: Branden Bonaby <[email protected]>

* Moving reading code outside of the lock.

* Adding some race-condition checking

---------

Co-authored-by: Darren Hoehna <[email protected]>
Co-authored-by: Branden Bonaby <[email protected]>

* Change

* Updating to new SDK

* Removing local package source

---------

Co-authored-by: Darren Hoehna <[email protected]>
Co-authored-by: Branden Bonaby <[email protected]>
huzaifa-d pushed a commit that referenced this pull request Apr 1, 2024
* Adding search functionality to repos (#117)

* Building with new SDK.  Have not tested

* WIP

* Handling the new SDK + .NET 8.0

* Adding comments

* Fixing some errors

* Using updated SDK

* Update src/AzureExtension/Providers/RepositoryProvider.cs

Co-authored-by: Branden Bonaby <[email protected]>

* Update src/AzureExtension/Providers/RepositoryProvider.cs

Co-authored-by: Branden Bonaby <[email protected]>

* Reverting .NET 8 changes

* Slipped through

* Removing IRepositoryProvider since IRepositoryProvider2 requires it.

* Using lock

* USing locks instead of tasks

* Moving return to inside the lock.

* typo

---------

Co-authored-by: Darren Hoehna <[email protected]>
Co-authored-by: Branden Bonaby <[email protected]>

* Enable searching. (#136)

* Eeeyyy, it works. :)

* Removing local source

* Adding comments to explain the server search code.

* Addressing comments.

* Update src/AzureExtension/Strings/en-US/Resources.resw

Co-authored-by: Branden Bonaby <[email protected]>

* Moving reading code outside of the lock.

* Adding some race-condition checking

---------

Co-authored-by: Darren Hoehna <[email protected]>
Co-authored-by: Branden Bonaby <[email protected]>

* Change

* Updating to new SDK

* Removing local package source

---------

Co-authored-by: Darren Hoehna <[email protected]>
Co-authored-by: Branden Bonaby <[email protected]>
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.

5 participants