-
-
Notifications
You must be signed in to change notification settings - Fork 40
Add author to issue body #522
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
Conversation
Reviewer's Guide by SourceryThis pull request adds the author's name to the issue body when creating a new issue using the bot. The change is implemented in the File-Level Changes
Tips
|
|
we are sooooo back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Atmois - I've reviewed your changes - here's some feedback:
Overall Comments:
- Could you provide more details on how this change was tested? A brief description of the test cases or scenarios you used would be helpful.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
|
|
||
| try: | ||
| created_issue = await self.github.create_issue(title, body) | ||
| issue_body = body + "\n\nAuthor: " + str(ctx.author) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider using a more structured approach for adding author information
Instead of appending the author information directly to the body, consider using GitHub's API to set it as a custom field or label if possible. Alternatively, you could add a structured metadata section at the end of the body, which would be easier to parse programmatically if needed.
| issue_body = body + "\n\nAuthor: " + str(ctx.author) | |
| metadata = { | |
| "Author": str(ctx.author), | |
| "Created-By": "Discord Bot" | |
| } | |
| metadata_str = "\n".join(f"{k}: {v}" for k, v in metadata.items()) | |
| issue_body = f"{body}\n\n---\n{metadata_str}" |
| embed.add_field(name="Body", value=body, inline=False) | ||
| embed.add_field(name="Body", value=issue_body, inline=False) | ||
|
|
||
| except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Add error logging for better debugging and monitoring
Before sending the error message to the user, consider adding proper error logging. This will help with debugging and monitoring the application's behavior.
| except Exception as e: | |
| except Exception as e: | |
| logging.error(f"Error creating issue: {e}", exc_info=True) |
Description
Add author to issue body
Type of Change
Guidelines
My code follows the style guidelines of this project (formatted with Ruff)
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation if needed
My changes generate no new warnings
I have tested this change
Any dependent changes have been merged and published in downstream modules
I have followed all of these guidelines.
How Has This Been Tested? (if applicable)
yes, it works
Screenshots (if applicable)
Additional Information
fixes #494