Skip to content

Debug: Debug Dangerfile PR data content (Kasper)#34400

Open
kasperpeulen wants to merge 1 commit into
nextfrom
kasper/debug-dangerfile
Open

Debug: Debug Dangerfile PR data content (Kasper)#34400
kasperpeulen wants to merge 1 commit into
nextfrom
kasper/debug-dangerfile

Conversation

@kasperpeulen
Copy link
Copy Markdown
Member

@kasperpeulen kasperpeulen commented Mar 30, 2026

Summary

  • Adds debug console.log statements and a fail() call to the checkTargetBranch function in scripts/dangerfile.js to inspect the author_association value DangerJS receives for Kasper's PRs.
  • Includes an empty foo file to ensure there is a file change for CI to pick up.

This replicates the exact debug approach Steve used in PR #34398 to investigate the DangerJS author_association check that incorrectly failed on PR #34365. The goal is to verify whether DangerJS correctly recognizes Kasper's author_association as MEMBER.

Test plan

  • Observe the DangerJS CI check output on this PR
  • Verify the logged authorAssociation value is MEMBER
  • Confirm the fail() call is or is not triggered based on the association

Summary by CodeRabbit

  • Chores
    • Updated PR validation checks to fail earlier for unauthorized pull request authors, with additional debug output added for troubleshooting purposes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 30, 2026

Fails
🚫

{
"url": "https://api.github.com/repos/storybookjs/storybook/pulls/34400",
"id": 3466206643,
"node_id": "PR_kwDOAzqfmc7Omh2z",
"html_url": "#34400",
"diff_url": "https://github.com/storybookjs/storybook/pull/34400.diff",
"patch_url": "https://github.com/storybookjs/storybook/pull/34400.patch",
"issue_url": "https://api.github.com/repos/storybookjs/storybook/issues/34400",
"number": 34400,
"state": "open",
"locked": false,
"title": "Debug: Debug Dangerfile PR data content (Kasper)",
"user": {
"login": "kasperpeulen",
"id": 1035299,
"node_id": "MDQ6VXNlcjEwMzUyOTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1035299?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kasperpeulen",
"html_url": "https://github.com/kasperpeulen",
"followers_url": "https://api.github.com/users/kasperpeulen/followers",
"following_url": "https://api.github.com/users/kasperpeulen/following{/other_user}",
"gists_url": "https://api.github.com/users/kasperpeulen/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kasperpeulen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kasperpeulen/subscriptions",
"organizations_url": "https://api.github.com/users/kasperpeulen/orgs",
"repos_url": "https://api.github.com/users/kasperpeulen/repos",
"events_url": "https://api.github.com/users/kasperpeulen/events{/privacy}",
"received_events_url": "https://api.github.com/users/kasperpeulen/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
"body": "## Summary\n\n- Adds debug console.log statements and a fail() call to the checkTargetBranch function in scripts/dangerfile.js to inspect the author_association value DangerJS receives for Kasper's PRs.\n- Includes an empty foo file to ensure there is a file change for CI to pick up.\n\nThis replicates the exact debug approach Steve used in PR #34398 to investigate the DangerJS author_association check that incorrectly failed on PR #34365. The goal is to verify whether DangerJS correctly recognizes Kasper's author_association as MEMBER.\n\n## Test plan\n\n- [ ] Observe the DangerJS CI check output on this PR\n- [ ] Verify the logged authorAssociation value is MEMBER\n- [ ] Confirm the fail() call is or is not triggered based on the association\n\n\n\n## Summary by CodeRabbit\n\n* Chores\n * Updated PR validation checks to fail earlier for unauthorized pull request authors, with additional debug output added for troubleshooting purposes.\n\n",
"created_at": "2026-03-30T12:19:09Z",
"updated_at": "2026-03-30T12:20:09Z",
"closed_at": null,
"merged_at": null,
"merge_commit_sha": "a387f8cd0c4b5c7681c8ee5aff70a2e7879d7960",
"assignees": [],
"requested_reviewers": [],
"requested_teams": [],
"labels": [],
"milestone": null,
"draft": false,
"commits_url": "https://api.github.com/repos/storybookjs/storybook/pulls/34400/commits",
"review_comments_url": "https://api.github.com/repos/storybookjs/storybook/pulls/34400/comments",
"review_comment_url": "https://api.github.com/repos/storybookjs/storybook/pulls/comments{/number}",
"comments_url": "https://api.github.com/repos/storybookjs/storybook/issues/34400/comments",
"statuses_url": "https://api.github.com/repos/storybookjs/storybook/statuses/0898684822e79713bab0203d272facb1fbbcf54c",
"head": {
"label": "storybookjs:kasper/debug-dangerfile",
"ref": "kasper/debug-dangerfile",
"sha": "0898684822e79713bab0203d272facb1fbbcf54c",
"user": {
"login": "storybookjs",
"id": 22632046,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjIyNjMyMDQ2",
"avatar_url": "https://avatars.githubusercontent.com/u/22632046?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/storybookjs",
"html_url": "https://github.com/storybookjs",
"followers_url": "https://api.github.com/users/storybookjs/followers",
"following_url": "https://api.github.com/users/storybookjs/following{/other_user}",
"gists_url": "https://api.github.com/users/storybookjs/gists{/gist_id}",
"starred_url": "https://api.github.com/users/storybookjs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/storybookjs/subscriptions",
"organizations_url": "https://api.github.com/users/storybookjs/orgs",
"repos_url": "https://api.github.com/users/storybookjs/repos",
"events_url": "https://api.github.com/users/storybookjs/events{/privacy}",
"received_events_url": "https://api.github.com/users/storybookjs/received_events",
"type": "Organization",
"user_view_type": "public",
"site_admin": false
},
"repo": {
"id": 54173593,
"node_id": "MDEwOlJlcG9zaXRvcnk1NDE3MzU5Mw==",
"name": "storybook",
"full_name": "storybookjs/storybook",
"private": false,
"owner": {
"login": "storybookjs",
"id": 22632046,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjIyNjMyMDQ2",
"avatar_url": "https://avatars.githubusercontent.com/u/22632046?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/storybookjs",
"html_url": "https://github.com/storybookjs",
"followers_url": "https://api.github.com/users/storybookjs/followers",
"following_url": "https://api.github.com/users/storybookjs/following{/other_user}",
"gists_url": "https://api.github.com/users/storybookjs/gists{/gist_id}",
"starred_url": "https://api.github.com/users/storybookjs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/storybookjs/subscriptions",
"organizations_url": "https://api.github.com/users/storybookjs/orgs",
"repos_url": "https://api.github.com/users/storybookjs/repos",
"events_url": "https://api.github.com/users/storybookjs/events{/privacy}",
"received_events_url": "https://api.github.com/users/storybookjs/received_events",
"type": "Organization",
"user_view_type": "public",
"site_admin": false
},
"html_url": "https://github.com/storybookjs/storybook",
"description": "Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation",
"fork": false,
"url": "https://api.github.com/repos/storybookjs/storybook",
"forks_url": "https://api.github.com/repos/storybookjs/storybook/forks",
"keys_url": "https://api.github.com/repos/storybookjs/storybook/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/storybookjs/storybook/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/storybookjs/storybook/teams",
"hooks_url": "https://api.github.com/repos/storybookjs/storybook/hooks",
"issue_events_url": "https://api.github.com/repos/storybookjs/storybook/issues/events{/number}",
"events_url": "https://api.github.com/repos/storybookjs/storybook/events",
"assignees_url": "https://api.github.com/repos/storybookjs/storybook/assignees{/user}",
"branches_url": "https://api.github.com/repos/storybookjs/storybook/branches{/branch}",
"tags_url": "https://api.github.com/repos/storybookjs/storybook/tags",
"blobs_url": "https://api.github.com/repos/storybookjs/storybook/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/storybookjs/storybook/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/storybookjs/storybook/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/storybookjs/storybook/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/storybookjs/storybook/statuses/{sha}",
"languages_url": "https://api.github.com/repos/storybookjs/storybook/languages",
"stargazers_url": "https://api.github.com/repos/storybookjs/storybook/stargazers",
"contributors_url": "https://api.github.com/repos/storybookjs/storybook/contributors",
"subscribers_url": "https://api.github.com/repos/storybookjs/storybook/subscribers",
"subscription_url": "https://api.github.com/repos/storybookjs/storybook/subscription",
"commits_url": "https://api.github.com/repos/storybookjs/storybook/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/storybookjs/storybook/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/storybookjs/storybook/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/storybookjs/storybook/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/storybookjs/storybook/contents/{+path}",
"compare_url": "https://api.github.com/repos/storybookjs/storybook/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/storybookjs/storybook/merges",
"archive_url": "https://api.github.com/repos/storybookjs/storybook/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/storybookjs/storybook/downloads",
"issues_url": "https://api.github.com/repos/storybookjs/storybook/issues{/number}",
"pulls_url": "https://api.github.com/repos/storybookjs/storybook/pulls{/number}",
"milestones_url": "https://api.github.com/repos/storybookjs/storybook/milestones{/number}",
"notifications_url": "https://api.github.com/repos/storybookjs/storybook/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/storybookjs/storybook/labels{/name}",
"releases_url": "https://api.github.com/repos/storybookjs/storybook/releases{/id}",
"deployments_url": "https://api.github.com/repos/storybookjs/storybook/deployments",
"created_at": "2016-03-18T04:23:44Z",
"updated_at": "2026-03-30T11:42:26Z",
"pushed_at": "2026-03-30T12:18:47Z",
"git_url": "git://github.com/storybookjs/storybook.git",
"ssh_url": "git@github.com:storybookjs/storybook.git",
"clone_url": "https://github.com/storybookjs/storybook.git",
"svn_url": "https://github.com/storybookjs/storybook",
"homepage": "https://storybook.js.org",
"size": 1110325,
"stargazers_count": 89568,
"watchers_count": 89568,
"language": "TypeScript",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"has_discussions": true,
"forks_count": 9966,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 2211,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"has_pull_requests": true,
"pull_request_creation_policy": "all",
"topics": [
"angular",
"components",
"design-systems",
"documentation",
"html",
"javascript",
"react",
"react-native",
"stories",
"storybook",
"styleguide",
"svelte",
"testing",
"typescript",
"ui",
"vite",
"vue",
"web-components",
"webpack",
"workshop"
],
"visibility": "public",
"forks": 9966,
"open_issues": 2211,
"watchers": 89568,
"default_branch": "next"
}
},
"base": {
"label": "storybookjs:next",
"ref": "next",
"sha": "df785903baa0e5ba36e9b6c1c72a7dc63987a554",
"user": {
"login": "storybookjs",
"id": 22632046,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjIyNjMyMDQ2",
"avatar_url": "https://avatars.githubusercontent.com/u/22632046?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/storybookjs",
"html_url": "https://github.com/storybookjs",
"followers_url": "https://api.github.com/users/storybookjs/followers",
"following_url": "https://api.github.com/users/storybookjs/following{/other_user}",
"gists_url": "https://api.github.com/users/storybookjs/gists{/gist_id}",
"starred_url": "https://api.github.com/users/storybookjs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/storybookjs/subscriptions",
"organizations_url": "https://api.github.com/users/storybookjs/orgs",
"repos_url": "https://api.github.com/users/storybookjs/repos",
"events_url": "https://api.github.com/users/storybookjs/events{/privacy}",
"received_events_url": "https://api.github.com/users/storybookjs/received_events",
"type": "Organization",
"user_view_type": "public",
"site_admin": false
},
"repo": {
"id": 54173593,
"node_id": "MDEwOlJlcG9zaXRvcnk1NDE3MzU5Mw==",
"name": "storybook",
"full_name": "storybookjs/storybook",
"private": false,
"owner": {
"login": "storybookjs",
"id": 22632046,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjIyNjMyMDQ2",
"avatar_url": "https://avatars.githubusercontent.com/u/22632046?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/storybookjs",
"html_url": "https://github.com/storybookjs",
"followers_url": "https://api.github.com/users/storybookjs/followers",
"following_url": "https://api.github.com/users/storybookjs/following{/other_user}",
"gists_url": "https://api.github.com/users/storybookjs/gists{/gist_id}",
"starred_url": "https://api.github.com/users/storybookjs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/storybookjs/subscriptions",
"organizations_url": "https://api.github.com/users/storybookjs/orgs",
"repos_url": "https://api.github.com/users/storybookjs/repos",
"events_url": "https://api.github.com/users/storybookjs/events{/privacy}",
"received_events_url": "https://api.github.com/users/storybookjs/received_events",
"type": "Organization",
"user_view_type": "public",
"site_admin": false
},
"html_url": "https://github.com/storybookjs/storybook",
"description": "Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation",
"fork": false,
"url": "https://api.github.com/repos/storybookjs/storybook",
"forks_url": "https://api.github.com/repos/storybookjs/storybook/forks",
"keys_url": "https://api.github.com/repos/storybookjs/storybook/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/storybookjs/storybook/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/storybookjs/storybook/teams",
"hooks_url": "https://api.github.com/repos/storybookjs/storybook/hooks",
"issue_events_url": "https://api.github.com/repos/storybookjs/storybook/issues/events{/number}",
"events_url": "https://api.github.com/repos/storybookjs/storybook/events",
"assignees_url": "https://api.github.com/repos/storybookjs/storybook/assignees{/user}",
"branches_url": "https://api.github.com/repos/storybookjs/storybook/branches{/branch}",
"tags_url": "https://api.github.com/repos/storybookjs/storybook/tags",
"blobs_url": "https://api.github.com/repos/storybookjs/storybook/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/storybookjs/storybook/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/storybookjs/storybook/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/storybookjs/storybook/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/storybookjs/storybook/statuses/{sha}",
"languages_url": "https://api.github.com/repos/storybookjs/storybook/languages",
"stargazers_url": "https://api.github.com/repos/storybookjs/storybook/stargazers",
"contributors_url": "https://api.github.com/repos/storybookjs/storybook/contributors",
"subscribers_url": "https://api.github.com/repos/storybookjs/storybook/subscribers",
"subscription_url": "https://api.github.com/repos/storybookjs/storybook/subscription",
"commits_url": "https://api.github.com/repos/storybookjs/storybook/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/storybookjs/storybook/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/storybookjs/storybook/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/storybookjs/storybook/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/storybookjs/storybook/contents/{+path}",
"compare_url": "https://api.github.com/repos/storybookjs/storybook/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/storybookjs/storybook/merges",
"archive_url": "https://api.github.com/repos/storybookjs/storybook/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/storybookjs/storybook/downloads",
"issues_url": "https://api.github.com/repos/storybookjs/storybook/issues{/number}",
"pulls_url": "https://api.github.com/repos/storybookjs/storybook/pulls{/number}",
"milestones_url": "https://api.github.com/repos/storybookjs/storybook/milestones{/number}",
"notifications_url": "https://api.github.com/repos/storybookjs/storybook/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/storybookjs/storybook/labels{/name}",
"releases_url": "https://api.github.com/repos/storybookjs/storybook/releases{/id}",
"deployments_url": "https://api.github.com/repos/storybookjs/storybook/deployments",
"created_at": "2016-03-18T04:23:44Z",
"updated_at": "2026-03-30T11:42:26Z",
"pushed_at": "2026-03-30T12:18:47Z",
"git_url": "git://github.com/storybookjs/storybook.git",
"ssh_url": "git@github.com:storybookjs/storybook.git",
"clone_url": "https://github.com/storybookjs/storybook.git",
"svn_url": "https://github.com/storybookjs/storybook",
"homepage": "https://storybook.js.org",
"size": 1110325,
"stargazers_count": 89568,
"watchers_count": 89568,
"language": "TypeScript",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"has_discussions": true,
"forks_count": 9966,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 2211,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"has_pull_requests": true,
"pull_request_creation_policy": "all",
"topics": [
"angular",
"components",
"design-systems",
"documentation",
"html",
"javascript",
"react",
"react-native",
"stories",
"storybook",
"styleguide",
"svelte",
"testing",
"typescript",
"ui",
"vite",
"vue",
"web-components",
"webpack",
"workshop"
],
"visibility": "public",
"forks": 9966,
"open_issues": 2211,
"watchers": 89568,
"default_branch": "next"
}
},
"_links": {
"self": {
"href": "https://api.github.com/repos/storybookjs/storybook/pulls/34400"
},
"html": {
"href": "#34400"
},
"issue": {
"href": "https://api.github.com/repos/storybookjs/storybook/issues/34400"
},
"comments": {
"href": "https://api.github.com/repos/storybookjs/storybook/issues/34400/comments"
},
"review_comments": {
"href": "https://api.github.com/repos/storybookjs/storybook/pulls/34400/comments"
},
"review_comment": {
"href": "https://api.github.com/repos/storybookjs/storybook/pulls/comments{/number}"
},
"commits": {
"href": "https://api.github.com/repos/storybookjs/storybook/pulls/34400/commits"
},
"statuses": {
"href": "https://api.github.com/repos/storybookjs/storybook/statuses/0898684822e79713bab0203d272facb1fbbcf54c"
}
},
"author_association": "CONTRIBUTOR",
"auto_merge": null,
"assignee": null,
"active_lock_reason": null,
"merged": false,
"mergeable": true,
"rebaseable": false,
"mergeable_state": "blocked",
"merged_by": null,
"comments": 1,
"review_comments": 0,
"maintainer_can_modify": false,
"commits": 1,
"additions": 6,
"deletions": 0,
"changed_files": 2
}

🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","build","dependencies"]

🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

🚫 PR description is missing the mandatory "#### Manual testing" section. Please add it so that reviewers know how to manually test your changes.

Generated by 🚫 dangerJS against 0898684

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

The checkTargetBranch() function in scripts/dangerfile.js now includes debug logging that outputs PR author details and the full GitHub PR object. Additionally, the function introduces a call to fail() that unconditionally fails checks for all non-owner and non-member PR authors, before existing target branch validation logic.

Changes

Cohort / File(s) Summary
Debug logging and conditional failure logic
scripts/dangerfile.js
Added console.log statements for PR author association, author object, and full JSON dump of danger.github.pr. Introduced unconditional fail() call for non-owner/member authors after the early-return guard.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • storybookjs/storybook#34007: Modifies the same checkTargetBranch() function in scripts/dangerfile.js with behavior changes to log and fail for non-owner/member PR authors.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/dangerfile.js (1)

169-171: Prefer a targeted debug payload here.

Dumping the entire danger.github.pr object makes the CI output noisy and duplicates the same payload again on Line 181. The association, author identity, PR number, and base ref should be enough for this investigation.

🪵 Suggested debug payload
   console.log('authorAssociation', authorAssociation);
-  console.log('author', author);
-  console.log(JSON.stringify(danger.github.pr, null, 2));
+  console.log('author', { login: author.login, type: author.type });
+  console.log('prDebug', {
+    number: danger.github.pr.number,
+    baseRef: targetBranch,
+    authorAssociation,
+  });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/dangerfile.js` around lines 169 - 171, Replace the noisy full dump of
danger.github.pr with a targeted debug payload: log authorAssociation and author
as you do, then log only danger.github.pr.number and danger.github.pr.base.ref
(and danger.github.pr.user.login if you need the PR author's login) instead of
JSON.stringify(danger.github.pr); also remove the duplicate full-pr dump
elsewhere so you only emit this concise payload once. Ensure you update the
console.log calls that currently reference JSON.stringify(danger.github.pr) to
the specific properties (number, base.ref, user.login) and eliminate the
redundant dump.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/dangerfile.js`:
- Line 181: Remove the unconditional call to
fail(JSON.stringify(danger.github.pr, null, 2)); so external PRs are not always
marked failed; either delete this line or wrap it in a conditional that only
runs for the one-off debug case (e.g., check an environment var or a specific PR
number/author/team), ensuring the use of the existing fail(...) symbol and
danger.github.pr payload is preserved only for explicit debug gating.

---

Nitpick comments:
In `@scripts/dangerfile.js`:
- Around line 169-171: Replace the noisy full dump of danger.github.pr with a
targeted debug payload: log authorAssociation and author as you do, then log
only danger.github.pr.number and danger.github.pr.base.ref (and
danger.github.pr.user.login if you need the PR author's login) instead of
JSON.stringify(danger.github.pr); also remove the duplicate full-pr dump
elsewhere so you only emit this concise payload once. Ensure you update the
console.log calls that currently reference JSON.stringify(danger.github.pr) to
the specific properties (number, base.ref, user.login) and eliminate the
redundant dump.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87843b4f-36ff-4ea2-adb5-0afc85ae220c

📥 Commits

Reviewing files that changed from the base of the PR and between df78590 and 0898684.

📒 Files selected for processing (2)
  • foo
  • scripts/dangerfile.js

Comment thread scripts/dangerfile.js
return;
}

fail(JSON.stringify(danger.github.pr, null, 2));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove the unconditional fail() before this lands.

This marks every external-contributor PR as failed even when it already targets next. .github/workflows/danger-js.yml:1-25 runs this Dangerfile for all pull_request events with no author-based skip, so non-team contributors will keep getting a red check until this line is removed or tightly scoped to the one-off debug run.

🧹 Minimal fix
-  fail(JSON.stringify(danger.github.pr, null, 2));

Based on learnings: All PRs should target the 'next' branch, not 'main'.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fail(JSON.stringify(danger.github.pr, null, 2));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/dangerfile.js` at line 181, Remove the unconditional call to
fail(JSON.stringify(danger.github.pr, null, 2)); so external PRs are not always
marked failed; either delete this line or wrap it in a conditional that only
runs for the one-off debug case (e.g., check an environment var or a specific PR
number/author/team), ensuring the use of the existing fail(...) symbol and
danger.github.pr payload is preserved only for explicit debug gating.

@github-actions github-actions Bot added the Stale label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant