-
Notifications
You must be signed in to change notification settings - Fork 94
Minor: commits in draft PRs #218
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
Signed-off-by: Vedansh Saini <[email protected]>
Reviewer's GuideThis PR enables displaying commit details for existing draft pull requests under the “Show commits” toggle by injecting a nested commits list, updates the UI label and all translations to reflect that drafts are included, and removes an obsolete comment from the PR date-range logic. Sequence diagram for displaying commits in draft PRssequenceDiagram
actor User
participant UI
participant scrumHelper
participant GitHubAPI
User->>UI: Toggle 'Show commits' option
UI->>scrumHelper: Request PR list with commits
scrumHelper->>GitHubAPI: Fetch PRs and their commits
GitHubAPI-->>scrumHelper: Return PRs (open and draft) with commits
scrumHelper-->>UI: Render PR list
UI-->>User: Display PRs with nested commits for open and draft PRs
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Signed-off-by: Vedansh Saini <[email protected]>
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 @vedansh-5 - I've reviewed your changes and found some issues that need to be addressed.
- Rendering commit items as direct
- children of another
- breaks HTML semantics—consider wrapping them in a nested
- or similar container inside the parent list item.
- The inline style attributes on each commit entry could be replaced with CSS classes for better maintainability and theming.
- Rather than unconditionally calling log(), guard the debug logging behind a log level check or remove it in production to avoid console noise.
Prompt for AI Agents
Please address the comments from this code review: ## Overall Comments - Rendering commit items as direct <li> children of another <li> breaks HTML semantics—consider wrapping them in a nested <ul> or similar container inside the parent list item. - The inline style attributes on each commit entry could be replaced with CSS classes for better maintainability and theming. - Rather than unconditionally calling log(), guard the debug logging behind a log level check or remove it in production to avoid console noise.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Signed-off-by: Vedansh Saini <[email protected]>
@hpdang Ready for review, thankyou. |
LGTM! @Saksham-Sirohi could you please test this if it works for you? @Preeti9764 please review |
@hpdang tested works! |
Can the commits be more indented next to an open pr? This feels like very little indentation for commits inside |
![]() |
Signed-off-by: Vedansh Saini <[email protected]>
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 @vedansh-5 - I've reviewed your changes - here's some feedback:
- Extract the commit-list markup into a helper (or use Array.map + join) to simplify string concatenation and improve readability.
- Replace inline styles on the commit list items with CSS classes in your stylesheet for better maintainability.
- Remove or guard the debug console.log to avoid polluting production logs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Extract the commit-list markup into a helper (or use Array.map + join) to simplify string concatenation and improve readability.
- Replace inline styles on the commit list items with CSS classes in your stylesheet for better maintainability.
- Remove or guard the debug console.log to avoid polluting production logs.
## Individual Comments
### Comment 1
<location> `src/scripts/scrumHelper.js:1281` </location>
<code_context>
- li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a>${showOpenLabel ? ' ' + pr_draft_button : ''}</li>`;
+ li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a>${showOpenLabel ? ' ' + pr_draft_button : ''}`;
+ if (showCommits && item._allCommits && item._allCommits.length && !isNewPR) {
+ log(`[PR DEBUG] Rendering commits for existing draft PR #${number}:`, item._allCommits);
+ li += '<ul>';
+ item._allCommits.forEach(commit => {
</code_context>
<issue_to_address>
Debug logging is present in production code.
Debug logs in production can clutter output and expose sensitive data. Remove this log or restrict it to debug mode if not essential for users.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
log(`[PR DEBUG] Rendering commits for existing draft PR #${number}:`, item._allCommits);
li += '<ul>';
=======
li += '<ul>';
>>>>>>> REPLACE
</suggested_fix>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@vedansh-5 The preview report is not getting generated without the token .Please check .Thanks! |
@vedansh-5, the draft commits now have good indentation also, I am seeing the same problem as @Preeti9764, without github token, I receive error 422 |
works properly now!
|
Signed-off-by: Vedansh Saini <[email protected]>
Signed-off-by: Vedansh Saini <[email protected]>
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 @vedansh-5 - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/scripts/scrumHelper.js:1281` </location>
<code_context>
- li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a>${showOpenLabel ? ' ' + pr_draft_button : ''}</li>`;
+ li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a>${showOpenLabel ? ' ' + pr_draft_button : ''}`;
+ if (showCommits && item._allCommits && item._allCommits.length && !isNewPR && githubToken) {
+ log(`[PR DEBUG] Rendering commits for existing draft PR #${number}:`, item._allCommits);
+ li += '<ul>';
+ item._allCommits.forEach(commit => {
</code_context>
<issue_to_address>
Debug logging is present in production code.
Debug logs in production can clutter output and expose sensitive data. Please remove or conditionally enable this log with a debug flag.
Suggested implementation:
```javascript
if (showCommits && item._allCommits && item._allCommits.length && !isNewPR && githubToken) {
if (typeof DEBUG !== 'undefined' && DEBUG) {
log(`[PR DEBUG] Rendering commits for existing draft PR #${number}:`, item._allCommits);
}
li += '<ul>';
item._allCommits.forEach(commit => {
```
If a `DEBUG` flag is not already defined in your codebase, you should define it at the top of your script or in your configuration. For example:
```js
const DEBUG = false; // Set to true to enable debug logging
```
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@Preeti9764 please review this again |
Were these changes made in the last merged PR by you? If so, this would be fine in master because there are no conflicts and this would not affect the master branch's behavior. Thankyou! |
Edit - I did not touch any code concerning the labels. |
Adding commits in draft PRs
Fixes #213
Summary by Sourcery
Enable viewing commit details for draft PRs alongside open PRs when the showCommits option is enabled.
New Features:
Enhancements:
Chores: