types.ts icon indicating copy to clipboard operation
types.ts copied to clipboard

[BUG]: subscribers_count missing from repository properties

Open crs-k opened this issue 11 months ago • 3 comments

What happened?

Upgrading from 12.5.0 to 12.6.0 broke a few of my unit tests. Looking into the error, my mock response for rest.repos.get no longer matches the properties of the repository schema in octokit/types.ts.

Looking at the example response here, the docs show that the subscribers_count field still exists.

Which is correct?

Versions

"@actions/core": "1.10.1"
"@actions/github": "6.0.0"
"@octokit/plugin-paginate-rest": "10.0.0"
"@octokit/types": "12.6.0"

Relevant log output

391       subscribers_count: 42,
              ~~~~~~~~~~~~~~~~~

      node_modules/@octokit/openapi-types/types.d.ts:15440:7
        15440       parent?: components["schemas"]["repository"];
                    ~~~~~~
        The expected type comes from property 'parent' which is declared here on type '{ id: number; node_id: string; name: string; full_name: string; owner: { name?: string | null | undefined; email?: string | null | undefined; login: string; id: number; node_id: string; avatar_url: string; ... 14 more ...; starred_at?: string | undefined; }; ... 97 more ...; custom_properties?: { ...; } | undefined; }'
    __mocks__/@actions/github.ts:508:7 - error TS2561: Object literal may only specify known properties, but 'subscribers_count' does not exist in type '{ id: number; node_id: string; name: string; full_name: string; license: { key: string; name: string; url: string | null; spdx_id: string | null; node_id: string; html_url?: string | undefined; } | null; ... 89 more ...; anonymous_access_enabled?: boolean | undefined; }'. Did you mean to write 'subscribers_url'?

    508       subscribers_count: 42,
              ~~~~~~~~~~~~~~~~~

      node_modules/@octokit/openapi-types/types.d.ts:15441:7
        15441       source?: components["schemas"]["repository"];
                    ~~~~~~
        The expected type comes from property 'source' which is declared here on type '{ id: number; node_id: string; name: string; full_name: string; owner: { name?: string | null | undefined; email?: string | null | undefined; login: string; id: number; node_id: string; avatar_url: string; ... 14 more ...; starred_at?: string | undefined; }; ... 97 more ...; custom_properties?: { ...; } | undefined; }'

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

crs-k avatar Mar 09 '24 16:03 crs-k

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

github-actions[bot] avatar Mar 09 '24 16:03 github-actions[bot]

Same issue with

"@octokit/rest": "^20.1.0",
"@octokit/types": "^12.6.0", 

steezplusplus avatar Apr 23 '24 12:04 steezplusplus

The types are automatically generated from https://github.com/github/rest-api-description/

If this is still an issue, please check upstream as well and report it to them

wolfy1339 avatar Jul 21 '24 01:07 wolfy1339