-
Notifications
You must be signed in to change notification settings - Fork 33
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
Serialization of HTML Comments #18
Comments
! action has an uncaught error |
For context, this comment has the following metadata embedded, which only repository admins can technically see. {
"handlerType": {
"type": "post",
"actions": [
null
]
},
"activeHandler": "onLabelChangeSetPricing",
"error": {
"name": "HttpError",
"status": 422,
"response": {
"url": "https://api.github.com/repos/ubiquibot/comment-incentives/labels",
"status": 422,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"content-length": "182",
"content-security-policy": "default-src 'none'",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 13 Feb 2024 13:31:03 GMT",
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"server": "GitHub.com",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
"vary": "Accept-Encoding, Accept, X-Requested-With",
"x-accepted-github-permissions": "issues=write; pull_requests=write",
"x-content-type-options": "nosniff",
"x-frame-options": "deny",
"x-github-api-version-selected": "2022-11-28",
"x-github-media-type": "github.v3; format=json",
"x-github-request-id": "84C4:3D93:19D0499:34192E1:65CB6F17",
"x-ratelimit-limit": "5000",
"x-ratelimit-remaining": "4818",
"x-ratelimit-reset": "1707831648",
"x-ratelimit-resource": "core",
"x-ratelimit-used": "182",
"x-xss-protection": "0"
},
"data": {
"message": "Validation Failed",
"errors": [
{
"resource": "Label",
"code": "already_exists",
"field": "name"
}
],
"documentation_url": "https://docs.github.com/rest/issues/labels#create-a-label"
}
},
"request": {
"method": "POST",
"url": "https://api.github.com/repos/ubiquibot/comment-incentives/labels",
"headers": {
"accept": "application/vnd.github.v3+json",
"user-agent": "probot/12.3.3 octokit-core.js/3.6.0 Node.js/20.11.0 (linux; x64)",
"authorization": "token [REDACTED]",
"content-type": "application/json; charset=utf-8"
},
"body": "{\"name\":\"Price: 25 USD\",\"color\":\"1f883d\"}",
"request": {}
}
},
"caller": "renderCatchAll",
"revision": null
}
|
@pavlovcik The issue was in ubiquity/devpool-directory-tasks#14 (comment) correct? Could you put back the comment that breaks for testing? |
Unfortunately I deleted it and I can't undelete. I realized my mistake only after filing this issue. We MAY be able to recover the original comment from the GitHub Actions logs but would need to sift through and compare timestamps. |
No way you could recreate something similar? I am not sure how to create the test case currently |
I think it is one of these successful runs from "3 days ago". Let me investigate first. I can recreate simply by re-running the action which would be the best way anyways.
@FernandVEYRIER would you like me to re-run both or are you able to extract the information that you need from there? I just realized that the plugin live processes the latest comment information in the conversation. Given that I deleted the offending comment it would not process it again. I can't remember off hand exactly how I produced the offending comment unfortunately. I tried looking through logs and commit histories but I can't figure out exactly what the offending comment was. As a consequence I don't know what to do to set it up again. I guess you can just make up something and prove that html comments are filtered out if they are quote commented. Perhaps try a "quote reply" to a bot comment with some metadata inside. |
I am pretty sure I ended up fixing this by no longer logging out the offending metadata ubiquibot/comment-incentives#23 Update: my fix just makes the issue less likely to occur but it is not a solution. |
# Issue was not closed as completed. Skipping.
}, |
lol the irony |
! action has an uncaught error |
/start |
Tips:
|
@pavlovcik If I recall correctly you said you've been rewriting that whole thing, is it still relevant? |
I got saturated rewriting the conversation incentives module first. I didn't get a chance to finish. https://github.com/ubiquibot/conversation-rewards The next module would be permit generation. The final module would be the comment generation. So basically this would consume the output of the permit generation module. That would essentially just be an array of permits. Feel free to start making that module from scratch? |
So I believe we shall close this issue then. |
I haven't figured out the architecture to be honest. I think it makes sense that the conversation incentives indeed handles all that calculation but I'm unsure about how to pass it THROUGH rfc @whilefoo Ideally if the kernel can store output information from each module. Then a future module can request a specific property from all of the outputs so far. I think we can take inspiration from how GitHub Actions already implemented this. We specify an output in the config and then pass it in directly from the config into the plugin. Either way @FernandVEYRIER I think there's plenty of ground work to lay out before we figure out these "external-to-plugin" details |
In the current implementation the
I do like this idea, for example something like this: - name: "Comment incentives"
uses:
- id: conversation-incentives
plugin: ubiquibot/conversation-incentives
with:
...
- id: permit-generation
plugin: ubiquibot/permit-generation
with:
calculation: {{ conversation-incentives.outputs.calculation }}
...
- plugin: ubiquibot/permit-comment
with:
permits: {{ permit-generation.outputs.permits }}
calculation: {{ conversation-incentives.outputs.calculation }} |
@whilefoo Looks neat indeed, Now the question would be how to ensure that the formats are compatible between each step to pass down the data efficiently. |
In GitHub actions it isn't necessary to worry about compatibility within the intermediary modules. You essentially direct the output precisely wherever it's needed. So all the outputs would, in a sense, stay in the memory of the kernel. |
/stop |
+ You have been unassigned from the task |
Will move this to the https://github.com/ubiquibot/conversation-rewards repo since it is no more relevant here. |
Hello from the worker! |
/start |
! No price label is set, so this is not ready to be self assigned yet. |
/start |
Tips:
|
+ Evaluating results. Please wait... |
|
View | Contribution | Count | Reward |
---|---|---|---|
Issue | Specification | 1 | 72.2 |
Issue | Comment | 9 | 615 |
Conversation Incentives
Comment | Formatting | Relevance | Reward |
---|---|---|---|
# HTML Comment SerializationWhenever the bot needs to repost... | 72.2h1: count: 1 score: "1" words: 3 h3: count: 3 score: "3" words: 5 a: count: 1 score: "1" words: 2 li: count: 4 score: "4" words: 28 code: count: 3 score: "3" words: 4 | 1 | 72.2 |
> ```diff > ! action has an uncaught error > ```For contex... | 61.8code: count: 2 score: "2" words: 0 | - | 61.8 |
Unfortunately I deleted it and I can't undelete. I realized my m... | 9.2a: count: 1 score: "1" words: 3 | - | 9.2 |
I think it is one of these successful runs from "3 days ago". Le... | 41.6li: count: 2 score: "2" words: 22 hr: count: 2 score: "2" words: 0 | - | 41.6 |
I am pretty sure I ended up fixing this by no longer logging out... | 9.4hr: count: 1 score: "1" words: 0 | - | 9.4 |
lol the irony... | 0.6 | - | 0.6 |
Looks like it broke on the triple back tick from within the comm... | 442code: count: 2 score: "2" words: 0 | - | 442 |
I got saturated rewriting the conversation incentives module fir... | 13.6 | - | 13.6 |
I haven't figured out the architecture to be honest. I think it ... | 28.8code: count: 2 score: "2" words: 4 hr: count: 1 score: "1" words: 0 | - | 28.8 |
> @whilefoo Looks neat indeed, Now the question would be how to ... | 8 | - | 8 |
[ 129.9 WXDAI ]
@gentlementlegen
Contributions Overview
View | Contribution | Count | Reward |
---|---|---|---|
Issue | Task | 1 | 100 |
Issue | Comment | 6 | 0 |
Issue | Comment | 6 | 14.9 |
Review | Comment | 1 | 7.5 |
Review | Comment | 1 | 7.5 |
Conversation Incentives
Comment | Formatting | Relevance | Reward |
---|---|---|---|
@pavlovcik The issue was in https://github.com/ubiquity/devpool-... | - | - | - |
No way you could recreate something similar? I am not sure how t... | - | - | - |
@pavlovcik If I recall correctly you said you've been rewriting ... | - | - | - |
So I believe we shall close this issue then. And the comment ge... | - | - | - |
@whilefoo Looks neat indeed, Now the question would be how to en... | - | - | - |
Will move this to the https://github.com/ubiquibot/conversation-... | - | - | - |
@pavlovcik The issue was in https://github.com/ubiquity/devpool-... | 2.7 | - | 2.7 |
No way you could recreate something similar? I am not sure how t... | 1.8 | - | 1.8 |
@pavlovcik If I recall correctly you said you've been rewriting ... | 1.8 | - | 1.8 |
So I believe we shall close this issue then. And the comment ge... | 4.1 | - | 4.1 |
@whilefoo Looks neat indeed, Now the question would be how to en... | 2.6 | - | 2.6 |
Will move this to the https://github.com/ubiquibot/conversation-... | 1.9 | - | 1.9 |
Added tests to make sure the serialization for complex comments ... | 7.5a: count: 2 score: "2" words: 4 | 0.83 | 7.5 |
Added tests to make sure the serialization for complex comments ... | 7.5a: count: 2 score: "2" words: 4 | 0.83 | 7.5 |
[ 10.3 WXDAI ]
@whilefoo
Contributions Overview
View | Contribution | Count | Reward |
---|---|---|---|
Issue | Comment | 1 | 10.3 |
Conversation Incentives
Comment | Formatting | Relevance | Reward |
---|---|---|---|
In the current implementation the `permit generation` plugin wou... | 10.3code: count: 3 score: "3" words: 4 | - | 10.3 |
Lol my comment reward 👀 |
@0x4007 The king of copy pasta. I checked the logs actually ChatGpt broke on the comment because it was too long but since relevance is not applied anyway you got the full reward haha |
I don't plan to claim it. Or perhaps claim and return 442 |
HTML Comment Serialization
Whenever the bot needs to repost a comment, its serialization of the html and markdown comment syntax is unhandled, leading to situations like this comment.)
Ensure that the bot can properly handle these embedded metadata comments in the conversation rewards table (it displays a preview of every comment body)
Solution
Ideally we can use a library or some built in methods but in case those are not available.
<!-- -->
:ChatGPT:
Further Examples
Check out gitcoindev's conversation incentives: ubiquity/ubiquibot#665 (comment)
Original Specification
When generating the payment permits, the bot includes a table for "conversation rewards" with details around how the conversation rewards were calculated.
However, I quoted a bot comment, which included the JSON metadata that the bot embeds inside of an HTML comment
<!-- {} -->
inside of its GitHub comment.When generating the conversation rewards table, the rendering broke because it doesn't know how to deal with HTML comments. It dumped the full JSON object into the comment incentives calculation table, which looked very wrong.
It should filter any HTML that is commented out so that it does not break the "comment incentives" table.
Unfortunately I deleted the offending comment from the back-linked conversation, but I hope that this description makes sense.
Originally posted by @pavlovcik in ubiquity/devpool-directory-tasks#14 (comment)
The text was updated successfully, but these errors were encountered: