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

Pip and Twine Auth tasks V1 #11026

Merged
merged 14 commits into from
Aug 2, 2019
Merged

Pip and Twine Auth tasks V1 #11026

merged 14 commits into from
Aug 2, 2019

Conversation

shubham90
Copy link
Member

No description provided.

@shubham90 shubham90 changed the title Users/shbhawsi/pipv1 Pip and Twine Auth tasks V1 Jul 30, 2019
}

export async function getInternalAuthInfoArray(inputKey: string): Promise<AuthInfo[]> {
let internalAuthArray: AuthInfo[] = [];
Copy link
Member Author

Choose a reason for hiding this comment

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

This code should also go away after merging with artifacts-common

Copy link
Member Author

Choose a reason for hiding this comment

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

waiting for merge from Aasim's commit

@shubham90 shubham90 requested review from jotaylo and zarenner July 30, 2019 00:33
{
"common": [
{
"module": "../Common/utility-common",
Copy link
Contributor

Choose a reason for hiding this comment

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

can you switch to using utility-common-v2 instead (which uses azure-pipelines-task-lib instead of vsts-task-lib)

{
"common": [
{
"module": "../Common/utility-common",
Copy link
Contributor

Choose a reason for hiding this comment

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

utility-common-v2 here too

Copy link
Member Author

Choose a reason for hiding this comment

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

@zarenner and I were talking about this yesterday. The only thing we use utility-common is for telemetry. Zach was going to look for options to remove this dependency altogether. However, he did say that utility-common-v2 has some very specific code from some other team, so not sure if it's worth taking dependency on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I just see that @zarenner is adding it to the new shared lib, that'll do the trick.


telemetry.emitTelemetry("Packaging", "PipAuthenticate", pipAuthenticateTelemetry);
} catch (err) {
tl.debug(`Unable to log Pip Authenticate task init telemetry. Err:( ${err} )`);
Copy link
Contributor

@zarenner zarenner Aug 1, 2019

Choose a reason for hiding this comment

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

I think this is effectively unreachable - emitTelemetry has its own try/catch.

@shubham90 shubham90 requested a review from zjrunner as a code owner August 2, 2019 00:32
@@ -0,0 +1,21 @@
import * as tl from 'azure-pipelines-task-lib/task';

export function getProjectAndFeedIdFromInputParam(inputParam: string): any {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used?

Copy link
Member Author

Choose a reason for hiding this comment

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

not used currently, but kept it anyway when copying from packaging-common.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd remove it, personally. It doesn't do much, and IMO it's more clear when inputs are read from within the task itself when reasonable to do so.

return getProjectAndFeedIdFromInput(feedProject);
}

export function getProjectAndFeedIdFromInput(feedProject: string): any {
Copy link
Contributor

@zarenner zarenner Aug 2, 2019

Choose a reason for hiding this comment

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

Create an interface for { feedId:string, projectId: string}? e.g. ProjectScopedFeed

And possibly rename function based on that (or at least remove "FromInput" which doesn't really convey anything)?

* @param feedId FeedId to put in api params
* @param project projectId to put in api params
*/
export async function getPackagingEndpointUrl(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest rename to "getPackagingRouteUrl" or something like that.
Also, this function assumes that the only route parameters that need to be filled are feedId and project, so if a route has other inputs this will return a route template rather than a route I think? Should make that clear and possibly allow specifying additional route values.

Copy link
Member Author

Choose a reason for hiding this comment

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

cool, I thought we won't need any other params in auth tasks. But, I can add an optional dictionary here.

Copy link
Contributor

Choose a reason for hiding this comment

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

A short comment explaining the above would be fine instead of implementing it now.
e.g. this function wouldn't work for routes that have {packageName}, {packageVersion}, etc if we ever needed to get one of those.

Copy link
Member Author

Choose a reason for hiding this comment

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

cool, will do. thanks!

feedId: string,
project: string): Promise<string> {

tl.debug('Finding the URI for the packaging service');
Copy link
Contributor

Choose a reason for hiding this comment

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

Update debug message

const webApi = api.getWebApiWithProxy(serviceUri, accessToken);
const data = await webApi.vsoClient.getVersioningData(apiVersion, protocols.ProtocolType[protocolType], locationGuid, { feedId: feedId, project: project });

tl.debug('Feed registry url: ' + data.requestUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

"Feed registry url" doesn't really accurately describe what this returns. Perhaps something like "Resolved route: "

@shubham90 shubham90 merged commit 3196bda into master Aug 2, 2019
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.

3 participants