Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[meta] refactor scripts to stop importing scriptworker, start importing scriptworker_client

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

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
cli, tooling

调研方向

首先定位导入 scriptworker 的脚本,并将它们的命令行入口点与 scriptworker_client 进行比较。阅读 Testing iscript wiki 页面及其中关于通过 create_test_workdir 进行独立执行的指导。完成的标准是:脚本不再依赖 scriptworker 上下文对象,同时保留命令行 API。

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

描述

Part of the rationale of having scriptworker call a script from the commandline, rather than import a python module and call a function, was to make the script independent of scriptworker. In theory this would:

  1. let us upgrade scriptworker without affecting scripts, as long as that commandline api stayed consistent,
  2. allow us to test scripts standalone, rather than requiring the worker,
  3. allow for a mixture of languages and python versions

(3) is currently no longer an issue. We've standardized on python 3. However, we still have the option of supporting other languages, especially if some other team wants to start using scriptworkers.

(2) has been theoretical, and still has some issues with user friendliness and discoverability. The testing iscript wiki page shows it's possible to test a script without scriptworker, especially when using the create_test_workdir script from scriptworker to populate the work_dir with a known task's task.json and CoT upstreamArtifacts.

The main thing we're solving here is (1). Because many scripts import scriptworker, upgrading scriptworker may still break those scripts, even if the commandline api stays consistent. Let's import scriptworker_client instead.

Doing so isn't just a simple drop-in replacement, however. scriptworker_client removes the usage of context objects, so this may be a sizeable patch set per script. But once we do this, we'll once more be able to upgrade scriptworker without fear of breaking the script, and we will be able to make all script-related changes in this repo rather than across two repos. (And the vocal opponents to the context objects will be appeased. :)

主要语言
Python
星标
16
派生
38
平均合并
1 天 7 小时
30 天内合并 PR
14

贡献指南

这个仓库没有索引到贡献指南

从这里开始

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

mozilla-releng/scriptworker-scripts 的其他 Issue

查看 mozilla-releng/scriptworker-scripts 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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