Revision validation failure reasons expose internal exception details

未关闭
#258 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Start by tracing how revision validation and validation Job messages construct failure reasons; the issue does not name specific files or tests. Check the related issues #119, #139, and #237 for context. Done means user-facing failures use explicitly constructed messages without exception class names or raw exception details, while diagnostic information remains available in server logs.

由索引模型根据 Issue 内容生成。

描述

app: scripts Bucket: KTLO severity: low status: backlog type: bug
Plugin Version

v0.2.0

NetBox Version

v4.7.6

Python Version

3.12

Steps to Reproduce
  1. Create an upload-backed Script Project with deploy.py selected as a Script File.
  2. Upload deploy.py containing import netaddr.absent_submodule.
  3. Wait for the validation Job to finish.
  4. Retrieve the revision through /api/plugins/netbox-scripts/project-revisions/<revision_id>/ and inspect last_validation_failure.
Expected Behavior

The revision remains materialized and records a clear, actionable failure reason without exposing internal exception details.

The original exception is available in the server logs for troubleshooting. The same convention applies to the validation Job's user-facing messages.

Observed Behavior

The revision returns to materialized, but last_validation_failure contains the exception class name and its original message:

ScriptFileImportError: The script file "deploy.py" failed to import. No module named 'netaddr.absent_submodule'

Storage, cache, source corruption and timeout failures also expose exception class names or exception messages.

Failure reasons should consistently use explicitly constructed, user-facing messages while retaining useful diagnostic information.

Related: #119, #139 and #237.

主要语言
Python
星标
9
派生
0
平均合并
18 小时 59 分钟
30 天内合并 PR
93

环境准备

从这里开始

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

netbox-community/netbox-scripts 的其他 Issue

查看 netbox-community/netbox-scripts 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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