-
Notifications
You must be signed in to change notification settings - Fork 2
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
Estebanreyl/ready for production #55
Conversation
await acrTools.sendRequestToRegistry('delete', registry.loginServer, path, username, password); //official call to delete the image | ||
const shouldDelete = await quickPicks.confirmUserIntent('Are you sure you want to delete this image? Enter Yes to continue: '); | ||
if (shouldDelete) { | ||
const { acrAccessToken } = await acrTools.getDockerCompatibleTokensFromRegistry(registry, `repository:${repoName}:*`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what is DockerCompatibleTokens. Is it just acquireRegistryAccessToken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was having trouble with naming conventions here ideally it should do the same as acquireACRAccessToken just having different requirements but typescript doesn't support function overloading, is there a best practice naming convention in this case? Say acquireACRAccessTokenFromRegistry?
utils/Azure/acrTools.ts
Outdated
* @param http_method : the http method, this function currently only uses delete | ||
* @param login_server: the login server of the registry | ||
* @param path : the URL path | ||
* @param username : registry username, can be in generic form of 0's, used to generate authorization header | ||
* @param password : registry password, can be in form of accessToken, used to generate authorization header | ||
*/ | ||
export async function sendRequestToRegistry(http_method: string, login_server: string, path: string, username: string, password: string): Promise<void> { | ||
export async function sendRequestToRegistry(http_method: string, login_server: string, path: string, password: string): Promise<any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to bearerAccessToken
utils/Azure/acrTools.ts
Outdated
return { 'refreshToken': refreshTokenACR, 'accessToken': accessTokenACR }; | ||
//Registry item management | ||
/** List images under a specific Repository */ | ||
export async function getACRImages(element: Repository): Promise<AzureImage[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are all under acrTools module, so I don't feel ACR
is necessary. The name can be getImages. For the particular case, I think we can rename it to getImagesByRepository or getImageTagsByRepository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems reasonable, I'll only keep ACR for the tokens as those make things clearer given the aad tokens.
let url: string = `https://${login_server}${path}`; | ||
let header = getAuthorizationHeader(username, password); | ||
let header = 'Bearer ' + password; | ||
let opt = { | ||
headers: { 'Authorization': header }, | ||
http_method: http_method, | ||
url: url | ||
} | ||
if (http_method === 'delete') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does sendRequestToRegistry
actually only support delete operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As its implemented yes, could probably modify it without much work however
utils/Azure/acrTools.ts
Outdated
try { | ||
await request.delete(opt); | ||
} catch (error) { | ||
console.log(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh we can ignore that I forgot to remove that, it was for testing
/** Obtains tokens for using the Docker Registry v2 Api | ||
* @param registry The targeted Azure Container Registry | ||
* @param scope String determining the scope of the access token | ||
* @returns acrRefreshToken: For use as a Password for docker registry access , acrAccessToken: For use with docker API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if getDockerCompatibleTokensFromRegistry should just return accessToken. If users need to get username/password for login, they should use loginCredentials.
So I recommend rename getDockerCompatibleTokensFromRegistry to getACRAccessToken
utils/Azure/acrTools.ts
Outdated
const allRepos: Repository[] = []; | ||
let repo: Repository; | ||
const { acrRefreshToken, acrAccessToken } = await getDockerCompatibleTokensFromRegistry(registry, "registry:catalog:*"); | ||
await request.get('https://' + registry.loginServer + '/v2/_catalog', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it can use sendRequestToRegistry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially, Ill review that
if (body.length > 0) { | ||
const repositories = JSON.parse(body).repositories; | ||
for (let tempRepo of repositories) { | ||
repo = new Repository(registry, tempRepo, acrAccessToken, acrRefreshToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does Repository need to store acrAccessToken and acrRefreshToken? acrAccessToken is short-lived. It's better to acquire it on demand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense
registry = context.registry; | ||
let wholeName = repoName.split(':'); | ||
let wholeName = context.label.split(':'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add type to make it more clear
if (shouldDelete) { | ||
let subscription: SubscriptionModels.Subscription = acrTools.getRegistrySubscription(registry); | ||
let resourceGroup: string = acrTools.getResourceGroupName(registry); | ||
const client = AzureUtilityManager.getInstance().getContainerRegistryManagementClient(subscription); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make a quick function for this?
getAzureUtilityManager_managementClient(subscription) or something if we're going about simplifying things + we use this in a ton of places
vscode.window.showInformationMessage(`Successfully deleted repository ${Repository}`); | ||
} else { | ||
throw new UserCancelledError(); | ||
} | ||
reportTelemetry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wrote out this function in both delete-repository and delete-azure-image. Put in central loc?
const client = AzureUtilityManager.getInstance().getContainerRegistryManagementClient(subscription); | ||
|
||
await client.registries.beginDeleteMethod(resourceGroup, registry.name); | ||
vscode.window.showInformationMessage('Successfully deleted registry ' + registry.name); | ||
telemetryReport(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this do the same thing as reportTelemetry() ?
if (!answer) { throw new UserCancelledError(); } | ||
|
||
answer = answer.toLowerCase(); | ||
return answer === 'yes'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: make sure it's capital "Yes"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any yes should work, this is intended
commands/utils/quick-pick-azure.ts
Outdated
|
||
export async function quickPickSKU(): Promise<string> { | ||
let sku: string; | ||
sku = await vscode.window.showQuickPick(skus, { 'canPickMany': false, 'placeHolder': 'Choose a SKU' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Choose a SKU to use" to be consistent with other placeholders
} | ||
|
||
/** Acquires a new registry name from a user, validating that the name is unique */ | ||
async function acquireRegistryName(client: ContainerRegistryManagementClient): Promise<string> { | ||
let opt: vscode.InputBoxOptions = { | ||
ignoreFocusOut: false, | ||
prompt: 'Registry name? ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Registry name? to be consistent with "New Resource Group name?"
commands/utils/quick-pick-azure.ts
Outdated
|
||
let opt: vscode.InputBoxOptions = { | ||
ignoreFocusOut: false, | ||
prompt: 'New resource group name?' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize Resource Group. The capitalization kinda goes back and forth between prompts. So why don't you stick with capitalizing the thing in question (ie Location, Registry, etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, I often do this unknowingly.
I think this has all been updated now |
* began updating * Reorganized create registry and delete azure image * continued improvements * Began updating login * being credentials update * further updates * Finished updating, need to test functionality now * Updated requests, things all work now * Applied some nit fixes * Updates to naming * maintain UtilityManager standards * Updated Prompts * Updated imports and naming / standarized telemetry * Added explorer refresh capabilities on delete/add
Sorted Existing Create Registry ready for code review Jackson esteban/unified client nit Fix (#24) * Added Azure Credentials Manager Singleton * Small Style Fixes * Further Style fixes, added getResourceManagementClient * Lazy Initialization Patches Enabled location selection Location request fixes -Changed order of questions asked to user for better UX (location of new res group & location of new registry) -Placeholder of location is display name view Added SKU selection Quick fix- initializing array syntax Julia/delete image (#29) * first fully functional version of delete through input bar AND right click * refactored code to make it prettier! * comments * comments, added subscription function * fixed to style guide * style fixes, refactoring * delete image after reviews put my functions from azureCredentialsManager into two new files: utils/azure/acrTools.ts, and commands/utils/quick-pick-azure.ts Edited code based on Esteban's and Bin's reviews * One last little change to delete image * moved repository, azureimage, and getsubscriptions to the correct places within deleteImage * changes from PR reviews on delete image * fixed authentication issue, got rid of azureAccount property for repository and image **on constructor for repository, azurecredentialsmanager was being recreated and thus couldn't find the azureAccount. For this reason, I got rid of the azureAccount property of the classes Repository and AzureImage. This bug may lead to future problems (Esteban and I couldn't see why it was happening) * minor fixes deleteImage * delete a parentheses copied previous push to acr into new pull-from-azure.ts file Estebanreyl/dev merge fixes (#43) * Merge fixes to acquire latest telemetry items * Updated to master AzureUtilityManager added acrbuild stuff Rutusamai/list build tasks for each registry (#37) * tslint updates, transfered from old branch * updated icon * Addressed PR comments- mostly styling/code efficiency * Changed url to aka.ms link * changed Error window to Info message for no build tasks in your registry * Changed default sku and unified parsing resource group into a new method, getResourceGroup in acrTools.ts * Changed build task icon utility bug fix Julia/delete repository final (#49) * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * spacing * final commit * Cleaned code * Added Telemetry Julia/delete registry final (#47) Delete azure registry functionality added Delete azure registry moved to branch off dev Reorganized stye Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries Split the loginCredentials function, added docker login and docker pull and telemetry actions copied previous push to acr into new pull-from-azure.ts file Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries Split the loginCredentials function, added docker login and docker pull and telemetry actions Finished pull from azure right click feature Working again after rebasing and resolving merge conflicts Refactoring, prod. Estebanreyl/ready for production (#55) * began updating * Reorganized create registry and delete azure image * continued improvements * Began updating login * being credentials update * further updates * Finished updating, need to test functionality now * Updated requests, things all work now * Applied some nit fixes * Updates to naming * maintain UtilityManager standards * Updated Prompts * Updated imports and naming / standarized telemetry * Added explorer refresh capabilities on delete/add Jackson/quick build dev (#46) * added acrbuild stuff * added acrbuild stuff * Update to match utility manager class * Added quick pick for selecting resource group and registry * clean * Added subscription support * utility bug fix * added folder select * Updates and fixes * Refactoring, prod. * Flexible OSType added ID Move build to azure commands cleanup Relative dockerfile support Removed await, updating list in enumeration fixed chdir flexible ostype Rutusamai/Show Build Task properties (#70) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * removed run build task stuff * cleanup * addressed esteban's comments * buildTask = context.task.name rather than label * fixes from Bin's comments Merge branch 'dev' of https://github.com/AzureCR/vscode-docker into master4 merge missed small changes Rutusamai/Run a Build Task (#71) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * run is working for right click * run build task works through command pallette. added success notification * removed show build task * cleanup- matched quickpick buils task and tasknode withshow build task branch * removed showTaskManager * spacing * outputChannel and null icon * merge to update with dev Estebanreyl/build logs final (#72) * "Merge branch 'estebanreyl/buildlogsWithAccesibility' of https://github.com/AzureCR/vscode-docker into estebanreyl/buildlogsWithAccesibility" This reverts commit e645cbf, reversing changes made to fc4a477. * Refactored and organized log view into readable components. * moved storage * Began incorporating icons * Added icons * Further standarization * added logs * Added download log capabilities * Updated Copy * Updated inner div size alignment * Added resizing script * header sort by is only clickable on text now * fixed header table * Fix minor display issues * Identified filtering strategy * Begin adding sorting * Merge with dev * Added proper filtering * Nit loading improvements * Added accesibility, key only behaviour * accesibility retouches and enable right click from tasknode * merges * fix module name Adds streaming and command standarization (ext.ui) (#73) * Adds streaming and command standarization (ext.ui) * removed unecessary append lines * small fixes * Fix merge issues changes for ACR 3.0.0 (#80) * This commit contains changes necessary for the azure-arm-containerregistry 3.0.0 * Fixed PR feedback Run task fixed. Issue ID: 79 missing changes added Fixing ACR run logs for Images Sajaya/top1 (#83) * Query only 1 record for runs * View Azure logs bug fix
* Added Azure Credentials Manager Singleton (#18) * Added Azure Credentials Manager Singleton * Added getResourceManagementClient * Sorted Existing Create Registry ready for code review * Added acquiring telemetry data for create registry * broke up createnewresourcegroup method and fixed client use Added try catch loop and awaited for resource group list again to check for duplicates with ResourceManagementClient * Jackson esteban/unified client nit Fix (#24) * Added Azure Credentials Manager Singleton * Small Style Fixes * Further Style fixes, added getResourceManagementClient * Lazy Initialization Patches * Enabled location selection * Location request fixes -Changed order of questions asked to user for better UX (location of new res group & location of new registry) -Placeholder of location is display name view * Refactor while loop for new res group * Added SKU selection * Quick fix- initializing array syntax * Added specific error messages and comments * Julia/delete image (#29) * first fully functional version of delete through input bar AND right click * refactored code to make it prettier! * comments * comments, added subscription function * fixed to style guide * style fixes, refactoring * delete image after reviews put my functions from azureCredentialsManager into two new files: utils/azure/acrTools.ts, and commands/utils/quick-pick-azure.ts Edited code based on Esteban's and Bin's reviews * One last little change to delete image * moved repository, azureimage, and getsubscriptions to the correct places within deleteImage * changes from PR reviews on delete image * fixed authentication issue, got rid of azureAccount property for repository and image **on constructor for repository, azurecredentialsmanager was being recreated and thus couldn't find the azureAccount. For this reason, I got rid of the azureAccount property of the classes Repository and AzureImage. This bug may lead to future problems (Esteban and I couldn't see why it was happening) * minor fixes deleteImage * delete a parentheses * copied previous push to acr into new pull-from-azure.ts file * Estebanreyl/dev merge fixes (#43) * Merge fixes to acquire latest telemetry items * Updated to master AzureUtilityManager * added acrbuild stuff * added acrbuild stuff * Update to match utility manager class * Rutusamai/list build tasks for each registry (#37) * tslint updates, transfered from old branch * updated icon * Addressed PR comments- mostly styling/code efficiency * Changed url to aka.ms link * changed Error window to Info message for no build tasks in your registry * Changed default sku and unified parsing resource group into a new method, getResourceGroup in acrTools.ts * Changed build task icon * Added quick pick for selecting resource group and registry * clean * Added subscription support * utility bug fix * Julia/delete repository final (#49) * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * spacing * final commit * Cleaned code * Added Telemetry * Julia/delete registry final (#47) Delete azure registry functionality added Delete azure registry moved to branch off dev Reorganized stye * Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries * added folder select * Split the loginCredentials function, added docker login and docker pull and telemetry actions * Finished pull from azure right click feature * deleted push to azure * removed username and password from Azure Registry Node * Clean up * copied previous push to acr into new pull-from-azure.ts file * Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries * Split the loginCredentials function, added docker login and docker pull and telemetry actions * Finished pull from azure right click feature * deleted push to azure * Clean up * Working again after rebasing and resolving merge conflicts * Updates and fixes * Fixes from PR comments -renamed loginCredentials functions -added await to docker commands in image pull -cleanup * uncapitalize AzureRegistryNode * Refactoring, prod. * Flexible OSType * Estebanreyl/ready for production (#55) * began updating * Reorganized create registry and delete azure image * continued improvements * Began updating login * being credentials update * further updates * Finished updating, need to test functionality now * Updated requests, things all work now * Applied some nit fixes * Updates to naming * maintain UtilityManager standards * Updated Prompts * Updated imports and naming / standarized telemetry * Added explorer refresh capabilities on delete/add * Jackson/quick build dev (#46) * added acrbuild stuff * added acrbuild stuff * Update to match utility manager class * Added quick pick for selecting resource group and registry * clean * Added subscription support * utility bug fix * added folder select * Updates and fixes * Refactoring, prod. * Flexible OSType * added ID * Move build to azure commands * cleanup * Relative dockerfile support * Removed await, updating list in enumeration * fixed chdir * flexible ostype * Rutusamai/Show Build Task properties (#70) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * removed run build task stuff * cleanup * addressed esteban's comments * buildTask = context.task.name rather than label * fixes from Bin's comments * Merge branch 'dev' of https://github.com/AzureCR/vscode-docker into master4 * merge * missed small changes * Rutusamai/Run a Build Task (#71) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * run is working for right click * run build task works through command pallette. added success notification * removed show build task * cleanup- matched quickpick buils task and tasknode withshow build task branch * removed showTaskManager * spacing * outputChannel and null icon * merge to update with dev * Estebanreyl/build logs final (#72) * "Merge branch 'estebanreyl/buildlogsWithAccesibility' of https://github.com/AzureCR/vscode-docker into estebanreyl/buildlogsWithAccesibility" This reverts commit e645cbf, reversing changes made to fc4a477. * Refactored and organized log view into readable components. * moved storage * Began incorporating icons * Added icons * Further standarization * added logs * Added download log capabilities * Updated Copy * Updated inner div size alignment * Added resizing script * header sort by is only clickable on text now * fixed header table * Fix minor display issues * Identified filtering strategy * Begin adding sorting * Merge with dev * Added proper filtering * Nit loading improvements * Added accesibility, key only behaviour * accesibility retouches and enable right click from tasknode * merges * fix module name * Adds streaming and command standarization (ext.ui) (#73) * Adds streaming and command standarization (ext.ui) * removed unecessary append lines * small fixes * Fix merge issues * changes for ACR 3.0.0 (#80) * This commit contains changes necessary for the azure-arm-containerregistry 3.0.0 * Fixed PR feedback * Run task fixed. Issue ID: 79 * missing changes added * Fixing ACR run logs for Images * Sajaya/top1 (#83) * Query only 1 record for runs * View Azure logs * Refactoring build to run and buildTask to task * Update Credentail Management Sorted Existing Create Registry ready for code review Jackson esteban/unified client nit Fix (#24) * Added Azure Credentials Manager Singleton * Small Style Fixes * Further Style fixes, added getResourceManagementClient * Lazy Initialization Patches Enabled location selection Location request fixes -Changed order of questions asked to user for better UX (location of new res group & location of new registry) -Placeholder of location is display name view Added SKU selection Quick fix- initializing array syntax Julia/delete image (#29) * first fully functional version of delete through input bar AND right click * refactored code to make it prettier! * comments * comments, added subscription function * fixed to style guide * style fixes, refactoring * delete image after reviews put my functions from azureCredentialsManager into two new files: utils/azure/acrTools.ts, and commands/utils/quick-pick-azure.ts Edited code based on Esteban's and Bin's reviews * One last little change to delete image * moved repository, azureimage, and getsubscriptions to the correct places within deleteImage * changes from PR reviews on delete image * fixed authentication issue, got rid of azureAccount property for repository and image **on constructor for repository, azurecredentialsmanager was being recreated and thus couldn't find the azureAccount. For this reason, I got rid of the azureAccount property of the classes Repository and AzureImage. This bug may lead to future problems (Esteban and I couldn't see why it was happening) * minor fixes deleteImage * delete a parentheses copied previous push to acr into new pull-from-azure.ts file Estebanreyl/dev merge fixes (#43) * Merge fixes to acquire latest telemetry items * Updated to master AzureUtilityManager added acrbuild stuff Rutusamai/list build tasks for each registry (#37) * tslint updates, transfered from old branch * updated icon * Addressed PR comments- mostly styling/code efficiency * Changed url to aka.ms link * changed Error window to Info message for no build tasks in your registry * Changed default sku and unified parsing resource group into a new method, getResourceGroup in acrTools.ts * Changed build task icon utility bug fix Julia/delete repository final (#49) * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * spacing * final commit * Cleaned code * Added Telemetry Julia/delete registry final (#47) Delete azure registry functionality added Delete azure registry moved to branch off dev Reorganized stye Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries Split the loginCredentials function, added docker login and docker pull and telemetry actions copied previous push to acr into new pull-from-azure.ts file Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries Split the loginCredentials function, added docker login and docker pull and telemetry actions Finished pull from azure right click feature Working again after rebasing and resolving merge conflicts Refactoring, prod. Estebanreyl/ready for production (#55) * began updating * Reorganized create registry and delete azure image * continued improvements * Began updating login * being credentials update * further updates * Finished updating, need to test functionality now * Updated requests, things all work now * Applied some nit fixes * Updates to naming * maintain UtilityManager standards * Updated Prompts * Updated imports and naming / standarized telemetry * Added explorer refresh capabilities on delete/add Jackson/quick build dev (#46) * added acrbuild stuff * added acrbuild stuff * Update to match utility manager class * Added quick pick for selecting resource group and registry * clean * Added subscription support * utility bug fix * added folder select * Updates and fixes * Refactoring, prod. * Flexible OSType added ID Move build to azure commands cleanup Relative dockerfile support Removed await, updating list in enumeration fixed chdir flexible ostype Rutusamai/Show Build Task properties (#70) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * removed run build task stuff * cleanup * addressed esteban's comments * buildTask = context.task.name rather than label * fixes from Bin's comments Merge branch 'dev' of https://github.com/AzureCR/vscode-docker into master4 merge missed small changes Rutusamai/Run a Build Task (#71) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * run is working for right click * run build task works through command pallette. added success notification * removed show build task * cleanup- matched quickpick buils task and tasknode withshow build task branch * removed showTaskManager * spacing * outputChannel and null icon * merge to update with dev Estebanreyl/build logs final (#72) * "Merge branch 'estebanreyl/buildlogsWithAccesibility' of https://github.com/AzureCR/vscode-docker into estebanreyl/buildlogsWithAccesibility" This reverts commit e645cbf, reversing changes made to fc4a477. * Refactored and organized log view into readable components. * moved storage * Began incorporating icons * Added icons * Further standarization * added logs * Added download log capabilities * Updated Copy * Updated inner div size alignment * Added resizing script * header sort by is only clickable on text now * fixed header table * Fix minor display issues * Identified filtering strategy * Begin adding sorting * Merge with dev * Added proper filtering * Nit loading improvements * Added accesibility, key only behaviour * accesibility retouches and enable right click from tasknode * merges * fix module name Adds streaming and command standarization (ext.ui) (#73) * Adds streaming and command standarization (ext.ui) * removed unecessary append lines * small fixes * Fix merge issues changes for ACR 3.0.0 (#80) * This commit contains changes necessary for the azure-arm-containerregistry 3.0.0 * Fixed PR feedback Run task fixed. Issue ID: 79 missing changes added Fixing ACR run logs for Images Sajaya/top1 (#83) * Query only 1 record for runs * View Azure logs bug fix * Removed filter for top (#88) * fixing Image Log Filter * fixing tslint error messages * tslint fixes 2 * First PR microsoft#506 review Update include: Deletion of resizable.js Package.json commands alphabetically ordered. General typos, grammar and naming fixes. Change from fs - fs-extra. Other general improvments. * Hide Azure Quick Build if Azure Account not available * Second PR microsoft#506 review update. Quick Build Image name and dockerFile selection Improvements. Upgrade from fs to fs-extra. Log table bug fixes. Error Handeling Improvements. Other general improvements. * Improving Logs generation Error handeling * Third PR microsoft#506 review update. loadLogs parameters update. uploadSourceCode Improvements. * UploadSourceCode no longer has to change process working directory. * lint fix
* Added Azure Credentials Manager Singleton (#18) * Added Azure Credentials Manager Singleton * Added getResourceManagementClient * Sorted Existing Create Registry ready for code review * Added acquiring telemetry data for create registry * broke up createnewresourcegroup method and fixed client use Added try catch loop and awaited for resource group list again to check for duplicates with ResourceManagementClient * Jackson esteban/unified client nit Fix (#24) * Added Azure Credentials Manager Singleton * Small Style Fixes * Further Style fixes, added getResourceManagementClient * Lazy Initialization Patches * Enabled location selection * Location request fixes -Changed order of questions asked to user for better UX (location of new res group & location of new registry) -Placeholder of location is display name view * Refactor while loop for new res group * Added SKU selection * Quick fix- initializing array syntax * Added specific error messages and comments * Julia/delete image (#29) * first fully functional version of delete through input bar AND right click * refactored code to make it prettier! * comments * comments, added subscription function * fixed to style guide * style fixes, refactoring * delete image after reviews put my functions from azureCredentialsManager into two new files: utils/azure/acrTools.ts, and commands/utils/quick-pick-azure.ts Edited code based on Esteban's and Bin's reviews * One last little change to delete image * moved repository, azureimage, and getsubscriptions to the correct places within deleteImage * changes from PR reviews on delete image * fixed authentication issue, got rid of azureAccount property for repository and image **on constructor for repository, azurecredentialsmanager was being recreated and thus couldn't find the azureAccount. For this reason, I got rid of the azureAccount property of the classes Repository and AzureImage. This bug may lead to future problems (Esteban and I couldn't see why it was happening) * minor fixes deleteImage * delete a parentheses * copied previous push to acr into new pull-from-azure.ts file * Estebanreyl/dev merge fixes (#43) * Merge fixes to acquire latest telemetry items * Updated to master AzureUtilityManager * added acrbuild stuff * added acrbuild stuff * Update to match utility manager class * Rutusamai/list build tasks for each registry (#37) * tslint updates, transfered from old branch * updated icon * Addressed PR comments- mostly styling/code efficiency * Changed url to aka.ms link * changed Error window to Info message for no build tasks in your registry * Changed default sku and unified parsing resource group into a new method, getResourceGroup in acrTools.ts * Changed build task icon * Added quick pick for selecting resource group and registry * clean * Added subscription support * utility bug fix * Julia/delete repository final (#49) * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * deleteRepo moved over to branch off dev * Got rid of unnecessary code, fully functioning! * spacing * final commit * Cleaned code * Added Telemetry * Julia/delete registry final (#47) Delete azure registry functionality added Delete azure registry moved to branch off dev Reorganized stye * Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries * added folder select * Split the loginCredentials function, added docker login and docker pull and telemetry actions * Finished pull from azure right click feature * deleted push to azure * removed username and password from Azure Registry Node * Clean up * copied previous push to acr into new pull-from-azure.ts file * Made loginCredentials method in acrTools more efficient, added Pull Image from Azure option, temporary fix for no registries * Split the loginCredentials function, added docker login and docker pull and telemetry actions * Finished pull from azure right click feature * deleted push to azure * Clean up * Working again after rebasing and resolving merge conflicts * Updates and fixes * Fixes from PR comments -renamed loginCredentials functions -added await to docker commands in image pull -cleanup * uncapitalize AzureRegistryNode * Refactoring, prod. * Flexible OSType * Estebanreyl/ready for production (#55) * began updating * Reorganized create registry and delete azure image * continued improvements * Began updating login * being credentials update * further updates * Finished updating, need to test functionality now * Updated requests, things all work now * Applied some nit fixes * Updates to naming * maintain UtilityManager standards * Updated Prompts * Updated imports and naming / standarized telemetry * Added explorer refresh capabilities on delete/add * Jackson/quick build dev (#46) * added acrbuild stuff * added acrbuild stuff * Update to match utility manager class * Added quick pick for selecting resource group and registry * clean * Added subscription support * utility bug fix * added folder select * Updates and fixes * Refactoring, prod. * Flexible OSType * added ID * Move build to azure commands * cleanup * Relative dockerfile support * Removed await, updating list in enumeration * fixed chdir * flexible ostype * Rutusamai/Show Build Task properties (#70) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * removed run build task stuff * cleanup * addressed esteban's comments * buildTask = context.task.name rather than label * fixes from Bin's comments * Merge branch 'dev' of https://github.com/AzureCR/vscode-docker into master4 * merge * missed small changes * Rutusamai/Run a Build Task (#71) * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show build task works through input bar * added run build task * Right click not working on BuildTaskNode. Works through command palette * quick fixes * quick fix to enable context menu on buildTaskNode * comamnd not sending via right click * working from right click now. trying to do show in json * Acquire properties in JSON format internally, works * Now shows organized task jsons on right click * import * to do * issues with getImagesByRepository * try catch build step * acrTools * small refactor * Show is working- final * run is working for right click * run build task works through command pallette. added success notification * removed show build task * cleanup- matched quickpick buils task and tasknode withshow build task branch * removed showTaskManager * spacing * outputChannel and null icon * merge to update with dev * Estebanreyl/build logs final (#72) * "Merge branch 'estebanreyl/buildlogsWithAccesibility' of https://github.com/AzureCR/vscode-docker into estebanreyl/buildlogsWithAccesibility" This reverts commit e645cbf, reversing changes made to fc4a477. * Refactored and organized log view into readable components. * moved storage * Began incorporating icons * Added icons * Further standarization * added logs * Added download log capabilities * Updated Copy * Updated inner div size alignment * Added resizing script * header sort by is only clickable on text now * fixed header table * Fix minor display issues * Identified filtering strategy * Begin adding sorting * Merge with dev * Added proper filtering * Nit loading improvements * Added accesibility, key only behaviour * accesibility retouches and enable right click from tasknode * merges * fix module name * Adds streaming and command standarization (ext.ui) (#73) * Adds streaming and command standarization (ext.ui) * removed unecessary append lines * small fixes * Fix merge issues * changes for ACR 3.0.0 (#80) * This commit contains changes necessary for the azure-arm-containerregistry 3.0.0 * Fixed PR feedback * Run task fixed. Issue ID: 79 * missing changes added * Fixing ACR run logs for Images * Sajaya/top1 (#83) * Query only 1 record for runs * View Azure logs * Refactoring build to run and buildTask to task * Removed filter for top (#88) * adding run yaml file * Refactoring to run task file. * fixing logs filter for images * Last Update time Fixed * Cleanup + refactoring delete image to untag image * Adding delete ACR Image (delete digest) * Changing text promt on right click to run ACR task file * Update settings.json * minor PR review fixes 1 * PR fixes 1 * Missed: change any to string * merge clean up * Schedule run code reduction + minor improvements * ACR request Improvements * Minor grammar fixes
As a note, this PR is meant to prepare for a PR to Microsoft/vscode docker, as a result, I will soon open a PR request to upstream with everything in here minus build task nodes.
@sajayantony , @northtyphoon any suggestions on how best to proceed would be appreciated, should we merge this in directly for further internal development and open a new PR for upstream by tomorrow?