Github - List Repositories & List Organization Repositories#20493
Github - List Repositories & List Organization Repositories#20493
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughAdds two new GitHub actions (List Organizations, List Organization Repositories), updates github.app method signatures to accept/forward request parameters, bumps many component/package version fields, and updates several docs URLs' apiVersion query parameters. No other runtime logic changes beyond the two new actions and app method signatures. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Caller
participant Action as ListOrganizations Action
participant App as github.app
participant API as GitHub REST API
Client->>Action: invoke List Organizations
Action->>App: this.github.getOrganizations(data)
App->>API: GET /user/orgs with params (paginated)
API-->>App: paginated orgs page(s)
App-->>Action: aggregated orgs array
Action-->>Client: return orgs (exports $summary)
sequenceDiagram
participant Client as Caller
participant Action as ListOrgRepos Action
participant App as github.app
participant API as GitHub REST API
Client->>Action: invoke List Organization Repositories (org, type, sort, direction)
Action->>App: this.github.getOrgRepos({ org, ...opts })
App->>API: GET /orgs/{org}/repos with params (paginated)
API-->>App: paginated repo pages
App-->>Action: aggregated repos array
Action-->>Client: return repos (exports $summary)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@components/github/actions/list-organization-repositories/list-organization-repositories.mjs`:
- Around line 67-71: The action currently returns full repo objects in the
repositories array; change it to return only the required fields by mapping the
repositories array to a new array (e.g., shapedRepos) that contains objects with
only name, full_name, description, private, and html_url, then return that
shaped array instead of the original repositories; update any uses of
repositories for the output (such as the $summary export) to still use
repositories.length for the count if needed but ensure the returned value is the
mapped shaped array (reference the repositories variable and the return
statement near the end of the module).
In `@components/github/actions/list-organizations/list-organizations.mjs`:
- Around line 23-26: The call to this.github.getOrganizations is using camelCase
perPage which Octokit/GitHub REST expects as per_page; update the argument name
from perPage to per_page in the getOrganizations call (alongside the existing
page parameter) so pagination works correctly in the list-organizations action;
locate the call to this.github.getOrganizations in list-organizations.mjs and
replace the perPage key with per_page to match other methods like
listReleases/listWorkflows.
In
`@components/github/actions/update-project-v2-item-status/update-project-v2-item-status.mjs`:
- Line 7: The version field "version: \"0.0.10\"" in
update-project-v2-item-status.mjs was bumped despite no functional changes;
revert this version bump to the previous value (or, if your repo policy mandates
blanket bumps, add a short documented policy entry explaining why all actions
receive a patch bump on parent component updates). Locate the "version:
\"0.0.10\"" token in update-project-v2-item-status.mjs (and similarly for other
actions if following policy) and either restore the prior version string or
add/update project documentation describing the blanket-versioning rule and when
patch bumps should be applied.
In `@components/github/github.app.mjs`:
- Around line 425-428: The getOrgRepos pagination is unbounded and can explode
for large orgs; modify getOrgRepos to accept an optional numeric cap (e.g.,
maxResults or limit) and, when provided, stop pagination once that many repos
have been collected while preserving current behavior when the cap is absent.
Locate the getOrgRepos method and replace the direct this._client().paginate
call with a controlled pagination loop or use Octokit paginate with a mapping
callback that accumulates items, applying per_page to reduce page size and
breaking out when accumulated.length >= cap; ensure default behavior remains
unchanged when cap is undefined or null.
- Around line 417-418: The list-organizations action currently forwards the
camelCase perPage to getOrganizations which then sends it to GitHub and is
ignored; update the action that calls getOrganizations (the list-organizations
action) to pass per_page instead of perPage (e.g., { page, per_page: perPage })
so the API receives the snake_case parameter; no changes needed to
getOrganizations itself other than receiving the corrected key.
In `@components/github/sources/new-issue-with-status/new-issue-with-status.mjs`:
- Line 11: The version field in new-issue-with-status.mjs was bumped from
"0.1.10" to "0.1.11" without any functional changes; either revert the version
back to "0.1.10" or add a brief comment or commit message clarifying why a
repo-wide/component-wide version bump was applied (e.g., release coordination,
packaging change), referencing the "version" field and the current value
"0.1.11" so reviewers can verify the intentionality of the change.
In `@components/github/sources/new-star/new-star.mjs`:
- Line 11: The version bump to "1.0.13" in the component metadata lacks
explanation; update the component's metadata or PR/changelog to document the
rationale for the patch bump (e.g., shared dependency update in the common
GitHub service/base class or coordination across other GitHub source components)
and confirm whether the bump is necessary since no functional code in
new-star.mjs changed and it still only calls
this.github.getRepositoryStargazers(); specifically, add a brief note next to
the version field (version: "1.0.13") or an entry in the PR
description/changelog referencing the shared change (mentioning the new methods
listOrganizations and listOrganizationRepositories if relevant) or remove the
bump if it was accidental.
In `@components/github/sources/new-team/new-team.mjs`:
- Around line 7-8: Update the invalid date in the GitHub docs URL inside the
description string by replacing the malformed apiVersion value `20.2.71-28` with
a valid date-based API version like `2022-11-28` in
components/github/sources/new-team/new-team.mjs (look for the description field
containing the docs URL and the apiVersion parameter); apply the same fix to the
other affected GitHub source files (new-security-alert, new-repository,
new-organization, new-notification, new-review-request, new-mention, and
new-gist where `20.2.61-28` appears) so all documentation links use a date-based
version (e.g., `2022-11-28`).
🪄 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: ASSERTIVE
Plan: Pro
Run ID: c4e348bd-6e4b-4eff-90cd-dbc5c1694869
📒 Files selected for processing (61)
components/github/actions/create-branch/create-branch.mjscomponents/github/actions/create-gist/create-gist.mjscomponents/github/actions/create-issue-comment/create-issue-comment.mjscomponents/github/actions/create-issue/create-issue.mjscomponents/github/actions/create-or-update-file-contents/create-or-update-file-contents.mjscomponents/github/actions/create-pull-request/create-pull-request.mjscomponents/github/actions/create-repository/create-repository.mjscomponents/github/actions/create-workflow-dispatch/create-workflow-dispatch.mjscomponents/github/actions/disable-workflow/disable-workflow.mjscomponents/github/actions/enable-workflow/enable-workflow.mjscomponents/github/actions/get-commit/get-commit.mjscomponents/github/actions/get-current-user/get-current-user.mjscomponents/github/actions/get-issue-assignees/get-issue-assignees.mjscomponents/github/actions/get-issue/get-issue.mjscomponents/github/actions/get-repository-content/get-repository-content.mjscomponents/github/actions/get-repository/get-repository.mjscomponents/github/actions/get-reviewers/get-reviewers.mjscomponents/github/actions/get-workflow-run/get-workflow-run.mjscomponents/github/actions/list-commits/list-commits.mjscomponents/github/actions/list-gists-for-a-user/list-gists-for-a-user.mjscomponents/github/actions/list-organization-repositories/list-organization-repositories.mjscomponents/github/actions/list-organizations/list-organizations.mjscomponents/github/actions/list-releases/list-releases.mjscomponents/github/actions/list-repositories/list-repositories.mjscomponents/github/actions/list-workflow-runs/list-workflow-runs.mjscomponents/github/actions/search-issues-and-pull-requests/search-issues-and-pull-requests.mjscomponents/github/actions/star-repo/star-repo.mjscomponents/github/actions/sync-fork-branch-with-upstream/sync-fork-branch-with-upstream.mjscomponents/github/actions/update-gist/update-gist.mjscomponents/github/actions/update-issue/update-issue.mjscomponents/github/actions/update-project-v2-item-status/update-project-v2-item-status.mjscomponents/github/actions/update-pull-request/update-pull-request.mjscomponents/github/github.app.mjscomponents/github/package.jsoncomponents/github/sources/new-branch/new-branch.mjscomponents/github/sources/new-card-in-column/new-card-in-column.mjscomponents/github/sources/new-collaborator/new-collaborator.mjscomponents/github/sources/new-commit-comment/new-commit-comment.mjscomponents/github/sources/new-commit/new-commit.mjscomponents/github/sources/new-discussion/new-discussion.mjscomponents/github/sources/new-fork/new-fork.mjscomponents/github/sources/new-gist/new-gist.mjscomponents/github/sources/new-issue-comment/new-issue-comment.mjscomponents/github/sources/new-issue-with-status/new-issue-with-status.mjscomponents/github/sources/new-label/new-label.mjscomponents/github/sources/new-mention/new-mention.mjscomponents/github/sources/new-notification/new-notification.mjscomponents/github/sources/new-or-updated-issue/new-or-updated-issue.mjscomponents/github/sources/new-or-updated-milestone/new-or-updated-milestone.mjscomponents/github/sources/new-or-updated-pull-request/new-or-updated-pull-request.mjscomponents/github/sources/new-organization/new-organization.mjscomponents/github/sources/new-release/new-release.mjscomponents/github/sources/new-repository/new-repository.mjscomponents/github/sources/new-review-request/new-review-request.mjscomponents/github/sources/new-security-alert/new-security-alert.mjscomponents/github/sources/new-star-by-user/new-star-by-user.mjscomponents/github/sources/new-star/new-star.mjscomponents/github/sources/new-team/new-team.mjscomponents/github/sources/new-workflow-job-completed/new-workflow-job-completed.mjscomponents/github/sources/new-workflow-run-completed/new-workflow-run-completed.mjscomponents/github/sources/webhook-events/webhook-events.mjs
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@components/github/actions/list-organizations/list-organizations.mjs`:
- Line 19: The variable perPage is declared with let but never reassigned;
change its declaration to const to reflect immutability (update the declaration
for perPage in list-organizations.mjs where perPage = 100 is defined).
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 2af94ef3-1428-4ffd-b229-9a8aacbc55d2
📒 Files selected for processing (1)
components/github/actions/list-organizations/list-organizations.mjs
…s.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@components/github/actions/list-organizations/list-organizations.mjs`:
- Line 32: Replace the repeated array concatenation that creates new arrays on
each loop by mutating the accumulator in place: where the code uses
allOrganizations = allOrganizations.concat(organizations) (working with the
allOrganizations and organizations variables), change it to use in-place push
(e.g., push(...organizations) or Array.prototype.push.apply(allOrganizations,
organizations)), ensuring organizations is an array (use
Array.isArray(organizations) guard if necessary) so you avoid repeated
allocations and preserve behavior.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 4daaf0da-3a16-4480-945d-2a12ad9847e8
📒 Files selected for processing (1)
components/github/actions/list-organizations/list-organizations.mjs
Resolves #20464
Resolves #20465
Summary by CodeRabbit
New Features
Improvements