-
Notifications
You must be signed in to change notification settings - Fork 92
Add ESRP release API helper #1266
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
Open
ecraig12345
wants to merge
8
commits into
main
Choose a base branch
from
user/elcraig/1es-pt-migration-publish
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cc7fe34
Add ESRP release API helper
ecraig12345 2d6700d
feedback
ecraig12345 8a802e4
fix release details failure
ecraig12345 9abfee0
feedback
ecraig12345 160786b
yarn
ecraig12345 9f9cefb
restructure
ecraig12345 26aa424
Add specific 404 message
ecraig12345 54c7a45
more restructuring
ecraig12345 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| /* | ||
| Apply changes: | ||
| az deployment group create \ | ||
| --subscription "<sub>" \ | ||
| --resource-group "<rg>" \ | ||
| --template-file .ado/roleAssignments.bicep \ | ||
| --parameters \ | ||
| stagingStorageName=<storage> \ | ||
| managedIdentityName=<uami-name> | ||
|
|
||
| Preview changes: | ||
| az deployment group what-if ... | ||
| */ | ||
|
|
||
| // Name of the user-assigned managed identity to create and grant storage roles to. | ||
| param managedIdentityName string | ||
|
|
||
| param stagingStorageName string | ||
|
|
||
| // Built-in role definition IDs. | ||
| // See https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles | ||
| var roleDefinitions = { | ||
| storageBlobDataContributor: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' | ||
| storageBlobDelegator: 'db58b8e5-c6ad-4a2a-8342-4190687cbf4a' | ||
| } | ||
|
|
||
| // If an account with this name already exists in the resource group, the deployment reconciles | ||
| // its properties to match the values below — make sure they match the existing account, or run | ||
| // `what-if` first to preview. | ||
| resource stagingStorage 'Microsoft.Storage/storageAccounts@2023-05-01' = { | ||
| name: stagingStorageName | ||
| location: resourceGroup().location | ||
| kind: 'StorageV2' | ||
| sku: { | ||
| name: 'Standard_LRS' | ||
| } | ||
| properties: { | ||
| accessTier: 'Hot' | ||
| allowBlobPublicAccess: false | ||
| allowSharedKeyAccess: false | ||
| minimumTlsVersion: 'TLS1_2' | ||
| supportsHttpsTrafficOnly: true | ||
| } | ||
| } | ||
|
|
||
| // User-assigned managed identity that will be granted storage roles below. | ||
| // UAMIs are service principals as far as role assignments are concerned. | ||
| resource uami 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
| name: managedIdentityName | ||
| location: resourceGroup().location | ||
| } | ||
|
|
||
| resource blobDataContrib 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
| scope: stagingStorage | ||
| name: guid(stagingStorage.id, managedIdentityName, 'StorageBlobDataContributor') | ||
| properties: { | ||
| principalId: uami.properties.principalId | ||
| principalType: 'ServicePrincipal' | ||
| roleDefinitionId: subscriptionResourceId( | ||
| 'Microsoft.Authorization/roleDefinitions', | ||
| roleDefinitions.storageBlobDataContributor | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| resource blobDelegator 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
| scope: stagingStorage | ||
| name: guid(stagingStorage.id, managedIdentityName, 'StorageBlobDelegator') | ||
| properties: { | ||
| principalId: uami.properties.principalId | ||
| principalType: 'ServicePrincipal' | ||
| roleDefinitionId: subscriptionResourceId( | ||
| 'Microsoft.Authorization/roleDefinitions', | ||
| roleDefinitions.storageBlobDelegator | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| // Garbage-collect staged release artifacts and release-state markers. | ||
| // The tool deletes staging blobs in a finally block after each release, but stragglers | ||
| // can be left behind if the process is killed mid-release. release-state markers are | ||
| // never deleted by the tool and would otherwise accumulate forever. | ||
| resource lifecyclePolicy 'Microsoft.Storage/storageAccounts/managementPolicies@2023-05-01' = { | ||
| parent: stagingStorage | ||
| name: 'default' | ||
| properties: { | ||
| policy: { | ||
| rules: [ | ||
| { | ||
| name: 'expire-staging-blobs' | ||
| enabled: true | ||
| type: 'Lifecycle' | ||
| definition: { | ||
| filters: { | ||
| blobTypes: ['blockBlob'] | ||
| prefixMatch: ['staging/'] | ||
| } | ||
| actions: { | ||
| baseBlob: { | ||
| delete: { daysAfterModificationGreaterThan: 3 } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| { | ||
| name: 'expire-release-state' | ||
| enabled: true | ||
| type: 'Lifecycle' | ||
| definition: { | ||
| filters: { | ||
| blobTypes: ['blockBlob'] | ||
| prefixMatch: ['release-state/'] | ||
| } | ||
| actions: { | ||
| baseBlob: { | ||
| delete: { daysAfterModificationGreaterThan: 90 } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| .yarn/ | ||
| *.bicep | ||
| *.log | ||
| *.patch | ||
| *.snap | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| diff --git a/lib/tostring.js b/lib/tostring.js | ||
| index f5a49a36548b1e299042c9e3d1cdd60c71d8ec0c..493dd5cdd98ad99f84fb740864f9dd54c73ab7a3 100644 | ||
| --- a/lib/tostring.js | ||
| +++ b/lib/tostring.js | ||
| @@ -4,7 +4,11 @@ var Buffer = require('buffer').Buffer; | ||
| module.exports = function toString(obj) { | ||
| if (typeof obj === 'string') | ||
| return obj; | ||
| - if (typeof obj === 'number' || Buffer.isBuffer(obj)) | ||
| + if (typeof obj === 'number' || typeof obj === 'bigint' || Buffer.isBuffer(obj)) | ||
| return obj.toString(); | ||
| - return JSON.stringify(obj); | ||
| + const marker = '__BIGINT_' + Math.random().toString(36).slice(2) + '__'; | ||
| + const json = JSON.stringify(obj, (_k, v) => | ||
| + typeof v === 'bigint' ? marker + v.toString() + marker : v | ||
| + ); | ||
| + return json.replace(new RegExp('"' + marker + '(-?\\d+)' + marker + '"', 'g'), '$1'); | ||
| }; | ||
| \ No newline at end of file |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.