FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use the prefix id for keying into metrics rules by aeisenberg · Pull Request #502 · github/codeql-action · GitHub

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

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

aeisenberg merged 2 commits into
mainfrom
aeisenberg/metric-id

Conversation

aeisenberg commented May 13, 2021
edited
Loading

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.

aeisenberg requested a review from henrymercer May 13, 2021 17:59

adityasharad 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 force-pushed the aeisenberg/metric-id branch from 2b3d0c1 to e8b2a98 Compare May 13, 2021 18:11
aeisenberg requested a review from adityasharad May 13, 2021 18:11

Copy link
Copy Markdown
Contributor Author

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?

adityasharad 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 merged commit a77f6b0 into main May 13, 2021
aeisenberg deleted the aeisenberg/metric-id branch May 13, 2021 19:03
github-actions Bot mentioned this pull request May 17, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to 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


Back | FazBrowse Home | New Git URL