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

New scheduled workflow to test using the azcore backend nightly #3591

Merged
merged 6 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/azcore-scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: azcore-scheduled

on:
schedule:
- cron: 15 3 * * 1-6 # 3:15 am UTC, Mon-Sat
workflow_dispatch: {}

jobs:
version:
uses: ./.github/workflows/version.yml
secrets: inherit

build_test:
uses: ./.github/workflows/build-test.yml
secrets: inherit
needs: version
with:
ref: ${{ github.ref }}
version: ${{ needs.version.outputs.version }}
short_test: false
retention_days: 7
use_autorest: false
5 changes: 5 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
type: number
description: The number of days for which we retain assets
default: 90
use_autorest:
type: boolean
description: Whether to use autorest, not azcore
default: true

env:
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
Expand All @@ -41,6 +45,7 @@ env:
ARM_SUBSCRIPTION_ID: 0282681f-7a9e-424b-80b2-96babd57a8a1
ARM_TENANT_ID: 706143bc-e1d4-4593-aee2-c9dc60ab9be7
PULUMI_API: https://api.pulumi-staging.io
PULUMI_USE_AUTOREST: ${{ inputs.use_autorest }}

jobs:
prerequisites:
Expand Down
2 changes: 2 additions & 0 deletions provider/pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ func (k *azureNativeProvider) Configure(ctx context.Context,

func (k *azureNativeProvider) newAzureClient(armAuth autorest.Authorizer, tokenCred azcore.TokenCredential, userAgent string) (azure.AzureClient, error) {
if os.Getenv("PULUMI_USE_AUTOREST") == "false" {
logging.V(9).Infof("AzureClient: using azCore")
return azure.NewAzCoreClient(tokenCred, userAgent, k.getAzureCloud(), nil)
}
logging.V(9).Infof("AzureClient: using autorest")
return azure.NewAzureClient(k.environment, armAuth, userAgent), nil
}

Expand Down
1 change: 1 addition & 0 deletions provider/pkg/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ func TestUsesCorrectAzureClient(t *testing.T) {
p := azureNativeProvider{}

t.Run("default", func(t *testing.T) {
t.Setenv("PULUMI_USE_AUTOREST", "")
client, err := p.newAzureClient(nil, &fake.TokenCredential{}, "pulumi")
require.NoError(t, err)
assert.Equal(t, "azureClientImpl", reflect.TypeOf(client).Elem().Name())
Expand Down
Loading