Skip to content
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

[BUG]: app.eachInstallation Type Doesn't include Account Details #465

Open
1 task done
codingdiaz opened this issue Sep 15, 2023 · 4 comments
Open
1 task done

[BUG]: app.eachInstallation Type Doesn't include Account Details #465

codingdiaz opened this issue Sep 15, 2023 · 4 comments
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@codingdiaz
Copy link

What happened?

When upgrading from v13.1.1 to v13.1.3 we have seen issues using data with app.eachInstallation.

This is an example of our code that breaks when upgrading to anything past v13.1.1.

import { App } from "@octokit/app";
import * as fs from "fs";

const privateKey = fs.readFileSync("./key.pem", { encoding: "utf8" });

const app = new App({
  appId: "123456",
  privateKey,
});

async function run() {

  for await (const { octokit, installation } of app.eachInstallation.iterator()) {
    console.log(installation.account?.login);
   }

}

run();

On v13.1.1 it works, but, on v13.1.2 and beyond, we get this type error.

script.ts:14:39 - error TS2339: Property 'login' does not exist on type '{ name?: string | null | undefined; email?: string | null | undefined; login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string | null; url: string; html_url: string; ... 11 more ...; starred_at?: string | undefined; } | { ...; }'.
  Property 'login' does not exist on type '{ description?: string | null | undefined; html_url: string; website_url?: string | null | undefined; id: number; node_id: string; name: string; slug: string; created_at: string | null; updated_at: string | null; avatar_url: string; }'.

14     console.log(installation.account?.login);

Versions

Node: v18.14.0

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@codingdiaz codingdiaz added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Sep 15, 2023
@github-actions
Copy link

👋 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! 🚀

@wolfy1339
Copy link
Member

This seems like an issue from GitHub's side from their OpenAPI spec.

This seems like the same as octokit/openapi-types.ts#339

@wolfy1339
Copy link
Member

Can you upgrade to v13.1.8 as there has been some accidental breaking changes that were released in previous versions.

Is there a particular reason you aren't upgrading to v14?

@codingdiaz
Copy link
Author

@wolfy1339 ah, we figured it was something with the types. We run into this error on v13.1.8. We are trying to use v14 but we have the same issue. We currently put a workaround in to parse the data we need from an HTML URL instead using v14.

@nickfloyd nickfloyd moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

2 participants