Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 11 additions & 8 deletions .github/ISSUE_TEMPLATE/arch-board-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,22 @@ body:
placeholder: "https://github.com/Azure/azure-sdk/issues/..."

# ── About the Client Library ───────────────────────────────────
- type: checkboxes
- type: dropdown
id: languages
attributes:
label: Languages for this Review
description: "Select all languages that need to be reviewed. You must provide the required artifacts for each selected language in the sections below."
multiple: true
options:
- label: ".NET"
- label: "Java"
- label: "Python"
- label: "TypeScript"
- label: "Go"
- label: "C++"
- label: "Rust"
- ".NET"
- "Java"
- "Python"
- "TypeScript"
- "Go"
- "C++"
- "Rust"
validations:
required: true

# ── Artifacts Required (per language) ──────────────────────────
- type: markdown
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/src/arch-board-review/issue-parsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,30 @@ function isChecked(body, label) {
return regex.test(body);
}

function getDropdownSelections(body, heading) {
const section = getLanguageSection(body, heading);
if (!section) {
return [];
}

// A multi-select dropdown renders its chosen values immediately after the
// heading (e.g. "Java, Python"). Only look at that leading value block,
// before any horizontal rule or markdown sub-heading that follows it.
const valueBlock = section.split(/\n(?:---|#{1,6}\s)/)[0];
return valueBlock
.split(/[\n,]+/)
.map((token) => token.trim())
.filter(Boolean);
}

function getSelectedLanguages(issueBody) {
return LANGUAGE_DEFINITIONS.filter((language) => isChecked(issueBody, language.label));
// Tolerant of both renderings: the legacy checkbox group (- [x] Java) and a
// required multi-select dropdown (comma-separated values under the heading).
const dropdownSelections = getDropdownSelections(issueBody, "Languages for this Review");
return LANGUAGE_DEFINITIONS.filter(
(language) =>
isChecked(issueBody, language.label) || dropdownSelections.includes(language.label),
);
}

function getLanguageSection(body, heading) {
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test/arch-board-review/issue-parsing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ describe("issue-parsing", () => {
]);
});

it("detects languages selected via a multi-select dropdown (comma-separated values)", () => {
const issueBody = `
### Languages for this Review

Java, Python, C++

---
## Artifacts Required (per language)

For each selected language above, fill in the links below.

### .NET
Leave blank if .NET is not selected above.
`;

expect(getSelectedLanguages(issueBody).map((language) => language.id)).toEqual([
"java",
"python",
"cpp",
]);
});

it("extracts a language section until the next heading", () => {
const issueBody = `
### Java
Expand Down
Loading