Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into analyzer-internal-mjd
Browse files Browse the repository at this point in the history
  • Loading branch information
annelo-msft committed Aug 8, 2023
2 parents 7749725 + 3f3d96c commit 36599b0
Show file tree
Hide file tree
Showing 38 changed files with 573 additions and 208 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@
# .NET Client Tools
###########
/src/dotnet/Azure.ClientSdk.Analyzers @jsquire @pallavit @JoshLove-msft @christothes @annelo-msft @KrzysztofCwalina @tg-msft @heaths @m-nash
/src/dotnet/APIView @chidozieononiwu
33 changes: 17 additions & 16 deletions eng/common/testproxy/dotnet-devcert.crt
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDSDCCAjCgAwIBAgIUIoKu8Oao7j10TLNxaUG2Bs0FrRwwDQYJKoZIhvcNAQEL
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIyMDgwNTIxMTcyM1oXDTIzMDgw
NTIxMTcyM1owFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEA0UPG7ER++5/9D/qa4SCtt7QvdHwcpidbwktPNU8iRW7V
pIDPWS4goLp/+7+maT0Z/mqwSO3JDtm/dtdlr3F/5EMgyUExnYcvUixZAiyFyEwj
j6wnAtNvqsg4rDqBlD17fuqTVsZm9Yo7QYub6p5PeznWYucOxRrczqFCiW4uj0Yk
GgUHPPmCvhSDKowV8CYRHfkD6R8R4SFkoP3/uejXHxeXoYJNMWq5K0GqGaOZtNFB
F7QWZHoLrRpZcY4h+DxwP3c+/FdlVcs9nstkF+EnTnwx5IRyKsaWb/pUEmYKvNDz
wi6qnRUdu+DghZuvyZZDgwoYrSZokcbKumk0MsLC3QIDAQABo4GRMIGOMA8GA1Ud
MIIDZzCCAk+gAwIBAgIUXj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z8YpZ+fXufM
MNMNfyJHSMEMFIT2D1UaQiwryXWQWJ93OiSdjA==
UC5ORVQgQ29yZSBIVFRQUyBkZXZlbG9wbWVudCBjZXJ0aWZpY2F0ZTAdBgNVHQ4E
FgQU+9BDdfBwXH38ti7IGpL4Kn7IDVgwDQYJKoZIhvcNAQELBQADggEBAKoy2dp8
gsKk1U51164IIhOYisaJ1egOI0++STd8j94SX9XlCAgwLaPr/mU/U438xKI1inSA
Miaboqtt2tqvfP5nceSYL3FPJ3K0ADw8UFgwApKiRYpRevAIspG+OaqHwHUFRhyG
bxkUZ4w96IEpVtDOGoy12sCmChZgdVk44+y8uurSza18Vj1LfkrN6ppZLt4FII5e
p8BFKtqCRToFRJIIjMePOdTUbeRwUCjBPyYv/h5jcJUfFXQJpPXvJs4LFcUivqA3
sAut3tut6CDzToTMtAD5ebxSPh3DDM6JOsWhrGoT0if5qoio75tG6yV40gi3Tocr
KCwDu8B2O2HlL5Q=
-----END CERTIFICATE-----
Binary file modified eng/common/testproxy/dotnet-devcert.pfx
Binary file not shown.
10 changes: 5 additions & 5 deletions eng/common/testproxy/onboarding/README.me
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ The azure-sdk monorepos are growing quickly due to the presence of recordings. D

The script `generate-assets-json.ps1` will execute the initial migration of your recordings from within a language repo to the [assets repo](https://github.com/Azure/azure-sdk-assets) as well as creating the assets.json file for those assets.

The script is [generate-assets-json.ps1](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/testproxy/transition-scripts/generate-assets-json.ps1)
The script is [generate-assets-json.ps1](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/testproxy/onboarding/generate-assets-json.ps1)

### Download the transition script locally

```powershell
Invoke-WebRequest -OutFile "generate-assets-json.ps1" https://raw.githubusercontent.com/Azure/azure-sdk-tools/main/eng/common/testproxy/transition-scripts/generate-assets-json.ps1
Invoke-WebRequest -OutFile "generate-assets-json.ps1" https://raw.githubusercontent.com/Azure/azure-sdk-tools/main/eng/common/testproxy/onboarding/generate-assets-json.ps1
```

```bash
wget https://raw.githubusercontent.com/Azure/azure-sdk-tools/main/eng/common/testproxy/transition-scripts/generate-assets-json.ps1 -o generate-assets-json.ps1
wget https://raw.githubusercontent.com/Azure/azure-sdk-tools/main/eng/common/testproxy/onboarding/generate-assets-json.ps1 -o generate-assets-json.ps1
```

## Setup
Expand Down Expand Up @@ -73,7 +73,7 @@ The location of the automatically restored assets is colloquially referred to as

## Running the script

[generate-assets-json.ps1](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/testproxy/transition-scripts/generate-assets-json.ps1) is a standalone powershell script with no supporting script requirements. The easiest way to run the script would be to use a one-liner [defined above](#download-the-transition-script-locally) to grab the file directly. **Please ensure you have the newest version of this script before continuing!**
[generate-assets-json.ps1](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/testproxy/onboarding/generate-assets-json.ps1) is a standalone powershell script with no supporting script requirements. The easiest way to run the script would be to use a one-liner [defined above](#download-the-transition-script-locally) to grab the file directly. **Please ensure you have the newest version of this script before continuing!**

```powershell
# if downloading the file singly, cd to the directory containing generate-assets-json.ps1
Expand Down Expand Up @@ -124,7 +124,7 @@ This is necessary because the language is used in several places.

1. The AssetsRepoPrefixPath in assets.json is set to the language.
2. The TagPrefix is set to the `<language>/<ServiceDirectory>` or `<language>/<ServiceDirectory>/<Library>` etc.
3. The language also used to determine what the [recording directories within a repository are named](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/testproxy/transition-scripts/generate-assets-json.ps1#L47).
3. The language also used to determine what the [recording directories within a repository are named](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/testproxy/onboarding/generate-assets-json.ps1#L47).

## A final note about the initial push

Expand Down
2 changes: 1 addition & 1 deletion eng/common/testproxy/target_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-dev.20230728.1
1.0.0-dev.20230802.1
2 changes: 1 addition & 1 deletion src/dotnet/APIView/APIViewUITests/APIViewUITests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Selenium.Support" Version="4.10.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.10.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="113.0.5672.6300" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="115.0.5790.17000" />
<PackageReference Include="SeleniumExtras.WaitHelpers" Version="1.0.2" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DevopsArtifactRepository : IDevopsArtifactRepository
private readonly string _hostUrl;

private readonly TelemetryClient _telemetryClient;
public DevopsArtifactRepository(IConfiguration configuration, IHttpContextAccessor httpContextAccessor)
public DevopsArtifactRepository(IConfiguration configuration)
{
_configuration = configuration;
_devopsAccessToken = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(string.Format("{0}:{1}", "", _configuration["Azure-Devops-PAT"])));
Expand All @@ -39,7 +39,7 @@ public DevopsArtifactRepository(IConfiguration configuration, IHttpContextAccess

_devopsClient = new HttpClient();
_devopsClient.DefaultRequestHeaders.Accept.Clear();
_devopsClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
_devopsClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
_devopsClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", _devopsAccessToken);
}

Expand Down Expand Up @@ -68,11 +68,11 @@ private async Task<HttpResponseMessage> GetFromDevopsAsync(string request)
{
var downloadResp = await _devopsClient.GetAsync(request);
int count = 0;
while ((downloadResp.StatusCode == HttpStatusCode.TooManyRequests || downloadResp.StatusCode == HttpStatusCode.BadRequest) && count < 5)
int[] waitTimes = new int[] { 0, 1, 2, 4, 8, 16, 32, 64, 128, 256 };
while ((downloadResp.StatusCode == HttpStatusCode.TooManyRequests || downloadResp.StatusCode == HttpStatusCode.BadRequest) && count < waitTimes.Length)
{
var retryAfter = (downloadResp.Headers.RetryAfter is null) ? "10" : downloadResp.Headers.RetryAfter.ToString();
_telemetryClient.TrackTrace($"Download request from devops artifact is throttled. Retry After: {retryAfter}, Retry count: {count}");
await Task.Delay(int.Parse(retryAfter) * 1000);
_telemetryClient.TrackTrace($"Download request from devops artifact is either throttled or flaky, waiting {waitTimes[count]} seconds before retrying, Retry count: {count}");
await Task.Delay(TimeSpan.FromSeconds(waitTimes[count]));
downloadResp = await _devopsClient.GetAsync(request);
count++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void AstDumper::OpenNamespace(std::string_view const& namespaceName)
LeftAlign();
InsertKeyword("namespace");
InsertWhitespace();
InsertMemberName(namespaceName);
InsertIdentifier(namespaceName);
InsertWhitespace();
InsertPunctuation('{');
AdjustIndent(namespaceIndent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ class AstDumper {
virtual void InsertText(std::string_view const& text) = 0;
virtual void InsertPunctuation(char punctuation) = 0;
virtual void InsertLineIdMarker() = 0;
virtual void InsertIdentifier(std::string_view const& identifier) = 0;
virtual void InsertTypeName(
std::string_view const& type,
std::string_view const& typeNavigationId)
= 0;
virtual void InsertMemberName(std::string_view const& member) = 0;
virtual void InsertMemberName(std::string_view const& member, std::string_view const& memberFullName) = 0;
virtual void InsertStringLiteral(std::string_view const& str) = 0;
virtual void InsertLiteral(std::string_view const& str) = 0;
virtual void InsertComment(std::string_view const& comment) = 0;
Expand Down
Loading

0 comments on commit 36599b0

Please sign in to comment.