Commit 4714656
authored
Projects: Fix panic caused by newly added enum (#443)
Recently following enums where added to project graphql query
https://docs.github.com/en/graphql/overview/changelog#schema-changes-for-2025-02-01-1:
- Enum value 'PARENT_ISSUEwas added to enumProjectV2FieldType'
- Enum value 'SUB_ISSUES_PROGRESSwas added to enumProjectV2FieldType'
As we didn't have processing for these, and they weren't in the
`fieldTypes` or `exclude` list `fieldType :=
fieldTypes[f.Common.DataType]` returned `nil` which caused panic in
`field := data.NewField(f.Common.Name, nil, fieldType)` as fieldType
can't be nil.
To fix this, we have added these new enums to `exclude` so we can add
processing for them later. Moreover, we have added a logic to check if
`fieldType == nil` and in that case `continue`, but create a log so we
might be more aware of this new enum.
More in
https://raintank-corp.slack.com/archives/C05K271Q8F5/p1742559654567789?thread_ts=1742486345.609529&cid=C05K271Q8F51 parent 3d02802 commit 4714656
File tree
2 files changed
+13
-0
lines changed- .changeset
- pkg/github/projects
2 files changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
| 250 | + | |
| 251 | + | |
244 | 252 | | |
245 | 253 | | |
246 | 254 | | |
| |||
0 commit comments