From 6e61aa84d66ad1f6fdf87628780420211b97d21b Mon Sep 17 00:00:00 2001 From: Jeff Mesnil Date: Thu, 27 Jun 2024 11:12:43 +0200 Subject: [PATCH 1/5] Update template and checks * Update the template to move the tracking issue and the stability level to the front matter * When a PR is open, check that these fields are valid * Generate a HTML page for the proposal with these fields. Signed-off-by: Jeff Mesnil --- .scripts/check_proposals | 33 +++++++++ _includes/index-categories.html | 8 ++- _layouts/proposal.html | 10 ++- design-doc-template.adoc | 123 ++++++++++++-------------------- 4 files changed, 95 insertions(+), 79 deletions(-) diff --git a/.scripts/check_proposals b/.scripts/check_proposals index 594ab165..6a134d66 100755 --- a/.scripts/check_proposals +++ b/.scripts/check_proposals @@ -37,6 +37,21 @@ class MetadataChecker else system("gh pr edit #{pr_number} --remove-label invalid-categories") end + issue_errors = check_issue(pr_number, front_matter) + if issue_errors.length() > 0 + errors << issue_errors + system("gh pr edit #{pr_number} --add-label missing-issue") + else + system("gh pr edit #{pr_number} --remove-label missing-issue") + end + stability_level_error = check_stability_level(pr_number, front_matter) + if stability_level_error.length() > 0 + errors << stability_level_error + system("gh pr edit #{pr_number} --add-label invalid-stability-level") + else + system("gh pr edit #{pr_number} --remove-label invalid-stability-level") + end + errors end @@ -54,6 +69,24 @@ class MetadataChecker errors end + def check_issue pr_number, front_matter + errors = [] + unless (front_matter.key? "issue") && (front_matter["issue"] != nil) + errors << "Missing field: issue" + end + errors + end + + def check_stability_level pr_number, front_matter + stability_levels = ["experimental", "preview", "community", "default"] + + errors = [] + unless (front_matter.key? "stability-level") && (stability_levels.include? front_matter["stability-level"]) + errors << "Invalid field: stability-level" + end + errors + end + def load_all_categories yaml = YAML.load_file("_data/wildfly-categories.yaml") return yaml["categories"] diff --git a/_includes/index-categories.html b/_includes/index-categories.html index bbddadac..4bf3fd47 100644 --- a/_includes/index-categories.html +++ b/_includes/index-categories.html @@ -28,7 +28,13 @@

{{ cat.name }} [{{ cat.id }}]

{% for page in site.pages %} {% endfor %} diff --git a/_layouts/proposal.html b/_layouts/proposal.html index 4b7cfa1a..4f51cec0 100644 --- a/_layouts/proposal.html +++ b/_layouts/proposal.html @@ -4,7 +4,12 @@
-

{{page.title}}

+

+ {% if page.stability-level != "default" or page.stability-level != "community" %} + [{{ page.stability-level }}]  + {% endif %} + {{page.title}} +

{% unless pages.categories == empty %} @@ -14,6 +19,9 @@

{{page.title}}

{% endfor %}
{% endunless %} +
Tracked by  + {{ page.issue }} +
{{ content }}
diff --git a/design-doc-template.adoc b/design-doc-template.adoc index e0ce62b1..4b6bd049 100644 --- a/design-doc-template.adoc +++ b/design-doc-template.adoc @@ -4,8 +4,16 @@ categories: # - core # - management # if missing, add it to _data/widfly-categories and use its id +# +# Specify the stability level of the feature. +# Values can be one of: experimental preview community default +stability-level: +# Specify the main issue of the feature +# Most of the time, it will be a issue in https://issues.redhat.com/browse/WFLY +# or https://issues.redhat.com/browse/WFCORE +issue: --- -= [Experimental|Preview|Community|default]Template += :author: Your Name :email: your.email@redhat.com :toc: left @@ -13,95 +21,63 @@ categories: :idprefix: :idseparator: - -== Overview - -== Issue Metadata - -=== Issue - -* https://issues.redhat.com/browse/WFCORE[WFCORE-XXXX] - -=== Related Issues - -* https://issues.redhat.com/browse/WFLY[WFLY-XXXX] - -=== Stability Level -// Choose the planned stability level for the proposed functionality -* [ ] Experimental - -* [ ] Preview +____ -* [ ] Community - -* [ ] default - -=== Dev Contacts - -* mailto:{email}[{author}] +== Overview -=== QE Contacts +____ -=== Testing By -// Put an x in the relevant field to indicate if testing will be done by Engineering or QE. -// Discuss with QE during the Kickoff state to decide this -* [ ] Engineering -* [ ] QE +== Affected Projects or Components -=== Affected Projects or Components +____ === Other Interested Projects === Relevant Installation Types -// Remove the x next to the relevant field if the feature in question is not relevant -// to that kind of WildFly installation -* [x] Traditional standalone server (unzipped or provisioned by Galleon) -* [x] Managed domain +____. -* [x] OpenShift s2i - -* [x] Bootable jar +* Traditional standalone server (unzipped or provisioned by Galleon) +* Managed domain +* OpenShift Source-to-Image (S2I) +* Bootable jar == Requirements -=== Hard Requirements - -=== Nice-to-Have Requirements -// Requirements in this section do not have to be met to merge the proposed functionality. -// Note: Nice-to-have requirements that don't end up being implemented as part of -// the work covered by this proposal should be moved to the 'Future Work' section. - +____ === Non-Requirements -// Use this section to explicitly discuss things that readers might think are required -// but which are not required. + +____ === Future Work -// Use this section to discuss requirements that are not addressed by this proposal -// but which may be addressed in later proposals. + +____ == Backwards Compatibility -// Does this enhancement affect backwards compatibility with previously released -// versions of WildFly? -// Can the identified incompatibility be avoided? +____ === Default Configuration +____ + === Importing Existing Configuration +____ + === Deployments +____ + === Interoperability -//== Implementation Plan -//// -Delete if not needed. The intent is if you have a complex feature which can -not be delivered all in one go to suggest the strategy. If your feature falls -into this category, please mention the Release Coordinators on the pull -request so they are aware. -//// +____ + +== Implementation Plan + +____ == Admin Clients @@ -109,14 +85,11 @@ ____ == Test Plan -Depending on the selected stability level, the appropriate section below should be completed, including a brief description of how testing is to be performed in accordance with the selected stability level. The non-relevant sections may be removed as needed. +____ //// Depending on the stability level, the test plan required may vary. see below: //// @@ -134,16 +107,12 @@ Depending on the stability level, the test plan required may vary. see below: ** Default - This stability level is reserved and requires approval by a professional Quality Engineer with subject matter expertise. == Community Documentation -//// -Generally a feature should have documentation as part of the PR to wildfly main, or as a follow up PR if the feature is in wildfly-core. In some cases though the documentation belongs more in a component, or does not need any documentation. Indicate which of these will happen. -//// + +____ + +** Default - This stability level is reserved and requires approval by a professional Quality Engineer with subject matter expertise. + == Release Note Content -//// -Draft verbiage for up to a few sentences on the feature for inclusion in the -Release Note blog article for the release that first includes this feature. -Example article: http://wildfly.org/news/2018/08/30/WildFly14-Final-Released/. -This content will be edited, so there is no need to make it perfect or discuss -what release it appears in. "See Overview" is acceptable if the overview is -suitable. For simple features best covered as an item in a bullet-point list -of features containing a few words on each, use "Bullet point: " -//// + +____ From caae72f1641e2a9936ce1fd6471406052b6c7116 Mon Sep 17 00:00:00 2001 From: Jeff Mesnil Date: Thu, 4 Jul 2024 08:44:44 +0200 Subject: [PATCH 2/5] Add labels for the stability-levels Based on the value of the `stability-level` field in the front matter, add a label `stability-level/xxx` to the PR. Signed-off-by: Jeff Mesnil --- .scripts/check_proposals | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.scripts/check_proposals b/.scripts/check_proposals index 6a134d66..7ee64684 100755 --- a/.scripts/check_proposals +++ b/.scripts/check_proposals @@ -25,6 +25,7 @@ end class MetadataChecker def initialize @categories = load_all_categories() + @stability_levels = ["experimental", "preview", "community", "default"] end def check pr_number, front_matter @@ -44,12 +45,16 @@ class MetadataChecker else system("gh pr edit #{pr_number} --remove-label missing-issue") end - stability_level_error = check_stability_level(pr_number, front_matter) - if stability_level_error.length() > 0 - errors << stability_level_error - system("gh pr edit #{pr_number} --add-label invalid-stability-level") - else + begin + stability_level, err = check_stability_level(pr_number, front_matter) system("gh pr edit #{pr_number} --remove-label invalid-stability-level") + # remove any previous stability-levels + @stability_levels.map { | level | system("gh pr edit #{pr_number} --remove-label stability-level/#{level}") } + system("gh pr edit #{pr_number} --add-label stability-level/#{stability_level}") + rescue => error + errors << error.message + system("gh pr edit #{pr_number} --add-label invalid-stability-level") + @stability_levels.map { | level | system("gh pr edit #{pr_number} --remove-label stability-level/#{level}") } end errors @@ -78,13 +83,11 @@ class MetadataChecker end def check_stability_level pr_number, front_matter - stability_levels = ["experimental", "preview", "community", "default"] - - errors = [] - unless (front_matter.key? "stability-level") && (stability_levels.include? front_matter["stability-level"]) - errors << "Invalid field: stability-level" + unless (front_matter.key? "stability-level") && (@stability_levels.include? front_matter["stability-level"]) + raise "Invalid field: stability-level" + else + return front_matter["stability-level"] end - errors end def load_all_categories From afd7f2ecf33ce3820e146aac679999413b9522e6 Mon Sep 17 00:00:00 2001 From: Jeff Mesnil Date: Fri, 4 Oct 2024 09:23:39 +0200 Subject: [PATCH 3/5] Update template * bring back Related Issues sections * clarify the issue metadata semantic Signed-off-by: Jeff Mesnil --- _layouts/proposal.html | 2 +- design-doc-template.adoc | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/_layouts/proposal.html b/_layouts/proposal.html index 4f51cec0..c68b75dc 100644 --- a/_layouts/proposal.html +++ b/_layouts/proposal.html @@ -19,7 +19,7 @@

{% endfor %}

{% endunless %} -
Tracked by  +
Tracked by {{ page.issue }}
diff --git a/design-doc-template.adoc b/design-doc-template.adoc index 4b6bd049..a2955f60 100644 --- a/design-doc-template.adoc +++ b/design-doc-template.adoc @@ -8,9 +8,10 @@ categories: # Specify the stability level of the feature. # Values can be one of: experimental preview community default stability-level: -# Specify the main issue of the feature -# Most of the time, it will be a issue in https://issues.redhat.com/browse/WFLY -# or https://issues.redhat.com/browse/WFCORE +#Specify the Feature Development tracker issue for the feature. +# This must be an issue tracked in https://github.com/orgs/wildfly/projects/7/views/1. +# To create a Feature Development tracker issue, go to https://github.com/wildfly/wildfly-proposals/issues/new/choose +# and select 'Feature Development' issue: --- = @@ -27,6 +28,9 @@ ____ +== Related Issues + +____ == Affected Projects or Components From 10fb0514feb9880b726a476d15f328062cd41890 Mon Sep 17 00:00:00 2001 From: Jeff Mesnil Date: Fri, 4 Oct 2024 09:25:16 +0200 Subject: [PATCH 4/5] Display community stability-level Signed-off-by: Jeff Mesnil --- _includes/index-categories.html | 2 +- _layouts/proposal.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/index-categories.html b/_includes/index-categories.html index 4bf3fd47..87194629 100644 --- a/_includes/index-categories.html +++ b/_includes/index-categories.html @@ -29,7 +29,7 @@

{{ cat.name }} [{{ cat.id }}]