[Bug][CircleCI] collectPipelines panics with a nil pointer dereference when the sync policy has no timeAfter
维护者通常 2 天内回复
评估
这个 Issue 还没有评估数据。
描述
Search before asking
- I had searched in the issues and found no similar issues.
What happened
The CircleCI collectPipelines subtask fails with runtime error: invalid memory address or nil pointer dereference when the sync policy has no timeAfter.
CollectPipelines (plugins/circleci/tasks/pipeline_collector.go) reads the time range and dereferences it for every pipeline in the response:
timeAfter := rawDataSubTaskArgs.Ctx.TaskContext().SyncPolicy().TimeAfter
...
if pipelineCreatedAt.Before(*timeAfter) {
return filteredItems, api.ErrFinishCollect
}
SyncPolicy.TimeAfter is optional. It is nil for advanced mode blueprints (config-ui creates them with timeAfter: undefined), when the start date is cleared in the blueprint's sync policy, and for directrun without a timeAfter. As soon as the first page has a pipeline, the response parser panics, the worker scheduler records the panic as the task error, and no CircleCI data is collected.
What do you expect to happen
With no timeAfter, every pipeline is collected, like the other collectors do (the collector framework already treats a missing timeAfter as "no lower bound").
How to reproduce
- Create an advanced mode blueprint with a CircleCI project, or clear the start date of a normal blueprint's time range.
- Run it.
collectPipelinesfails with the nil pointer dereference.
Anything else
Proposed fix (I have a PR ready): only filter by timeAfter when it is set, and check that SyncPolicy() isn't nil before reading it.
Version
main
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Go
- 星标
- 3.2k
- 派生
- 840
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 104
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/devlake 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 60/100
维护者通常 2 天内回复
-
[Bug][Asana] Story, subtask and tag collectors stop at 100 per task; task and user collectors restart on a full last page可能已有人在做 @ShivamSharma43 今天认领。 未关闭
apache/devlake#9365 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Bug][GitHub] Extract Issues succeeds without extracting when the issue regexes or milestones can't be loaded可能已有人在做 @ShivamSharma43 于 1 天前认领。 未关闭
apache/devlake#9358 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Bug][Linear] Config UI cannot associate a scope config with Linear team scopes可能已有人在做 @VictorColomb 于 1 天前认领。 未关闭type/bug
apache/devlake#9355 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Bug][JIRA Service API TOKEN] Jira API Gateway: saved service-account token truncated by varchar(255), causing Base64 errors and HTTP 500可能重新可做 关联的 PR 已关闭且未合并。 未关闭type/bug
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
GitHub webhook is not subscribed to release events, so `event: release` never triggers可能已有人在做 @qsun 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
woodpecker-ci/woodpecker#7542 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
zilliztech/milvus-backup#1386 ·
维护者通常 1 天内回复
-
Pipelined flush no longer observes kill signals after #2042: flush backoffer is built with nil vars未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复