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

Julia/delete image #29

Merged
merged 14 commits into from
Aug 4, 2018
Merged

Julia/delete image #29

merged 14 commits into from
Aug 4, 2018

Conversation

julialieberman
Copy link

Delete image is functioning! Will need to be rebased with delete repository. Fixes issue #13

@rsamai rsamai self-requested a review August 2, 2018 17:24
Copy link

@estebanreyl estebanreyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theres quite a few changes to be made, the azureCredentialsManager is for example cluttered with input specific functions which should be moved out to some form of unified user input. Additionally the Models/utils/azureUtils file has items that do not pertain to this file and should be moved out. Essentially some organizational changes have to be made before this PR goes through.

* @param context : if called through right click on AzureRepositoryNode, the node object will be passed in. See azureRegistryNodes.ts for more info
*/
export async function deleteAzureImage(context?: AzureImageNode): Promise<void> {
let azureAccount: AzureAccount;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stuff is unnecessary, use the unified clients check for login function instead

if (context) {
azureAccount = context.azureAccount;
} else {
azureAccount = await AzureCredentialsManager.getInstance().getAccount();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The azureAccount refers to the same instance of the same object, as such using the Azurecredentials manager's which works always is best. which further eliminates the checks below.

ignoreFocusOut: true,
placeHolder: 'No',
value: 'No',
prompt: 'Are you sure you want to delete this image? Enter Yes or No: '

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Are you sure you want to delete enter yes to continue' seems more desirable

let wholeName = repoName.split(':');
repoName = wholeName[0];
tag = wholeName[1];
} else { //this is separated from !context above so it only calls loginCredentials once user has assured they want to delete the image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is confusing and there is no reason to use context.userName, or context.password as these have been deprecated, instead always obtain login credentials from the AzureCredentialsManager.

public password?: string;
public username?: string;

constructor(azureAccount: AzureAccount, registry: Registry, repository: string, subscription:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to provide so many things to form a repository? Could you have a constructor find them using less parameters? For example the refresh token, access token, etc can be found. Also what is the use of username and password given refresh tokens?

* @param username : username for creating header
* @param password : password for creating header
*/
public _get_authorization_header(username: string, password: string): string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be public, additionally authorization header for? There can be many so make sure you scope this.


/**
*
* @param username : username for creating header

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its good to comment but these comments aren't helpful.


/**
* first encodes to base 64, and then to latin1. See online documentation to see typescript encoding capabilities
* see https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end for details {Buffers and Character Encodings}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to provide this documentation links here

* current character encodings include: ascii, utf8, utf16le, ucs2, base64, latin1, binary, hex. Version v6.4.0
* @param str : the string to encode for api URL purposes
*/
public encode(str: string): string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should definitely go in a separate utils class or be private.

* @param repository the repository to look in
* @returns an AzureImage object (see azureUtils.ts)
*/
public async getImage(repository: Repository): Promise<AzureImage> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to those below these are helpful commands that can be reused but don't fit the model of this class, alternatively names like quickPickACRImage would make the functionality clearer.

* @param registry : the registry whose repositories you want to see
* @returns allRepos : an array of Repository objects that exist within the given registry
*/
public async getAzureRepositories(registry: Registry): Promise<Repository[]> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getAzureRepositories [](start = 17, length = 20)

all the new functions added here are acr related. we need to put them to a different file.

return { 'refreshToken': refreshTokenARC, 'accessToken': accessTokenARC };
}
}
return { refreshToken, accessToken }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return { refreshToken, accessToken } [](start = 8, length = 36)

You should throw error instead of returning azure arm refresh and access token.


if (context) {
username = context.userName;
password = context.password;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the deletion operation still requires the admin is enabled on the registry? Can you use the access token you added in the pull request?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you can! that case is also handled

Copy link

@northtyphoon northtyphoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

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
@julialieberman
Copy link
Author

@northtyphoon @sajayantony @estebanreyl this is now the most updated version of delete image with subsequent edits. The new functions I put in azureCredentialsManager have been moved out into their own files. Let me know what you think! Shall I add delete Repository and delete registry to this branch as well?

Copy link

@estebanreyl estebanreyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highly improved organization there are some minor changes however that can be done for improvement

@@ -0,0 +1,59 @@
import { Registry } from "azure-arm-containerregistry/lib/models";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this file to a new folder under commands called azureCommands we are standardizing this way

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

*/
export async function deleteAzureImage(context?: AzureImageNode): Promise<void> {
if (!AzureCredentialsManager.getInstance().isLoggedIn()) {
vscode.window.showErrorMessage('You are not logged into Azure');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to stop execution if this happens (return)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

*/
export async function quickPickACRImage(repository: Repository): Promise<AzureImage> {
const repoImages: AzureImage[] = await acrTools.getImages(repository);
console.log(repoImages);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary logging

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

export async function quickPickACRImage(repository: Repository): Promise<AzureImage> {
const repoImages: AzureImage[] = await acrTools.getImages(repository);
console.log(repoImages);
let imageList: string[] = [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ImageListName seems more reasonable

for (let repo of myRepos) {
rep.push(repo.name);
}
let desiredRepo = await vscode.window.showQuickPick(rep, { 'canPickMany': false, 'placeHolder': 'Choose the repository from which your desired image exists' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use const when items are not changed

import { SubscriptionClient, ResourceManagementClient, SubscriptionModels } from 'azure-arm-resource';
import { AzureAccount } from '../typings/azure-account.api';
import { ServiceClientCredentials } from 'ms-rest';
import { AsyncPool } from '../utils/asyncpool';
import { ContainerRegistryManagementClient } from 'azure-arm-containerregistry';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would untrack changes to this file as they are all tslint updates which will come in once the azureCredentialsManager is merged into the Microsoft master branch

* @param registry gets the subscription for a given registry
* @returns a subscription object
*/
export function getSub(registry: Registry): SubscriptionModels.Subscription {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming for this function remains confusing as to what it actually does. Names should be self explanatory for functions.

* @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 request_data_from_registry(http_method: string, login_server: string, path: string, username: string, password: string): Promise<void> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case for method names

let response = await request.delete(opt);
} catch (error) {
err = true;
console.log(error);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually you would throw the error noting that the image update failed.

}
}, (err, httpResponse, body) => {
if (body.length > 0) {
accessTokenARC = JSON.parse(body).access_token;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existence of this and the following function with different names is rather confusing, can me use a single name and grant different parameters or differentiate them by how they acquire the token? Say acquireTokensWithLocalSession and acquireTokensWithRegistry?

username = creds.username;
password = creds.password;
let path = `/v2/_acr/${repoName}/tags/${tag}`;
await acrTools.request_data_from_registry('delete', registry.loginServer, path, username, password); //official call to delete the image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request_data_from_registry [](start = 19, length = 26)

The name is confusing as it claims to request data.
Can you rename it to send_request_to_registry?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

imageList.push(tempImage.tag);
}
let desiredImage = await vscode.window.showQuickPick(imageList, { 'canPickMany': false, 'placeHolder': 'Choose the image you want to delete' });
if (desiredImage === undefined) { return; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(desiredImage === undefined) [](start = 7, length = 28)

I think a simple way to do it is if (desiredImage), it will also handle null case

await request.get('https://' + registry.loginServer + '/v2/_catalog', {
auth: {
bearer: accessToken
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it use request_data_from_registry?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, request data from registry actually deletes something, and we don't want to delete anything here

Copy link

@northtyphoon northtyphoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I ask @msyihchen to double check the auth header used in acr quest.

@msyihchen
Copy link

In delete-azure-image.ts, the following code doesn't work in one scenario.
let creds = await acrTools.loginCredentials(subscription, registry);
username = creds.username;
password = creds.password;
let path = /v2/_acr/${repoName}/tags/${tag};
await acrTools.request_data_from_registry('delete', registry.loginServer, path, username, password)

When username is empty GUID and password is access, passing base64encoded "{GUID.Empty}:{AccessToken} as basic authorization header won't work. Instead, you should pass in the authorization header with "Bearer " + plaintext access token.

…sitory 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)
if (username === '00000000-0000-0000-0000-000000000000') {
auth = {
bearer: password
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function return string. I think you need to return

auth = Bearer {password}

@julialieberman julialieberman merged commit b80af87 into dev Aug 4, 2018
rsamai pushed a commit that referenced this pull request Aug 27, 2018
* 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

* Estebanreyl/dev merge fixes  (#43)

* Merge fixes to acquire latest telemetry items

* Updated to master AzureUtilityManager

* 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

* 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

* 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

* Remove build task features from this branch

This reverts commit 126c01e.

* Merge bugfixes and name specification

* updated weird naming issue

* Deleted deprecated telemetry, added copyright comment and updated quick picks

* Updated casing

* Updated resource group and registry validity checking and other nit fixes

* Updated Azure Utility Manager to by default sort registries alphabetically

* Updated azureRegistryNodes and registryRootNode to use shared functions

* Corrected resourcegroup name test

* added delete button when deleting an image

* Small changes in variables for better prompts and success notifications
@northtyphoon northtyphoon deleted the Julia/deleteImage branch September 13, 2018 22:28
rosanch pushed a commit that referenced this pull request Sep 21, 2018
* 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
rosanch pushed a commit that referenced this pull request Sep 22, 2018
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
rosanch added a commit that referenced this pull request Nov 9, 2018
* 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
estebanreyl pushed a commit that referenced this pull request Jul 26, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants