pulumi / pulumi-github

A Pulumi package to facilitate interacting with GitHub
Apache License 2.0
58 stars 10 forks source link

Imported Repo topics are sometimes `undefined` (in TypeScript) #168

Open mattwynne opened 2 years ago

mattwynne commented 2 years ago

Hello!

Issue details

When importing repos using a resources json doc, we're finding that the list of topics on the (Typescript) generated repo does not always match the actual topics on GitHub. For example, the [cucumber/cucumber-js] repo has three topics (javascript, typescript and cucumber) but the imported TypeScript representation in this commit shows

    topics: [
        undefined,
        "javascript",
        "cucumber",
    ],

This is non-deterministic. Sometimes, the list of topics is correct, and sometimes it contains these undefined values. We can't figure out a reason why it happens.

Steps to reproduce

pulumi import github:index/repository:Repository cucumber/cucumber-js cucumber-js --yes --out foo.ts
cat foo.ts

Sometimes one of the topics is undefined. Right now, my colleague (running the command in France, where is the afternoon, on Linux) is experiencing it, and I (running the command in Canada, where it is the morning, on an M1 Mac) am not experiencing it. I have, however, seen it before on this machine, just not right now. 🀯

Expected:

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const cucumber_cucumber_js = new github.Repository("cucumber/cucumber-js", {
    allowAutoMerge: false,
    allowMergeCommit: false,
    allowRebaseMerge: false,
    allowSquashMerge: true,
    archived: false,
    deleteBranchOnMerge: true,
    description: "Cucumber for JavaScript",
    hasDownloads: true,
    hasIssues: true,
    hasProjects: true,
    homepageUrl: "https://cucumber.io",
    name: "cucumber-js",
    pages: {
        source: {
            branch: "gh-pages",
        },
    },
    topics: [
        "javascript",
        "typescript",
        "cucumber",
    ],
    vulnerabilityAlerts: true,
}, {
    protect: true,
});

Actual:

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const cucumber_cucumber_js = new github.Repository("cucumber/cucumber-js", {
    allowAutoMerge: false,
    allowMergeCommit: false,
    allowRebaseMerge: false,
    allowSquashMerge: true,
    archived: false,
    deleteBranchOnMerge: true,
    description: "Cucumber for JavaScript",
    hasDownloads: true,
    hasIssues: true,
    hasProjects: true,
    homepageUrl: "https://cucumber.io",
    name: "cucumber-js",
    pages: {
        source: {
            branch: "gh-pages",
        },
    },
    topics: [
        undefined,
        "typescript",
        "cucumber",
    ],
    vulnerabilityAlerts: true,
}, {
    protect: true,
});
mattwynne commented 2 years ago

Any thoughts on what is causing this? We're only at a proof-of-concept stage with adopting Pulumi at the moment and honestly it's causing some of us to question whether we can rely on this tool.

If there are any pointers where we could look to help troubleshoot or fix this, we'd be happy to help.

mjeffryes commented 3 days ago

Unfortunately, it looks like this issue hasn't seen any updates in a while. If you're still encountering this problem, could you leave a quick comment to let us know so we can prioritize it?