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

Adjust yoda-webhook to work better with github.com (cloud) vs GHE #27

Closed
jens-markussen opened this issue Jun 1, 2023 · 4 comments
Closed

Comments

@jens-markussen
Copy link
Contributor

jens-markussen commented Jun 1, 2023

It seems there have been some recent advances on github.com concerning rendering of issue links. The rendering now seems to include both the issue title as well as the issues status (tick mark if done).

Those informations are already put by yoda-webhook mechanism directly and so things are sort of doubled.

To see the effect of the rendering, check out

image

@jens-markussen
Copy link
Contributor Author

And the full effect of this

image

@jens-markussen
Copy link
Contributor Author

Actually it seems that this "extra good rendering" happens only when issues are shown in some kind of list (like in a > contains block). It is not enabled e.g. for > partof #2

@jens-markussen
Copy link
Contributor Author

jens-markussen commented Jun 1, 2023

Suggested fix could be

--- a/nodejs/yoda-webhook/yoda-utils.js
+++ b/nodejs/yoda-webhook/yoda-utils.js
@@ -319,13 +319,13 @@ function makeChildBlock(ownRef, childIssues) {
                        if (issueRefs[i].issue == null) {
                                refLine = refLine + "- [ ] " + shortRef + " **Unable to get issue details - non-existing issue/access right problem?**";
                        } else {
-                               refLine += "- [";
+                               refLine += "- ";

                                if (issueRefs[i].issue.state == "closed") {
-                                       refLine += "x] ";
+//                                     refLine += "[x] ";
                                        totalClosed++;
                                } else {
-                                       refLine += " ] ";
+//                                     refLine += "[ ] ";
                                        totalOpen++;
                                }
                                refLine += shortRef;
@@ -346,7 +346,7 @@ function makeChildBlock(ownRef, childIssues) {
                                if (estimate != 0)
                                        refLine += " (" +  estimate + " / " + remaining + ")";

-                               refLine += " *" + issueRefs[i].issue.title.trim() + "*";
+                               // refLine += " *" + issueRefs[i].issue.title.trim() + "*";
                        }
                        logger.debug("refline: '" + refLine + "'");
                        issueRefs[i].refLine = refLine;

Then there is the question is worth making backwards compatible.

@jens-markussen
Copy link
Contributor Author

To make it absolutely clear. See below text in edit and preview mode:

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant