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

Add Properties VCPKG #855

Merged
merged 3 commits into from
Oct 16, 2023
Merged

Add Properties VCPKG #855

merged 3 commits into from
Oct 16, 2023

Conversation

amitla1
Copy link
Contributor

@amitla1 amitla1 commented Oct 13, 2023

Added GitRepositoryOwner and GitRepositoryName to prevent fuzzy matching

@amitla1 amitla1 requested a review from a team as a code owner October 13, 2023 18:54
@amitla1 amitla1 requested a review from grvillic October 13, 2023 18:54
@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

Merging #855 (06cc66c) into main (25e572f) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@          Coverage Diff          @@
##            main    #855   +/-   ##
=====================================
  Coverage   77.5%   77.5%           
=====================================
  Files        235     235           
  Lines       9936    9953   +17     
=====================================
+ Hits        7702    7719   +17     
  Misses      2234    2234           
Files Coverage Δ
...tection.Contracts/TypedComponent/VcpkgComponent.cs 85.7% <100.0%> (+6.2%) ⬆️

@amitla1 amitla1 merged commit a54cb7c into main Oct 16, 2023
25 checks passed
@amitla1 amitla1 deleted the users/avannikumar/addVCPKGProperties branch October 16, 2023 06:56
@github-actions
Copy link

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂


if (!string.IsNullOrEmpty(locationArr[3]))
{
this.GitRepositoryName = locationArr[3].TakeWhile(ch => char.IsLetterOrDigit(ch)).ToString();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this check may fail for repositories with valid names like component-detection

* "git+https://github.com/Microsoft/vcpkg#ports/nlohmann-json"
*/
var locationArr = this.DownloadLocation.Split('/');
if (!string.IsNullOrEmpty(locationArr[2]))
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's do an array length check, in which we expect at least 4 fragments, if less than that this should be noop. Otherwise we can hit index out of range exceptions here.

* "git+https://github.com/leethomason/tinyxml2@9.0.0"
* "git+https://github.com/Microsoft/vcpkg#ports/nlohmann-json"
*/
var locationArr = this.DownloadLocation.Split('/');
Copy link
Contributor

Choose a reason for hiding this comment

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

qq, if downloadlocation is null will the split work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a null or empty check before this method gets called


using System.Linq;
using PackageUrl;

public class VcpkgComponent : TypedComponent
Copy link
Contributor

Choose a reason for hiding this comment

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

I expect to see some tests to validate these new changes.

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.

3 participants