Conversation
…ment configuration
…with pre and post deployment scripts
|
@ |
…g and job execution logic
…ated logic for job resolution
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| printer.warning('没有找到 .cd.yml 文件,可能已被删除,请检查文件是否存在'); | ||
| return; | ||
| } | ||
| deployConfig = await _yaml(ymlConfigFile); |
There was a problem hiding this comment.
Re-reading YAML overwrites per-job config with top-level config
High Severity
When using multi-job configs, deployConfig = await _yaml(ymlConfigFile) replaces the per-job deployConfig (which contains that job's deploy and scripts) with the entire YAML file contents. For jobs-based configs, the top level has only name, env, and jobs — no scripts or deploy. So deployConfig.scripts and deployConfig.deploy resolve to undefined, and all deployment steps and scripts are silently skipped while reporting success.
Additional Locations (1)
| export interface DeployJob { | ||
| items: DeployItem[]; | ||
| deployConfig: DeployConfig; | ||
| } |
There was a problem hiding this comment.
DeployJob type missing target field used at runtime
Medium Severity
The DeployJob interface lacks a target property, but the runtime code in resolveJobs pushes objects with target: job.target, and execJobs destructures target from each job. Any consumer relying on this type definition would not know target exists, leading to incorrect type-checking and missing IDE support for a critical field.


Note
Medium Risk
Introduces a new deployment executor that performs git merges and runs arbitrary configured scripts across multiple job targets; errors or misconfiguration could impact deployment correctness and execute unintended commands.
Overview
Adds multi-job deployment support via a new
Deploymentclass (src/deploy.js) that selects merge requests per job (with include/exclude branch wildcards), merges them into per-target temporary branches, reloads.cd.yml, injectsenv, and runspre_deploy/deploy.steps/post_deploy/cleanupscripts.Refactors the workflow (
src/flow.js) to a simplerinit+runpipeline that clones/resets the repo once and delegates all merge+deploy work toDeployment, and moves branch-pattern matching utilities intosrc/utils.js.Extends TypeScript declarations (
index.d.ts) with deployment/job configuration types and adds an example config (examples/.cd.jobs.yml) demonstratingjobs-based deployments.Written by Cursor Bugbot for commit 37b046b. This will update automatically on new commits. Configure here.