Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Template Forms #140

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .githooks/pre-commit
moritztim marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ if [[ $files =~ .circleci/config.pkl ]]; then
pkl eval .circleci/config.pkl -o .circleci/config.yml
git add .circleci/config.yml
fi

if [[ $files =~ \.github/ISSUE_TEMPLATE/.*\.pkl ]]; then
for file in .github/ISSUE_TEMPLATE/*.pkl; do
pkl eval $file -f yaml -o ${file%.pkl}.yml
git add ${file%.pkl}.yml
done
moritztim marked this conversation as resolved.
Show resolved Hide resolved
fi
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/language_bindings_request.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import "pkl:reflect"
name = "Language Bindings Request"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to postpone, because you might be able to iterate faster without, but adding a template for this (and start this with amends "path/to/template/maybe/even/package/on/pkl-pantry") would give you the full Pkl experience ;)

You can also start by just putting type annotations in this file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about doing something like that but then I decided to just write the yml assisted by the existing template and basing the pkl on that, since it's not gonna be changed a lot and I didn't wanna bury myself in a rabbithole.
I'm not gonna go that deep atm but I bet as this gets more popular someone is gonna make a template that can then be used here.
Really seeing the use-cases of this language tho :D

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will write a template tho, where should I put that? I don't think it makes sense to put it in the ISSUE_TEMPLATE folder or one might confuse it with an actual issue template that didn't get rendered by accident. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a very general sense; you can publish packages anywhere you like (that's just FYI for whatever else you might be looking to create templates for). All repositories maintained by the core Pkl team should really only be use packages in those repositories. This could be an excellent contribution to pkl-pantry. It's worth having a think about naming. I'm hesitant to suggest com.github as a package name, because that would suggest an authoritative source, but maybe com.github.contrib? (cc @bioball).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was gonna write just a template for this specific usecase, not a completely generalized one. This would just include the "GENERATED" message and shared attributes between similar templates. Obviously that's not really necessary, but I wanted to try out some of the features of pkl, without writing a complete implementation of github's issue form standard.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: package name: I think com.github is entirely reasonable, as long as the templates simply represent a schema in the target domain.

Maybe the name should be more narrowly scoped, though? How about we call this com.github.issueTemplate? There's also GitHub Actions, which we probably don't want to group together with this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d keep it local and remove the amends before commit

@holzensp what did you mean by this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^ that as assuming you would amends "path/to/template/maybe/even/package/on/pkl-pantry"

Considering all your templates will have a name: String, description: String, title: String, Labels: Listing<SomeMeaningfulEnum>, body: Listing<BodyPart>, I would consider rolling a template for that.

If you follow the above advice about multi-file; the template would simply produce zero output files, so you can still evaluate *.pkl without issue. Keeping the template in this directory, instead of publishing it to pkl-pantry also communicates "this isn't a general implementation of the GitHub Issues API, it's just something used here."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"this isn't a general implementation of the GitHub Issues API, it's just something used here."

Exactly. If there is enough demand, someone is gonna make a full suite of GitHub scoped templates, I'll leave that to them and use a simple template for this use case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my question remains, where should I put the template file?

description = "Request for Pkl bindings for a programming language."
title = "[Bindings Request]: "
labels {
"bindings"
"enhancement"
}
body {
new {
type = "markdown"
attributes {
value = """
## Language Bindings Request
Thank you for your interest in expanding the compatibility of Pkl!
Before you fill out this request form, please do the following:
- Check the [documentation](https://pkl-lang.org/main/current/language-bindings.html) to confirm that this language isn't already supported.
- Search for [existing issues and pull requests](https://github.com/apple/pkl/issues?q="label%3Abindings+) to ensure this bindings request has not already been submitted."
"""
}
}
new {
type = "checkboxes"
id = "readiness"
attributes {
label = "Confirmation"
description = "Please confirm the following items before submitting a new request."
options {
new {
label = "I have checked the documentation to confirm this language isn't already supported."
required = true
}
new {
label = "I have searched for existing issues and pull requests to ensure this bindings request has not already been submitted."
required = true
}
}
}
}
new {
type = "input"
id = "language-name"
attributes {
label = "Language Name"
description = "What is the name of the programming language for which you're requesting bindings?"
}
validations {
required = true
}
}
new {
type = "textarea"
id = "pitch"
attributes {
label = "Pitch"
description = "Why should we add support for this language?"
}
}
new {
type = "textarea"
id = "additional-info"
attributes {
label = "Additional Information (Optional)"
description = "Any other information you'd like to add"
}
validations {
required = false
}
}
}
moritztim marked this conversation as resolved.
Show resolved Hide resolved

output {
text = """
# This file is GENERATED and should not be edited manually. Edit \(reflect.Module(module).name).pkl instead.
\(super.text)
"""
}
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/language_bindings_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file is GENERATED and should not be edited manually. Edit language_bindings_request.pkl instead.
name: Language Bindings Request
description: Request for Pkl bindings for a programming language.
title: '[Bindings Request]: '
labels:
- bindings
- enhancement
body:
- type: markdown
attributes:
value: |-
## Language Bindings Request
Thank you for your interest in expanding the compatibility of Pkl!
Before you fill out this request form, please do the following:
- Check the [documentation](https://pkl-lang.org/main/current/language-bindings.html) to confirm that this language isn't already supported.
- Search for [existing issues and pull requests](https://github.com/apple/pkl/issues?q="label%3Abindings+) to ensure this bindings request has not already been submitted."
- type: checkboxes
id: readiness
attributes:
label: Confirmation
description: Please confirm the following items before submitting a new request.
options:
- label: I have checked the documentation to confirm this language isn't already supported.
required: true
- label: I have searched for existing issues and pull requests to ensure this bindings request has not already been submitted.
required: true
- type: input
id: language-name
attributes:
label: Language Name
description: What is the name of the programming language for which you're requesting bindings?
validations:
required: true
- type: textarea
id: pitch
attributes:
label: Pitch
description: Why should we add support for this language?
- type: textarea
id: additional-info
attributes:
label: Additional Information (Optional)
description: Any other information you'd like to add
validations:
required: false
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/output_format_request.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import "pkl:reflect"
name = "Output Format Request"
description = "Request for a output format to be added to Pkl"
title = "[Output Format Request]: "
labels {
"output-formats"
"enhancement"
}
body {
new {
type = "markdown"
attributes {
value = """
## Output Format Request
Thank you for your interest in expanding the compatibility of Pkl!
Before you fill out this request form, please do the following:
- Check the [documentation](https://pkl-lang.org/main/current/pkl-cli/index.html#options) (under `-f`, `--format`) to confirm that this format isn't already supported.
- Search for [existing issues and pull requests](https://github.com/apple/pkl/issues?q="label%3Arender-formats+) to ensure this output format request has not already been submitted."
"""
}
}
new {
type = "checkboxes"
id = "readiness"
attributes {
label = "Confirmation"
description = "Please confirm the following items before submitting a new request."
options {
new {
label = "I have checked the documentation to confirm this format isn't already supported."
required = true
}
new {
label = "I have searched for existing issues and pull requests to ensure this rendering request has not already been submitted."
required = true
}
}
}
}
new {
type = "input"
id = "format-name"
attributes {
label = "Format Name"
description = "What is the name of the configuration format that you are requesting to be added?"
}
validations {
required = true
}
}
new {
type = "textarea"
id = "pitch"
attributes {
label = "Pitch"
description = "Why should we add support for this format?"
}
}
new {
type = "textarea"
id = "additional-info"
attributes {
label = "Additional Information (Optional)"
description = "Any other information you'd like to add"
}
validations {
required = false
}
}
}

output {
text = """
# This file is GENERATED and should not be edited manually. Edit \(reflect.Module(module).name).pkl instead.
\(super.text)
"""
}
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/output_format_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file is GENERATED and should not be edited manually. Edit output_format_request.pkl instead.
name: Output Format Request
description: Request for a output format to be added to Pkl
title: '[Output Format Request]: '
labels:
- output-formats
- enhancement
body:
- type: markdown
attributes:
value: |-
## Output Format Request
Thank you for your interest in expanding the compatibility of Pkl!
Before you fill out this request form, please do the following:
- Check the [documentation](https://pkl-lang.org/main/current/pkl-cli/index.html#options) (under `-f`, `--format`) to confirm that this format isn't already supported.
- Search for [existing issues and pull requests](https://github.com/apple/pkl/issues?q="label%3Arender-formats+) to ensure this output format request has not already been submitted."
- type: checkboxes
id: readiness
attributes:
label: Confirmation
description: Please confirm the following items before submitting a new request.
options:
- label: I have checked the documentation to confirm this format isn't already supported.
required: true
- label: I have searched for existing issues and pull requests to ensure this rendering request has not already been submitted.
required: true
- type: input
id: format-name
attributes:
label: Format Name
description: What is the name of the configuration format that you are requesting to be added?
validations:
required: true
- type: textarea
id: pitch
attributes:
label: Pitch
description: Why should we add support for this format?
- type: textarea
id: additional-info
attributes:
label: Additional Information (Optional)
description: Any other information you'd like to add
validations:
required: false