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

[wip] az feedback #8829

Merged
merged 13 commits into from
Apr 4, 2019
Merged

[wip] az feedback #8829

merged 13 commits into from
Apr 4, 2019

Conversation

adewaleo
Copy link
Contributor

@adewaleo adewaleo commented Mar 20, 2019

az feedback now:

  • directs users to helpful links
  • shows last 9 commands
  • prompts user to create an issue template based on selected command
  • directs user to core repo or extensions repo based on command

Todo:

  • Update az login webpage to contain getting started links / commands.
  • Properly handle showing feedback commands (possibly duplicate commands). For now, we simply don't add az feedback to the list of recent commands.

closes #2048


This checklist is used to make sure that common guidelines for a pull request are followed.

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@adewaleo adewaleo added this to the Sprint 58 milestone Mar 26, 2019
@adewaleo adewaleo force-pushed the az-feedback-update branch 3 times, most recently from 2a9c14c to 43e0265 Compare March 26, 2019 16:05
@adewaleo adewaleo requested review from samkreter and removed request for samkreter March 26, 2019 19:37
@adewaleo
Copy link
Contributor Author

Please feel free to review away!

cc: @tjprescott, @yugangw-msft, @achandmsft.

@adewaleo
Copy link
Contributor Author

ping! (for review)
Also not sure why the Azure Pipelines test is failing
CC: @yugangw-msft @tjprescott @marstr

'azure-mgmt-resource==2.1.0'
'azure-mgmt-resource==2.1.0',
'pyperclip==1.7.0',
'psutil==5.6.1'
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this dependency is causing our ADO check to fail. I suspect that this dependency isn't playing nice inside of alpine.

@@ -72,7 +72,9 @@
'six',
'tabulate>=0.7.7',
'wheel',
'azure-mgmt-resource==2.1.0'
'azure-mgmt-resource==2.1.0',
Copy link
Member

Choose a reason for hiding this comment

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

In general, our setup.py files should contain a range of acceptable versions, instead of one pinned version. Not doing this causes issues like #6973.

Copy link
Contributor Author

@adewaleo adewaleo Mar 29, 2019

Choose a reason for hiding this comment

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

makes sense!

src/azure-cli-core/azure/cli/core/util.py Outdated Show resolved Hide resolved
Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

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

Privacy is my primary concern with this, but there are others as well.



UNKNOWN_COMMAND = "unknown_command"
CMD_LOG_LINE_PREFIX = "CMD-LOG-LINE-BEGIN"
Copy link
Member

Choose a reason for hiding this comment

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

These should not be public.

@@ -4,7 +4,7 @@ about: Create a report to help us improve

---

**Describe the bug**
q**Describe the bug**
Copy link
Member

Choose a reason for hiding this comment

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

q?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I noticed this too, its a typo, mistake, will update it with my next round of changes.

try:
os.remove(os.path.join(log_dir, file))
except OSError: # FileNotFoundError introduced in Python 3
continue
Copy link
Member

Choose a reason for hiding this comment

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

So this... keeps the number of files between 5 and 25?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

keeps files between 0 and 20 / 25. I could rename the variable to clarify that the files are in reverse order. I wanted to make removing the files an infrequent operation that removes a bulk of unnecessary commands. Maybe I could fine tune this.

Copy link
Member

Choose a reason for hiding this comment

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

Add comments so we understand the logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tjprescott, you were right, there was a bug. I have fixed it.

issue_url = "https://aka.ms/azcli/ext/issues" if is_extension else "https://aka.ms/azcli/issues"
logger.error("The command failed with an unexpected error. Here is the traceback:\n")
logger.exception(ex)
logger.warning("\nTo open an issue, please visit: %s", issue_url)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we direct people to use az feedback here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We most definitely should!

@@ -43,9 +45,21 @@ def cli_main(cli, args):
else:
telemetry.set_success()

elapsed_time = timeit.default_timer() - start_time
Copy link
Member

Choose a reason for hiding this comment

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

Why do we log the time for each command? I worry this may attract more perf related issues being raised.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was brought up in the meeting with @yugangw-msft and @achandmsft. I think the rational was to help customers notice / point out situations were commands are much slower than usual. I suppose we just saw it as general command related information.

If perf really is a problem (esp. on the CLI side) moving forward then I think it doesn't hurt to give customers and ourselves more clarity regarding it. If it really is a problem then we eventually have to address it.

I guess we could discuss this more when I am back from the conference.


_ISSUES_TEMPLATE = """

### **This autogenerated template contains command parameters. Please review and remove sensitive information, if necessary**
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we simply remove the values and replace them with placeholders? This is the kind of thing we do not want to screw up. As soon as someone DOESN'T read this and posts sensitive information (which would take all of oh... 1 week?) we have a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is a tough / nuanced decision to make. On the one hand, we risk customer security by showing command arguments in the output by default, but this would often contain very helpful information.

I suppose place holders could be the happy medium. I can make this change then.

cc: @yugangw-msft @achandmsft

Copy link
Member

Choose a reason for hiding this comment

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

Well, it would be helpful to have all the data in telemetry as well... problem is, that would be illegal. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough, lol. I will confirm with team and go ahead to replace with placeholders after scrum...



**Command Duration**
{command_duration}
Copy link
Member

Choose a reason for hiding this comment

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

Why is this useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just metadata about the command which could possible be useful. I suppose it doesn't hurt.

cc: @yugangw-msft @achandmsft

`{command_name}`

**Ran:**
`{executed_command}`
Copy link
Member

Choose a reason for hiding this comment

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

It is safer to put sanitized values here and invite the user to put actual values than vice-versa. @JasonRShaver @yugangw-msft you know more about the risks here as they are largely the same as the risks involved with telemetry.

{errors_string}

## To Reproduce:

Copy link
Member

Choose a reason for hiding this comment

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

It seems like "Ran" from above could be combined here. At a minimum, the command they ran is the last step of the repro...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was the goal, but @yugangw-msft suggested moving "ran..." up near the top of the issue so users are less likely to post the issue without checking the command's arguments for sensitive info.

However, if we go with the placeholder approach, then I could move this command info back down to this section..

{cli_version}

## Additional context
Add any other context about the problem here.
Copy link
Member

Choose a reason for hiding this comment

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

I would move all the stuff they would be expected to fill in manually to the top of the auto-gen template. Otherwise they will simply expect that everything is pre-filled for them.

Oluwatosin Adewale added 8 commits April 2, 2019 15:08
…his metadata.

Command duration and time since last run now properly shown.

Print format updates. Minor bug fixes.

Prompt user for issue they want info on. Fix bugs.

changes with browser

Skip feedback commands. Browser open works. Verbose shows issue template.

Refactored code, although printing and time logic seems to be incorrect.
Delete last 5 commands if number of cached commands exceeds 25.

Address more style issues.

style fixes

Move feedback test to correct location.

More style fixes.
More style fixes. Fix python 2 error.
…. Minor updates.

Fix bug where command_data_dict could be None.
logger.error("The command failed with an unexpected error. Here is the traceback:\n")
logger.exception(ex)
logger.warning("\nTo open an issue, please visit: %s", issue_url)
if isinstance(ex, (CLIError, CloudError)):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this section should be exactly the same, except that we use the command logger context and we no longer print the issues url but direct users to use az feedback.

@@ -34,7 +34,7 @@ LABEL maintainer="Microsoft" \
# pip wheel - required for CLI packaging
# jmespath-terminal - we include jpterm as a useful tool
RUN apk add --no-cache bash openssh ca-certificates jq curl openssl git zip \
&& apk add --no-cache --virtual .build-deps gcc make openssl-dev libffi-dev musl-dev \
&& apk add --no-cache --virtual .build-deps gcc make openssl-dev libffi-dev musl-dev linux-headers \
Copy link
Member

Choose a reason for hiding this comment

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

Could you point me to where you found this secret-sauce? It looks promising (seeing as we haven't historically been too sensitive to image size) but I want to make sure that I understand the consequences of adding this dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marstr, this is the github issue / comment that helped me out.

@tjprescott
Copy link
Member

@marstr ping.

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

3 participants