[Bug][CircleCI] collectPipelines panics with a nil pointer dereference when the sync policy has no timeAfter

未关闭
#9,367 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@ShivamSharma43 已经在做这个了。

开始于 2026年11月10日。

  • #9368 来自 @ShivamSharma43 —— 未关闭

评估

这个 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
  1. Create an advanced mode blueprint with a CircleCI project, or clear the start date of a normal blueprint's time range.
  2. Run it. collectPipelines fails 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
主要语言
Go
星标
3.2k
派生
840
平均合并
1 天 21 小时
30 天内合并 PR
104

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/devlake 的其他 Issue

查看 apache/devlake 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。