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

Added environment link and describe dump for supportablity #12038

Merged
merged 13 commits into from
Jan 7, 2020

Conversation

shigupt202
Copy link
Contributor

Added environment link and describe dump for supportablity

Comment on lines +165 to +167
requestUrl = tl.getVariable('System.TeamFoundationCollectionUri') + tl.getVariable('System.TeamProject') + '/_environments/' + tl.getVariable('Environment.Id');
const resourceId = tl.getVariable('Environment.ResourceId');
requestUrl = resourceId ? requestUrl + '/providers/kubernetes/' + resourceId : requestUrl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be done at server side? Where you dump a variable called Environment.ResourceUrl or something like that?

@vithati thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

We can do that enhancement later.

}
}
}

utils.checkForErrors(rolloutStatusResults);
if (rolloutStatusHasErrors) {
throw new Error('Rollout status check failed.');
Copy link
Contributor

Choose a reason for hiding this comment

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

this message should come from task.json

} else {
kubectl.describe(KubernetesConstants.KubernetesWorkload.pod, podName);
if (environmentUrl)
console.log('For more information go to ' + environmentUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should come from task.json too

}
break;
case 'Pending':
if (!isPodReady(podStatus)) {
tl.warning(`pod/${podName} rollout status check timedout`);
kubectl.describe(KubernetesConstants.KubernetesWorkload.pod, podName);
if (environmentUrl)
console.log('For more information go to ' + environmentUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

Every message shown to user should come from task.json.
If it's a debug statement you can skip it. This would end up raising localization errors later on otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I'll change that

}
break;
case 'Failed':
tl.error(`pod/${podName} rollout failed`);
kubectl.describe(KubernetesConstants.KubernetesWorkload.pod, podName);
if (environmentUrl)
console.log('For more information go to ' + environmentUrl);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

utils.checkForErrors([result]);
} catch (ex) {
tl.error(ex);
kubectl.describe(resource.type, resource.name);
Copy link
Member

Choose a reason for hiding this comment

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

Move this to private function and use other places.

Comment on lines +165 to +167
requestUrl = tl.getVariable('System.TeamFoundationCollectionUri') + tl.getVariable('System.TeamProject') + '/_environments/' + tl.getVariable('Environment.Id');
const resourceId = tl.getVariable('Environment.ResourceId');
requestUrl = resourceId ? requestUrl + '/providers/kubernetes/' + resourceId : requestUrl;
Copy link
Member

Choose a reason for hiding this comment

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

We can do that enhancement later.

@shigupt202 shigupt202 merged commit dcae2fa into master Jan 7, 2020
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