conda-forge / conda-forge/admin-requests

Add static hosted HTML page with PR builder forms

Đang mở
#968 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
Python
Star
39
Fork
541
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
65

Mô tả

### Comment:

## elevator pitch

Provide a low-barrier way to make precise, pre-validated admin requests.

## motivation

After looking at the GH PR templates feature (suggested in #535), I was unsatisfied with the specificity of the language (as usual, not _quite_ JSON schema),

## design ideas

So I wrote a [thing](https://github.com/deathbeds/jupyak/tree/main/js/demo) that:

- takes in JSON schema
- builds a form with [rjsf](https://rjsf-team.github.io/react-jsonschema-form/)
- makes a yaml/json/toml of the form
- makes a link for new PR based on the input, which can include _exactly on file_

Here's a demo for an _outrageously_ long schema:

https://deathbeds.github.io/jupyak/shaver.html

## challenges

The downside: to get the nice UI (dropdown/autocomplete), all the feedstock names would need to be embedded in the schema, e.g.

```yaml
"feedstocks": {
"type": "array",
"items": {
"type": "string",
"enum": ["aalto-boss", "a-few-others", "zziplib"]
}
}
```

But this might be something that could be generated in one place...

```yaml
{
"$id": "https://conda-forge.org/schema/feedstocks.schema.json",
"type": "string",
"enum": ["aalto-boss", "a-few-others", "zziplib"]
}
```

And then referenced here:

```
{
"feedstocks": {
"type": "array",
"items": {
"$ref": "https://conda-forge.org/schema/feedstocks.schema.json"
}
}
}
```

## implementation ideas

After the... experience... with `pydantic` over on `conda-smithy`, it seems like schema-first design (but perhaps authored in YAML) to get to a [well-typed `TypedDict`](https://github.com/sbrunner/jsonschema-gentypes) might be easier and give strictly better validation.

## alternatives

- use the semi-decent [Issue form](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms) to generate PRs
- the specification language is _also_ not-quite-schema, and not portable to anything else
- an action would have to re-parse the generated markdown
- the generated PR is not editable by the original owner with more complexity
- use a bot pidgin grammar
- these are harder to discover, and don't have autocomplete (other than the bot name)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.