From 0478d203648e9ca2dace835e0c89c3c2a3599e6b Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Fri, 2 Aug 2024 12:53:20 +0200 Subject: [PATCH] Use Discussions for ideas and questions --- .../org/metaborg/repoman/meta/RepoMetadata.kt | 6 ++- .../resources/templates/CONTRIBUTING.md.kte | 41 +++++++++++++++---- .../github/ISSUE_TEMPLATE/config.yml.kte | 22 +++++++--- .../metaborg/repoman/GenerateCommandTests.kt | 3 +- 4 files changed, 56 insertions(+), 16 deletions(-) diff --git a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt index f3539b7..baa8f36 100644 --- a/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt +++ b/repoman/src/main/kotlin/org/metaborg/repoman/meta/RepoMetadata.kt @@ -209,8 +209,10 @@ data class GithubIssueTemplates( val update: Boolean = generate, /** Whether to automatically assign developers to issues. */ val assignDevelopers: Boolean = true, - /** Whether to use the GitHub Discussions tab. */ - val useDiscussions: Boolean = true, + /** The category for Ideas/Feature Requests in the Discussions feature; or `null` to not use it. */ + val ideasDiscussionCategory: String? = "ideas", + /** The category for Questions in the Discussions feature; or `null` to not use it. */ + val questionsDiscussionCategory: String? = "q-a", /** The type label to apply to bugs; or `null` to not apply a label. */ val bugTypeLabel: String? = "bug", /** The type label to apply to feature requests; or `null` to not apply a label. */ diff --git a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte index 8a62296..a64c93e 100644 --- a/repoman/src/main/resources/templates/CONTRIBUTING.md.kte +++ b/repoman/src/main/resources/templates/CONTRIBUTING.md.kte @@ -19,15 +19,31 @@ Thank you for wanting to contribute to this project! :tada::+1: > for this project, or even outright reject it. #### **You have a question?** -Search the [Discussions][1] and [Stackoverflow][3] to see whether your question +@if(meta.files.githubIssueTemplates.questionsDiscussionCategory != null) +Search the [Discussions][questions] to see whether your question has already been answered, or ask your question there. Please do **not** make an issue on the Github repository. +@else +Please check the links on the [New Issue][new-issue] page, +or find more info on the [Spoofax Support][support] page. +@endif + + +#### **You have an idea or feature request?** +@if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) +Search the [Discussions][ideas] to see whether your question +has already been answered, or ask your question there. +Please do **not** make an issue on the Github repository. +@else +Please check the links on the [New Issue][new-issue] page, +or find more info on the [Spoofax Support][support] page. +@endif #### **You found a bug** -Search the [Issues][2] to ensure the bug has not been reported before. +Search the [Issues][issues] to ensure the bug has not been reported before. -If the bug is new, open a new issue with a _clear title and description_. +If the bug is new, [open a new issue][new-issue] with a _clear title and description_. Please indicate: - what you did, - what you expected to happen, and @@ -48,7 +64,11 @@ Thank you! Please open a GitHub pull request with the patch. #### **You wrote a patch that adds a new feature or changes an existing one** -Please open an issue _first_, so we can discuss the change. +@if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) +Please [create a discussion topic][ideas] _first_, so we can discuss the change. +@else +Please [open an issue][new-issue] _first_, so we can discuss the change. +@endif #### **You want to contribute to the documentation or test suite** @@ -60,6 +80,13 @@ Thanks! :heart: :heart: :heart: [Programming Languages Group](https://pl.ewi.tudelft.nl/), [Delft University of Technology](https://www.tudelft.nl/) -[1]: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions -[2]: https://github.com/${meta.repoOwner}/${meta.repoName}/issues -[3]: https://stackoverflow.com/ +@if(meta.files.githubIssueTemplates.questionsDiscussionCategory != null) +[questions]: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.questionsDiscussionCategory} +@endif +@if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) +[ideas]: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.ideasDiscussionCategory} +@endif +[issues]: https://github.com/${meta.repoOwner}/${meta.repoName}/issues +[new-issue]: https://github.com/${meta.repoOwner}/${meta.repoName}/issues/new/choose +[support]: https://spoofax.dev/support/ + diff --git a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte index 2f322ac..9f0988f 100644 --- a/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte +++ b/repoman/src/main/resources/templates/github/ISSUE_TEMPLATE/config.yml.kte @@ -9,19 +9,29 @@ @endif blank_issues_enabled: false contact_links: - - name: 📚 Spoofax Documentation + - name: 📚 Spoofax 2 Documentation url: https://www.spoofax.dev/ - about: Documentation about Spoofax and all included Meta-Languages. + about: Spoofax 2 documentation and all included meta-languages. + @if(meta.documentationLink != null) + - name: 📚 ${meta.title} Documentation + url: ${meta.documentationLink} + about: Documentation for this project. + @endif - name: ⁉️ Spoofax Support Page url: https://www.spoofax.dev/support about: Information on Spoofax Support, and how to get in touch. - name: 🙋🏽 Spoofax Users Channel url: https://slde.slack.com/archives/C7254SF60 about: The Spoofax Users channel on Slack. See the Spoofax Support Page on how to gain access. - @if(meta.files.githubIssueTemplates.useDiscussions) - - name: 💬 Discussions - url: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/ - about: Alternatively, ask questions in the Discussions tab. + @if(meta.files.githubIssueTemplates.questionsDiscussionCategory != null) + - name: 🙏 Ask a Question + url: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.questionsDiscussionCategory} + about: Ask questions in the Discussions. + @endif + @if(meta.files.githubIssueTemplates.ideasDiscussionCategory != null) + - name: 💡 Propose an Idea or Feature + url: https://github.com/${meta.repoOwner}/${meta.repoName}/discussions/categories/${meta.files.githubIssueTemplates.ideasDiscussionCategory} + about: Propose ideas and feature requests in the Discussions. @endif - name: 🛡️ Security issue url: https://github.com/${meta.repoOwner}/${meta.repoName}/security/advisories/new diff --git a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt index 0573b79..8a14a40 100644 --- a/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt +++ b/repoman/src/test/kotlin/org/metaborg/repoman/GenerateCommandTests.kt @@ -139,7 +139,8 @@ class GenerateCommandTests: FunSpec({ generate: true update: true assignDevelopers: true - useDiscussions: true + ideasDiscussionCategory: "feature-requests" + questionsDiscussionCategory: "ask-a-question" bugTypeLabel: "Type-Bug" featureRequestTypeLabel: "Type-Enhancement" questionTypeLabel: "Type-Question"