Loading...
Loading...
Compare original and translation side by side
/cmd/pkg/internal@perses-dev/*/cmd/pkg/internal@perses-dev/*golangci-lintpackage modelclose({})$refglobalprojectdashboard/api/v1/projects/{project}/...GlobalDatasourceGlobalSecretpercli lintgolangci-lintpackage modelclose({})$refglobalprojectdashboard/api/v1/projects/{project}/...GlobalDatasourceGlobalSecretpercli lint.go.tsx.ts.cuedao.goList.go.tsx.ts.cuedao.goListmigrate/migrate.cuemigrate/migrate.cue@perses-dev/plugin-systempackage modelpercli lint@perses-dev/plugin-systempackage modelpercli lintperses-deployperses-dashboard-createperses-plugin-creategolang-general-engineertypescript-frontend-engineerperses-deployperses-dashboard-createperses-plugin-creategolang-general-engineertypescript-frontend-engineer| Cause | Symptom | Solution |
|---|---|---|
| Go API handler doesn't follow Perses CRUD patterns | Missing pagination on | Flag as blocker. Perses |
React component doesn't use | Component uses raw | Flag as blocker. Perses plugins MUST use the plugin system hooks to participate in the dashboard lifecycle (time range sync, variable interpolation, refresh). Direct data fetching bypasses the plugin contract. |
CUE schema not in | Schema declares | Flag as blocker. All Perses CUE schemas must be |
Dashboard definition has invalid | Layout references | Flag as blocker. Panel keys in |
| Broken variable chains in dashboard | Variable B depends on variable A via | Flag as blocker. Variable evaluation order follows list order. Dependees must appear before dependents. Missing variables cause silent empty interpolation. |
| Wrong datasource scope | Dashboard uses | Flag as warning. Datasources have three scopes: |
| 原因 | 症状 | 解决方案 |
|---|---|---|
| Go API处理器未遵循Perses CRUD模式 | | 标记为阻塞问题。Perses的 |
React组件未使用 | 组件使用原生 | 标记为阻塞问题。Perses插件必须使用插件系统钩子以参与仪表板生命周期(时间范围同步、变量插值、刷新)。直接数据获取会违反插件契约。 |
CUE模式未声明为 | 模式声明为 | 标记为阻塞问题。所有Perses CUE模式必须声明为 |
仪表板定义中的 | 布局引用 | 标记为阻塞问题。 |
| 仪表板中的变量链断裂 | 变量B通过查询中的 | 标记为阻塞问题。变量评估顺序遵循列表顺序。被依赖的变量必须出现在依赖变量之前。缺失变量会导致静默的空插值。 |
| 数据源范围错误 | 仪表板使用 | 标记为警告。数据源有三个范围: |
percli lintpercli lintpercli lintpercli lintpercli lintpercli lint.cue.cueListuseListResourceListpagesizeListuseListResourceListpagesize| Rationalization | Reality | Required Action |
|---|---|---|
| "It's just a small dashboard JSON change, no need to lint" | Small JSON changes are where typos in | Run |
| "The Go handler works, it just doesn't paginate yet" | "Yet" means never once it ships. Unpaginated list endpoints are tech debt that causes production incidents at scale. | Block the PR until pagination is implemented. |
"The CUE schema is fine without | Open schemas accept any field, defeating the purpose of schema validation. Users will send garbage fields that silently pass validation. | Require |
"This React component doesn't need | Components that manage their own time range break dashboard-level time sync. Users change the time picker and this panel doesn't update. | Use |
| "The variable ordering doesn't matter, the engine resolves dependencies" | The Perses variable engine evaluates in list order, not dependency order. Out-of-order variables produce empty interpolation with no error. | Verify variable dependency order matches list order. |
| 辩解理由 | 实际情况 | 要求操作 |
|---|---|---|
| "这只是一个小的仪表板JSON变更,不需要Lint" | 小型JSON变更正是 | 必须运行 |
| "Go处理器可以正常工作,只是还没实现分页" | "还没实现"意味着一旦发布就永远不会实现。无分页的列表端点是技术债务,会在规模扩大时导致生产事故。 | 阻止PR,直到分页功能实现。 |
"CUE模式没有 | 开放模式会接受任何字段,违背了模式验证的目的。用户将能够发送会静默通过验证的无效字段。 | 要求所有规格结构体使用 |
"这个React组件不需要 | 自行管理时间范围的组件会破坏仪表板级别的时间同步。用户更改时间选择器时,该面板不会更新。 | 使用 |
| "变量顺序无关紧要,引擎会解析依赖关系" | Perses变量引擎按列表顺序评估,而非依赖顺序。顺序错误的变量会产生无错误的空插值。 | 验证变量依赖顺序与列表顺序一致。 |
package mainpackage modelpackage mainuseDataQueriesusePluginfetch()axiosGlobalDatasourceGlobalSecretGlobalVariablekindkindkind: Dashboardpackage mainpackage modelpackage mainuseDataQueriesusePluginfetch()axiosGlobalDatasourceGlobalSecretGlobalVariablekindkindkind: Dashboardpercli lintpackage model$refpercli lintpackage model$ref.go.ts.tsx.cue.json.yamlkind: Dashboardpercli lint.go.ts.tsx.cue.json.yamlkind: Dashboardpercli lint/cmd/pkg/internal/api/v1/*List@perses-dev/*usePluginuseTimeRangeuseDataQueries@perses-dev/plugin-systemfetch()axios@perses-dev/dashboards@perses-dev/componentspackage modelclose({})migrate/migrate.cuepercli lint$ref/cmd/pkg/internal/api/v1/*List@perses-dev/*@perses-dev/plugin-systemusePluginuseTimeRangeuseDataQueriesfetch()axios@perses-dev/dashboards@perses-dev/componentspackage modelclose({})migrate/migrate.cuepercli lint$refpercli lintpercli lint