Skip to content

Use the prefix id for keying into metrics rules - #502

Merged
aeisenberg merged 2 commits into
mainfrom
aeisenberg/metric-id
May 13, 2021
Merged

Use the prefix id for keying into metrics rules#502
aeisenberg merged 2 commits into
mainfrom
aeisenberg/metric-id

Conversation

@aeisenberg

@aeisenbergaeisenberg commented May 13, 2021

Copy link
Copy Markdown
Contributor

Fixes a bug where we were looking for incorrect keys for metrics rules.
Previously, we were using full language names in the keys. Now, we use
the short language names in the metric ids. This is done through a
simplification of the code.

Also, this change does two smaller things:

  1. Prints out the baseline count to the logs
  2. Adds the assertNever function to ensure we never miss a case in
    a switch statement. This function is borrowed from vscode-codeql.### Merge / deployment checklist
  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.

@adityasharadadityasharad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch.

Fixes a bug where we were looking for incorrect keys for metrics rules.
Previously, we were using full language names in the keys. Now, we use
the short language names in the metric ids. This is done through a
simplification of the code.
Also, this change does two smaller things:
1. Prints out the baseline count to the logs
2. Adds the `assertNever` function to ensure we never miss a case in
a switch statement. This function is borrowed from vscode-codeql.
@aeisenberg

Copy link
Copy Markdown
ContributorAuthor

Thanks for the quick review @adityasharad, but I decided to make a change. I think this simplifies things a bit. Could you take another look?

@adityasharadadityasharad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense. We use the Language entity wherever possible, and convert only at the points where the ID prefix or Linguist name is needed.

@aeisenberg
aeisenberg merged commit a77f6b0 into mainMay 13, 2021
@aeisenberg
aeisenberg deleted the aeisenberg/metric-id branch May 13, 2021 19:03
@github-actionsgithub-actionsBot mentioned this pull request May 17, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@aeisenberg@adityasharad