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

updates to the label normalization tool #151

Merged
merged 1 commit into from
Aug 22, 2023
Merged
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
23 changes: 18 additions & 5 deletions pkgs/repo_manage/lib/labels_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'src/common.dart';
/// currently in use by various dart-lang repos.
final Map<String, List<String>> synonyms = {
'closed-as-intended': [
'as designed',
'resolution: intended',
'resolution: works as intended',
],
Expand All @@ -25,6 +26,7 @@ final Map<String, List<String>> synonyms = {
'resolution: wontfix',
'wontfix',
],
'closed-stale': ['assumed stale'],
'contributions-welcome': ['help wanted', 'state: help wanted'],
'P0': ['p0 critical', 'p0', 'p0-critical'],
'P1': ['p1 high', 'p1', 'p1-high'],
Expand All @@ -39,9 +41,14 @@ final Map<String, List<String>> synonyms = {
],
'type-bug': ['bug', 'type: bug'],
'type-code-health': ['code health'],
'type-documentation': ['documentation', 'docs'],
'type-enhancement': ['enhancement', 'type: enhancement'],
'type-infra': ['github_actions', 'infrastructure', 'infra'],
'type-documentation': ['docs', 'documentation', 'Type: documentation'],
'type-enhancement': [
'enhancement',
'feature',
'feature-request',
'type: enhancement',
],
'type-infra': ['github_actions', 'infra', 'infrastructure'],
'type-performance': ['performance', 'type: perf'],
'type-question': ['question', 'type: question'],
'type-ux': ['ux'],
Expand All @@ -55,6 +62,10 @@ final Set<String> allowList = {
'Epic',
'meta',
'P4',
'S0',
'S1',
'S2',
'S3',
};

/// The cannonical set of dart-lang labels.
Expand All @@ -69,12 +80,14 @@ class LabelsUpdateCommand extends ReportCommand {
'Audit and update the labels used by dart-lang repos.') {
argParser.addFlag(
'dry-run',
aliases: ['audit'],
negatable: false,
help: "Audit the labels used but don't make any changes to the given "
'repos.',
);
argParser.addFlag(
'apply-changes',
aliases: ['apply'],
negatable: false,
help: 'Rename, edit, and add labels to bring them in line with those '
"at $templateRepoSlug.\nWARNING: this will make changes to a repo's "
Expand Down Expand Up @@ -126,7 +139,7 @@ class LabelsUpdateCommand extends ReportCommand {

for (var slug in repoSlugs) {
print('');
print('## $slug');
print('## $slug (https://github.com/$slug/labels)');

final labelsEncountered = <String>{};

Expand Down Expand Up @@ -216,7 +229,7 @@ class LabelsUpdateCommand extends ReportCommand {
print(' $slug has ${repo.openIssuesCount} issues and '
'${labels.length} labels.');

const circuitBreaker = 200;
const circuitBreaker = 300;
Copy link
Member

Choose a reason for hiding this comment

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

What does this change accomplish? Can you include a bullet point about why this is changing in the commit message?

Copy link
Member Author

@devoncarew devoncarew Aug 22, 2023

Choose a reason for hiding this comment

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

Yup - this lets us work on slightly larger repos. This circuit breaker is here so that we don't make automated changes to the bigger repos w/o really thinking about it (w/o having to do something like edit the tool's source). I'll add a bullet-point.


if (slug == templateRepoSlug || slug == 'dart-lang/sdk') {
print(" skipping: won't update labels for $slug.");
Expand Down