Skip to content

Commit

Permalink
grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin committed May 11, 2024
1 parent 4dff111 commit 3199913
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 110 deletions.
12 changes: 3 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,7 @@ For contributors of the repo the build will trigger automatically but for other'
As a contributor you can run the following command to trigger the build and create a TypeSpec playground link for this PR.

```
/azp run TypeSpec Pull Request Try It
```

## Run formatter

Trigger a workflow that will format the code, commit and push.

```
/typespeceng format
/azp run typespec - pr tools
```

# TypeSpec website
Expand All @@ -329,6 +321,8 @@ To release:
- Go to https://github.com/microsoft/typespec/actions/workflows/website-gh-pages.yml
- Click the `Run workflow` dropdown and select the `main` branch.

# Labels for issues and PRs

# TypeSpec Emitters

The various language emitters will live in the in the repo under the following directory structure
Expand Down
207 changes: 112 additions & 95 deletions eng/common/labels.yaml
Original file line number Diff line number Diff line change
@@ -1,97 +1,114 @@
# cspell:ignore bfff

- name: breaking-change
color: B60205
description: A change that might cause specs or code to break
- name: bug
color: cccccc
description: Something isn't working
- name: Client Emitter Migration
color: FD92F0
description: ""
- name: compiler:core
color: "453261"
description: Issues for @typespec/compiler
- name: compiler:emitter-framework
color: "453261"
description: Issues for the emitter framework
- name: deprecation
color: "760205"
description: A previously supported feature will now report a warning and eventually
be removed
- name: design:accepted
color: 1a4421
description: Proposal for design has been discussed and accepted.
- name: design:needed
color: 96c499
description: A design request has been raised that needs a proposal
- name: design:proposed
color: 56815a
description: Proposal has been added and ready for discussion
- name: docs
color: cccccc
description: Improvements or additions to documentation
- name: emitter:client:csharp
color: e1b300
description: ""
- name: emitter:json-schema
color: "957300"
description: ""
- name: emitter:protobuf
color: "957300"
description: The protobuf emitter
- name: emitter:service:csharp
color: "967200"
description: ""
- name: emitter:service:js
color: "967200"
description: ""
- name: eng
color: 65bfff
description: ""
- name: epic
color: cccccc
description: ""
- name: feature
color: cccccc
description: New feature or request
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: ide
color: 846da1
description: Issues for VS, VSCode, Monaco, etc.
- name: lib:http
color: c7aee6
description: ""
- name: lib:openapi
color: c7aee6
description: ""
- name: lib:rest
color: c7aee6
description: ""
- name: lib:versioning
color: c7aee6
description: ""
- name: meta:blog
color: 007dc8
description: Blog updates
- name: meta:website
color: 007dc8
description: TypeSpec.io updates
- name: needs-info
color: ffffff
description: Mark an issue that needs reply from the author or it will be closed
automatically
- name: needs-triage
color: ffffff
description: ""
- name: Service Codegen
color: 7C4B1E
description: ""
- name: triaged:core
color: "5319e7"
description: ""
- name: tspd
color: "004185"
description: Issues for the tspd tool
issue_kinds:
description: "Issue kinds"
labels:
- name: bug
color: cccccc
description: Something isn't working
- name: feature
color: cccccc
description: New feature or request
- name: docs
color: cccccc
description: Improvements or additions to documentation

area:
description: "Area of the codebase"
labels:
- name: compiler:core
color: "453261"
description: Issues for @typespec/compiler
- name: compiler:emitter-framework
color: "453261"
description: Issues for the emitter framework
- name: ide
color: 846da1
description: Issues for VS, VSCode, Monaco, etc.
- name: lib:http
color: c7aee6
description: ""
- name: lib:openapi
color: c7aee6
description: ""
- name: lib:rest
color: c7aee6
description: ""
- name: lib:versioning
color: c7aee6
description: ""
- name: meta:blog
color: 007dc8
description: Blog updates
- name: meta:website
color: 007dc8
description: TypeSpec.io updates
- name: Service Codegen
color: 7C4B1E
description: ""
- name: tspd
color: "004185"
description: Issues for the tspd tool
- name: epic
color: cccccc
description: ""
- name: emitter:client:csharp
color: e1b300
description: ""
- name: emitter:json-schema
color: "957300"
description: ""
- name: emitter:protobuf
color: "957300"
description: The protobuf emitter
- name: emitter:service:csharp
color: "967200"
description: ""
- name: emitter:service:js
color: "967200"
description: ""
- name: eng
color: 65bfff
description: ""

breaking-change:
description: "Labels around annotating issues and PR if they contain breaking change or deprecation"
labels:
- name: breaking-change
color: B60205
description: A change that might cause specs or code to break
- name: deprecation
color: "760205"
description: A previously supported feature will now report a warning and eventually be removed

design-issues:
description: "Design issue management"
labels:
- name: design:accepted
color: 1a4421
description: Proposal for design has been discussed and accepted.
- name: design:needed
color: 96c499
description: A design request has been raised that needs a proposal
- name: design:proposed
color: 56815a
description: Proposal has been added and ready for discussion

misc:
description: "Misc labels"
labels:
- name: Client Emitter Migration
color: FD92F0
description: ""
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: needs-triage
color: ffffff
description: ""
- name: needs-info
color: ffffff
description: Mark an issue that needs reply from the author or it will be closed automatically
- name: triaged:core
color: "5319e7"
description: ""
49 changes: 43 additions & 6 deletions eng/common/scripts/sync-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ const repo = {
};
await main();

interface LabelsConfig {
readonly categories: LabelCategory[];
readonly labels: Label[];
}

interface LabelCategory {
readonly name: string;
readonly description: string;
readonly labels: Label[];
}

interface Label {
readonly name: string;
readonly color: string;
Expand All @@ -29,16 +40,42 @@ async function main() {
},
});
const content = await readFile(labelFile, "utf8");
const labels = parse(content);
logLabels("Labels:", labels);
for (const label of labels) {
validateLabel(label);
}
const labels = loadLabels(content);
logLabelConfig(labels);

if (options.values["update-github-labels"]) {
await updateGithubLabels(labels, { dryRun: options.values["dry-run"] });
await updateGithubLabels(labels.labels, { dryRun: options.values["dry-run"] });
}
}

function loadLabels(yamlContent: string): LabelsConfig {
const data: Record<string, { description: string; labels: Label[] }> = parse(yamlContent);
const labels = [];
const categories: LabelCategory[] = [];
for (const [categoryName, { description, labels: categoryLabels }] of Object.entries(data)) {
const category = { name: categoryName, description, labels: categoryLabels };
categories.push(category);
for (const label of categoryLabels) {
validateLabel(label);
labels.push(label);
}
}
return { labels, categories };
}

function logLabelConfig(config: LabelsConfig) {
console.log("Label config:");
const max = config.labels.reduce((max, label) => Math.max(max, label.name.length), 0);
for (const category of config.categories) {
console.log(` ${pc.green(category.name)} ${pc.gray(category.description)}`);
for (const label of category.labels) {
console.log(` ${prettyLabel(label, max)}`);
}
console.log("");
}
console.log("");
}

function logLabels(message: string, labels: Label[]) {
if (labels.length === 0) {
console.log(message, pc.cyan("none"));
Expand Down

0 comments on commit 3199913

Please sign in to comment.