You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helper function to get a link to the GitHub feedback form.
54
-
For simple usage, it should be enough to call
55
-
`feedback_link(user_info(), github_user="MY_USER_OR_ORG_ON_GITHUB")`, so long as the package you
56
-
want to provide feedback on exists on GitHub and you are running from an "installed" (not playground)
57
-
link.
53
+
Constructs a URL that when visited will open the feedback interview with the correct context, including
54
+
the destination repository for the feedback and information about the user's current position in the interview.
55
+
56
+
The feedback interview needs to know the URL to the github repository where the feedback will be made, and
57
+
uses a few alternative methods to determine the two components of that url - the owner of the repository and the name of the repository.
58
+
For example, suppose you want to see the issues when you visit https://github.com/suffolklitlab/docassemble-AssemblyLine/issues:
59
+
60
+
To determine the feedback destination repository's name, e.g., docassemble-AssemblyLine:
61
+
62
+
1. It tries using the output of current_context() (formerly user_info()), if passed as the user_info_object parameter,
63
+
to retrieve the package's name. It also tries to get the variable, question_id,
64
+
filename, and session ID from the user_info_object. Note if you want to test the feedback from during development, the package name is not available
65
+
when running from the playground.
66
+
2. It uses the value of the github_repo parameter.
67
+
3. It defaults to the demo repository on the suffolklitlab-issues organization.
68
+
69
+
To determine the feedback destination repository's owner, e.g., suffolklitlab:
70
+
71
+
1. It uses the value of the github_user parameter.
72
+
2. It tries to get the default repository owner from the Docassemble config, at github issues: default repository owner.
73
+
3. It defaults to suffolklitlab-issues.
74
+
75
+
The variable, question_id, package_version, and filename parameters can also be passed in manually rather than retrieved from the
76
+
user_info_object parameter.
77
+
78
+
Args:
79
+
user_info_object (str, optional): the output of the current_context() function, which might contain enough information to create the link.
80
+
(Name is historical as the current_context() function replaces the former user_info() function)
81
+
i (str, optional): path to the feedback interview file, e.g., docassemble.GithubFeedbackForm:feedback.yml
82
+
github_repo (str, optional): GitHub repository name where issue feedback will be made. E.g, docassemble-AssemblyLine
83
+
github_user (str, optional): GitHub user or organization name where issue feedback will be made. E.g, suffolklitlab
84
+
variable (str, optional): the variable name that the feedback is about
85
+
question_id (str, optional): the question ID that the feedback is about
86
+
package_version (str, optional): the version of the package that the feedback is about
87
+
filename (str, optional): the YAML interview filename that the feedback is about
88
+
89
+
Returns:
90
+
str: a URL to the feedback form that includes the public URL parameters for the feedback interview
91
+
92
+
Example:
93
+
feedback_link(current_context(), i="docassemble.GithubFeedbackForm:feedback.yml") # github_user is taken from the config and github_repo inferred from output of current_context()
94
+
95
+
The package name isn't available from the user_info_object when you run from the playground, so it is better to pass in the github_repo parameter manually
0 commit comments