From 00c61eb9181a6eeb4bc9c415a9ae86dc9309d7ef Mon Sep 17 00:00:00 2001 From: Matthew Christopher Date: Wed, 27 Oct 2021 14:54:20 -0700 Subject: [PATCH 1/3] Change when live CI runs (#1934) --- .github/workflows/live-validation.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/live-validation.yml b/.github/workflows/live-validation.yml index 1247baeae5d..88e873637a7 100644 --- a/.github/workflows/live-validation.yml +++ b/.github/workflows/live-validation.yml @@ -1,13 +1,8 @@ name: Validate with live Azure resources on: - push: - branches: - - main - schedule: - # chosen via a Google search for “what is the best time” - # https://www.reddit.com/r/dadjokes/comments/6dvftv/what_is_the_best_time_on_the_clock/ - - cron: '30 6 * * *' + # 13:00 UTC is a time when both US and NZ are asleep (or headed in that direction) + - cron: '0 13 * * *' jobs: test-generator: From 2895dcbcac912c25af3be5ba331f9ecf457bf682 Mon Sep 17 00:00:00 2001 From: Bevan Arps Date: Thu, 28 Oct 2021 11:32:20 +1300 Subject: [PATCH 2/3] Update Workflow for generating repo diagrams (#1908) Co-authored-by: George Pollard --- .github/workflows/visualize-repo.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visualize-repo.yml b/.github/workflows/visualize-repo.yml index 5b9c5ea96b8..64bde869ff1 100644 --- a/.github/workflows/visualize-repo.yml +++ b/.github/workflows/visualize-repo.yml @@ -15,6 +15,18 @@ jobs: uses: actions/checkout@v2 ref: bot/update-diagrams + - name: Create Branch + uses: peterjgrainger/action-create-branch@b48b0ca0e307c9b56f059b70274984ffeaa90a43 # Pinned to v2.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GH_PAT }} + with: + branch: 'bot/update-diagrams' + + - name: Checkout code + uses: actions/checkout@master + with: + ref: bot/update-diagrams + - name: Update ASO v1 diagram uses: githubocto/repo-visualizer@main with: @@ -42,11 +54,12 @@ jobs: should_push: false - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@7380612b49221684fefa025244f2ef4008ae50ad # v3.10.1 with: token: ${{ secrets.GH_PAT }} commit-message: Update Code Structure Diagrams branch: bot/update-diagrams + base: main delete-branch: true title: '[Automated] Update Code Structure Diagrams' body: | From 772007712ddb5abcace160e47a8be2b22bf90408 Mon Sep 17 00:00:00 2001 From: Matthew Christopher Date: Thu, 28 Oct 2021 15:27:47 -0700 Subject: [PATCH 3/3] Fix bug with unspecified HTTPClient (#1938) --- .../genericarmclient/generic_client.go | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/v2/internal/genericarmclient/generic_client.go b/v2/internal/genericarmclient/generic_client.go index 151a33b1c5d..1fbc7fe8622 100644 --- a/v2/internal/genericarmclient/generic_client.go +++ b/v2/internal/genericarmclient/generic_client.go @@ -34,17 +34,24 @@ type GenericClient struct { // TODO: Need to do retryAfter detection in each call? func NewARMConnection(creds azcore.TokenCredential, httpClient *http.Client) *arm.Connection { + opts := &arm.ConnectionOptions{ + Retry: policy.RetryOptions{ + MaxRetries: 0, + }, + PerCallPolicies: []policy.Policy{NewUserAgentPolicy(userAgent)}, + DisableRPRegistration: true, + } + // We assign this HTTPClient like this because if we actually set it to nil, due to the way + // go interfaces wrap values, the subsequent if httpClient == nil check returns false (even though + // the value IN the interface IS nil). + if httpClient != nil { + opts.HTTPClient = httpClient + } + con := arm.NewConnection( arm.AzurePublicCloud, creds, - &arm.ConnectionOptions{ - Retry: policy.RetryOptions{ - MaxRetries: 0, - }, - PerCallPolicies: []policy.Policy{NewUserAgentPolicy(userAgent)}, - DisableRPRegistration: true, - HTTPClient: httpClient, - }) + opts) return con }