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

Augment where we insert baseline lines of code by edoardopirovano · Pull Request #624 · github/codeql-action · GitHub

Augment where we insert baseline lines of code - #624

Merged
edoardopirovano merged 2 commits into
github:mainfrom
edoardopirovano:loc-location
Jul 21, 2021
Merged

edoardopirovano merged 2 commits into
github:mainfrom
edoardopirovano:loc-location

Conversation

Copy link
Copy Markdown
Contributor

This PR updates the code that injects the baseline LOC count into the SARIF results to also inject it into any metricResult that references a rule which has the lines-of-code tag. This is the location that newer versions of Code Scanning will expect to find the LOC count. The old style (injecting into the metricResult with suffix /summary/lines-of-code) is also retained for backwards compatibility, but we should be able to remove this eventually.

I don't think we need a changelog entry as this change shouldn't really affect any users (unless they are manually uploading the SARIF to a non-Code Scanning endpoint, which I'm not sure is a scenario we support).

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

edoardopirovano requested a review from a team as a code owner July 21, 2021 13:18

Copy link
Copy Markdown
Contributor Author

Somehow one of the Node packages in main had managed to get out of sync with that the lockfile specified. This should be impossible due to the PR checks so I'm not quite sure how that happened. Anyway, I've pushed an additional commit to this PR to address that (probably no need to do it in a separate PR?).

Copy link
Copy Markdown
Contributor

I've confirmed that this change gives the expected result in a test repository:

                                "metricResults": [
                                        {
                                                "rule": {
                                                        "toolComponent": {
                                                                "index": 22
                                                        },
                                                        "index": 70,
                                                        "id": "js/summary/lines-of-code"
                                                },
                                                "ruleId": "js/summary/lines-of-code",
                                                "baseline": 3,
                                                "value": 3
                                        },
                                        {
                                                "rule": {
                                                        "toolComponent": {
                                                                "index": 22
                                                        },
                                                        "index": 71,
                                                        "id": "js/summary/lines-of-user-code"
                                                },
                                                "ruleId": "js/summary/lines-of-user-code",
                                                "baseline": 3,
                                                "value": 3
                                        }
                                ],

edoardopirovano merged commit 3428407 into github:main Jul 21, 2021
edoardopirovano deleted the loc-location branch July 21, 2021 13:54
github-actions Bot mentioned this pull request Jul 21, 2021
5 tasks
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