Move the func.yaml schema generator off the archived alecthomas/jsonschema
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
調査の方向性
Start in schema/generator/main.go, where the reflector is built from github.com/alecthomas/jsonschema, and in pkg/functions/function_options.go, where the jsonschema and jsonschema_extras tags and the scale minimum workaround live. Swap the import to github.com/invopop/jsonschema, regenerate schema/func_yaml-schema.json, and diff it. Done when the schema is regenerated, make check-schema passes, and the draft-04 output decision is recorded.
索引モデルが issue の本文から書いたものです。
説明
schema/generator builds schema/func_yaml-schema.json with github.com/alecthomas/jsonschema, which was archived in 2022 ("Maintenance has moved to https://github.com/invopop/jsonschema"). Its limits now show up as workarounds in our own code:
minimumis anintparsed withstrconv.Atoi, so a fractional minimum such asscale.kpa.target's0.01silently becomes0. #4067 patches that one field after reflection.- A zero
minimumis omitted, which is why the scale fields declareminimumthroughjsonschema_extras(see the comment above the scale tags inpkg/functions/function_options.go). - Tag descriptions can't contain commas (another comment in
function_options.go).
The maintained successor, github.com/invopop/jsonschema (v0.14.0), keeps the same shape: Reflector, AddGoComments, and the jsonschema / jsonschema_extras tags. It represents minimum/maximum as numbers, so fractional and zero bounds work from the tag directly. The generator is the only Go code that imports the library, so the change is contained.
Possible path:
- Swap the import in
schema/generator/main.go, regenerate, and diff the schema. - Move
minimumback into thejsonschematag wherejsonschema_extrasonly worked around zero being dropped. Remove the generator patch from #4067. - Decide on the draft version. invopop emits 2020-12 with
$defs, where we publish draft-04 withdefinitions. Either keep draft-04 output, or confirm the YAML language server and editors that consume the schema handle 2020-12 before switching.exclusiveMinimumalso changes from a boolean to a number between those drafts. make check-schemakeeps the committed schema in step.
Not urgent: the published schema is only looser than the runtime validation in a few edge cases, and the deploy still rejects invalid values with a clear error.
- 主要言語
- Go
- スター
- 366
- フォーク
- 231
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 50
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
knative/func のほかの issue
-
help wanted kind/good-first-issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
knative/func#4191 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
MCP config_git_set exposes the GitHub token on the func subprocess command line対応中かも @anjalirj27 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
メンテナーはふだん 2 日以内に返信
-
Deprecation of legacy parliament Python functions (removal in 1.26)対応中かも @gauron99 が 4 日前に担当しました。 オープンkind/cleanup lifecycle/frozen
knative/func#4185 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Function CR sync should keep the spec fields func does not set対応中かも @gauron99 が 13 日前に担当しました。 オープン
knative/func#4156 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
OCI pusher panics when reused for a second upload対応中かも @shreyashsri79 が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
[Bug]: gate 缺失オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every command対応中かも @k4kratik が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sachincool/cruft#4 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
VictoriaMetrics/VictoriaLogs#1965 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug sig/ui
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
kubermatic/dashboard#8540 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elastic/elastic-package#4249 ·
メンテナーはふだん 1 日以内に返信