GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Enable configuration to fail CI if new alerts are introduced · Issue #598 · github/codeql-action

Enable configuration to fail CI if new alerts are introduced #598

New issue
Copy link
New issue
Copy link
Closed
#599
Closed
Enable configuration to fail CI if new alerts are introduced#598
#599
Copy link

Description

@johnthagen
johnthagen
opened on Jun 25, 2021
Issue body actions

We are currently trying to migrate from LGTM to codeql-action due to limitations in LGTM's infrastructure.

With LGTM, we could set it return a failing check any time new analysis alerts were introduced in an PR. This would allow us to prevent merging a PR if it introduced new alerts.

We set up the default GitHub Actions for codeql-action and it ran and found 6 alerts in our test suite, but the build did not put up a failing check that would have prevented merging.

This is our first PR that adds codeql-action, so perhaps this needs to be merged first so that future PRs have something to be compared against? We are hesitant to merge without knowing there is a way to configure the action to fail when new alerts are introduced.

  • PR: Upgrade backend to .NET 5 sillsdev/TheCombine#1198
  • Scanning results: https://github.com/sillsdev/TheCombine/pull/1198/checks?check_run_id=2914899948
  • Alerts for PR: https://github.com/sillsdev/TheCombine/security/code-scanning?query=ref%3Arefs%2Fpull%2F1198%2Fmerge+tool%3ACodeQL
Reacted by D. Ror. and Jason Naylor

Activity

  1. johnthagen
    changed the title [-]Enable configuration to fail CI if new errors are introduced[/-] [+]Enable configuration to fail CI if new alerts are introduced[/+] on Jun 25, 2021
  2. aeisenberg commented on Jun 25, 2021

    @aeisenberg
    aeisenberg
    on Jun 25, 2021
    Contributor
    More actions

    Hi there, thanks for reporting an issue. You are correct that Code Scanning is not failing because it has nothing to compare the new alerts against. The message:

    Warning: Code scanning cannot determine the alerts introduced or fixed by this pull request, because 1 analysis was not found.

    means that it found some alerts in the PR, but it did not find any alerts in the base branch (master) so it doesn't know if it should fail on these new alerts.

    See Reasons for the "missing analysis" message

    You will need to run code scanning on the master branch before code scanning can properly calibrate the alerts. And there is a setting in Settings -> Security and Analysis -> Code Scanning to make sure there is a failing commit status if any alert is found.

    Reacted by John Hagen and Jason Naylor
  3. johnthagen commented on Jun 25, 2021

    @johnthagen
    johnthagen
    on Jun 25, 2021
    Author
    More actions

    @aeisenberg Thanks for the quick feedback! Might I suggest a sentence or two be added to the README about this? I think it would help new users onboard faster.

    Reacted by veronica-farias
  4. adityasharad commented on Jun 25, 2021

    @adityasharad
    adityasharad
    on Jun 25, 2021
    Contributor
    More actions

    You may also find https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#defining-the-alert-severities-causing-pull-request-check-failure useful to determine the threshold for making the check fail. The default is that error-severity alerts (or a failing build) will block the PR, but you can adjust this in settings to a lower severity if you wish.

    Reacted by John Hagen
  5. aeisenberg
    added 2 commits that reference this issue on Jun 25, 2021

    Update readme to include section on missing analysis

    This issue will close once commit 8422d26 is merged into the 'main' branch.
    8422d26

    Update readme to include section on missing analysis

    This issue will close once commit 7c391e9 is merged into the 'main' branch.
    7c391e9
  6. johnthagen commented on Jun 25, 2021

    @johnthagen
    johnthagen
    on Jun 25, 2021
    Author
    More actions

    @aeisenberg @adityasharad After migrating to codeql-actions it seems there is no way to disable only one of the languages that LGTM detects (we only want to use Javascript with it now). Is that something the codeql team can help with?

    The project is: https://lgtm.com/projects/g/sillsdev/TheCombine/?mode=list

    We'd like to disable C# but keep Javascript.

    The problem we're hitting is that the codeql-action is running fine, but LGTM keeps reporting failed builds to our PRs, which GitHub then marks with a red X even though we don't require them to pass.

  7. adityasharad commented on Jun 25, 2021

    @adityasharad
    adityasharad
    on Jun 25, 2021
    Contributor
    More actions

    Certainly. We have disabled C# on that project on LGTM. Please don't hesitate to let us know if we can be of more help as you migrate to code scanning on GitHub.

    Reacted by John Hagen
  8. aeisenberg
    closed this as completedin #599on Jun 28, 2021
  9. johnthagen commented on Jun 28, 2021

    @johnthagen
    johnthagen
    on Jun 28, 2021
    Author
    More actions

    @adityasharad Just wanted to report everything is working great now. Thank you!

    Reacted by Aditya Sharad
  10. aofaof0907
    added a commit that references this issue on Jul 29, 2021

    Update readme to include section on missing analysis

    This issue will close once commit 7674c5d is merged into the 'main' branch.
    7674c5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.