exasol / github-keeper

Tool for unifying our GitHub repository setup. Superseded by github-issue-adapter
MIT License
2 stars 1 forks source link

Running GK fails for repo sqlalchemy-exasol #48

Closed kaklakariada closed 2 years ago

kaklakariada commented 2 years ago

Running GK fails for repo sqlalchemy-exasol:

 ✘ user@host ~/github-keeper $ go run . configure-repo "sqlalchemy-exasol"

https://github.com/exasol/sqlalchemy-exasol
panic: unsupported type float64

goroutine 1 [running]:
github.com/exasol/github-keeper/cmd.WorkflowDefinitionParser.replaceSpecificParameterInJobName({}, {0xc0000c62a0, 0x20}, {0x822360, 0xc000526f98}, 0x4e328d)
        /home/nic/Projects/github-keeper/cmd/workflowDefinitionParser.go:140 +0x16e
github.com/exasol/github-keeper/cmd.WorkflowDefinitionParser.replaceParametersInJobName({}, {0xc0000c62a0, 0x19}, 0x8e8f6a, {0xc000534ab0, 0x3, 0x3}, 0x0)
        /home/nic/Projects/github-keeper/cmd/workflowDefinitionParser.go:116 +0x1e5
github.com/exasol/github-keeper/cmd.WorkflowDefinitionParser.fillJobNameParametersForMatrixBuild({}, {0xc00009c0b8, 0xc000542f10}, {0xc0000c62a0, 0x6f})
        /home/nic/Projects/github-keeper/cmd/workflowDefinitionParser.go:79 +0x325
github.com/exasol/github-keeper/cmd.getJobNames(0xc0005430b0, {})
        /home/nic/Projects/github-keeper/cmd/workflowDefinitionParser.go:60 +0x125
github.com/exasol/github-keeper/cmd.WorkflowDefinitionParser.ParseWorkflowDefinition({}, {0xc000571000, 0xfbe})
        /home/nic/Projects/github-keeper/cmd/workflowDefinitionParser.go:35 +0xca
github.com/exasol/github-keeper/cmd.BranchProtectionVerifier.getChecksForWorkflowContent({{0x7ffe4bc4322c, 0x0}, 0xc000188000}, {0xc000571000, 0xfbe}, 0xc000542030)
        /home/nic/Projects/github-keeper/cmd/branchProtection.go:230 +0x167
github.com/exasol/github-keeper/cmd.BranchProtectionVerifier.getChecksForWorkflow({{0x7ffe4bc4322c, 0xc000188088}, 0xc000188000}, 0xc000542030)
        /home/nic/Projects/github-keeper/cmd/branchProtection.go:225 +0x85
github.com/exasol/github-keeper/cmd.BranchProtectionVerifier.getRequiredChecks({{0x7ffe4bc4322c, 0xc00018a190}, 0xc000188000}, 0x0)
        /home/nic/Projects/github-keeper/cmd/branchProtection.go:204 +0x1ad
github.com/exasol/github-keeper/cmd.BranchProtectionVerifier.createProtectionRequest({{0x7ffe4bc4322c, 0x98e4f0}, 0xc000188000}, 0x2a)
        /home/nic/Projects/github-keeper/cmd/branchProtection.go:164 +0xa5
github.com/exasol/github-keeper/cmd.BranchProtectionVerifier.CheckIfBranchProtectionIsApplied({{0x7ffe4bc4322c, 0xc000010018}, 0xc000188000}, 0x1e)
        /home/nic/Projects/github-keeper/cmd/branchProtection.go:55 +0x17c
github.com/exasol/github-keeper/cmd.glob..func1(0xca5240, {0xc000063040, 0x1, 0x1})
        /home/nic/Projects/github-keeper/cmd/configureRepo.go:29 +0x15e
github.com/spf13/cobra.(*Command).execute(0xca5240, {0xc000063020, 0x1, 0x1})
        /home/nic/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xca59c0)
        /home/nic/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/nic/go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:902
github.com/exasol/github-keeper/cmd.Execute()
        /home/nic/Projects/github-keeper/cmd/root.go:16 +0x25
main.main()
        /home/user/github-keeper/main.go:6 +0x17
exit status 2
kaklakariada commented 2 years ago

Root cause: workflow definition contained a float number:

        matrix:
          python: [3.6]

I will fix this and also handle integer and boolean values.

Workaround: use strings, e.g.:

        matrix:
          python: ["3.6"]