-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix cocoapods version enumeration #439
Conversation
@@ -158,17 +160,22 @@ public override async Task<IEnumerable<string>> EnumerateVersionsAsync(PackageUR | |||
string? html = await GetHttpStringCache(httpClient, $"{ENV_COCOAPODS_SPECS_ENDPOINT}/Specs/{prefix}/{packageName}"); | |||
HtmlParser parser = new(); | |||
AngleSharp.Html.Dom.IHtmlDocument document = await parser.ParseDocumentAsync(html); | |||
AngleSharp.Dom.IHtmlCollection<AngleSharp.Dom.IElement> navItems = document.QuerySelectorAll("div.Details a.js-navigation-open"); | |||
// Fetch the embedded react data | |||
string innerHtml = document.QuerySelector("script[data-target='react-app.embeddedData']").InnerHtml; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We might run into the same issue if the html is changed again. Did we consider other options here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do want to switch to a more permanent solution in the future - I'd recommend a switch to libgit2sharp, we can list the directories in the appropriate location in the specs repository.
This is just a bandaid fix to get it working again until we have time to do a better fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you can do that remotely? I thought you'd need to clone the entire repo in order to enumerate files. You could use Octocat or another GitHub library but then you'd need the user to supply an access token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point - I'm not positive you can do that remotely. I've only used libgit2sharp to clone/checkout and then perform operations in the past, but thats not optimal here. If we do have to switch to octocat and have a token it adds another layer of complexity as well.
Fix #437