https://pulumi.com logo
Title
w

wonderful-library-14534

03/03/2023, 3:42 AM
Beginner question: can Pulumi fully manage a GitHub repo's settings? I played with the github provider today, but when I import my test GitHub repo, it doesnt seem like its picking up all of the GitHub repo settings, like the branch protections. Am I missing something, or, does the github provider lack the ability to import all of the settings?
When I use the "import" option, I'm getting a preview that looks like this:
Do you want to perform this import? details
+ pulumi:pulumi:Stack: (create)
    [urn=urn:pulumi:sandbox::repocontrol::pulumi:pulumi:Stack::repocontrol-sandbox]
    = github:index/repository:Repository: (import) 🔒
        [id=example-repo-a]
        [urn=urn:pulumi:sandbox::repocontrol::github:index/repository:Repository::example-repo-a]
        defaultBranch: "main"
        description  : "My great description"
        hasDownloads : true
        hasIssues    : true
        hasProjects  : true
        hasWiki      : true
        name         : "example-repo-a"
        private      : true
        visibility   : "private"
I'm not seeing any evidence that it has an awareness of all of the other options like the branch protections, which are super important.
l

little-cartoon-10569

03/03/2023, 4:40 AM
Settings are spread out over many objects. You'll need a lot more work to import it all, unfortunately. Branch protection rules are covered by the BranchProteection class: https://www.pulumi.com/registry/packages/github/api-docs/branchprotection/
b

bulky-wall-65429

03/03/2023, 8:58 AM
@wonderful-library-14534 checkout https://github.com/pulumiverse/infra for a real world example
w

wonderful-library-14534

03/03/2023, 4:45 PM
Somewhat related question: I've discovered some weakness in GitHub where some of the GitHub repo settings information is just not available across either their REST API or GraphQL API (specifically, branch protection push allowances for apps). I've confirmed this with GitHub support. They acknowledged a GraphQL bug, and I'm hoping they fix it soon. Therefore - my question is this: If there are some params that I know cannot be retrieved across GitHub API's, what should I expect Pulumi to do? For example: if a GitHub administrator sets this value in the GitHub UI on Monday, then on Tuesday somebody else does a "pulumi up" with some other settings, will Pulumi blow that value manually registered push allowance value from Monday?