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

CodeQL: ignore purposefully invalid ruby files #7126

Merged
merged 1 commit into from May 12, 2023

Conversation

jeffwidman
Copy link
Member

@jeffwidman jeffwidman commented Apr 20, 2023

CodeQL is complaining that these two files are unparsable Ruby:

[2023-04-20 07:34:33] [build-stdout] [2023-04-20 07:34:33] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/bundler/spec/fixtures/projects/bundler1/invalid_ruby/Gemfile:2: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.
[2023-04-20 07:34:33] [build-stdout] [2023-04-20 07:34:33] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/bundler/spec/fixtures/projects/bundler2/invalid_ruby/Gemfile:2: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.

These two files are test specs and intentionally unparsable, so ignoring them.

Docs on configuring ignores are here:

@jeffwidman jeffwidman requested a review from a team as a code owner April 20, 2023 08:06
@jeffwidman jeffwidman marked this pull request as draft April 20, 2023 08:12
@jeffwidman jeffwidman force-pushed the codeql-ignore-purposefully-invalid-ruby-files branch 2 times, most recently from 57cb324 to 246a15c Compare May 12, 2023 08:43
@jeffwidman jeffwidman marked this pull request as ready for review May 12, 2023 08:45
@jeffwidman
Copy link
Member Author

  [2023-05-12 08:45:39] [build-stdout] [2023-05-12 08:45:39] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/common/spec/dependabot/dependency_file_spec.rb:81: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.
  [2023-05-12 08:45:39] [build-stdout] [2023-05-12 08:45:39] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/common/spec/dependabot/dependency_file_spec.rb:83: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.

🤔 hmm, these look okay to me:

"content_encoding" => "utf-8",
"deleted" => false,
"operation" => Dependabot::DependencyFile::Operation::UPDATE

CodeQL is complaining that these two files are unparsable Ruby:
```
[2023-04-20 07:34:33] [build-stdout] [2023-04-20 07:34:33] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/bundler/spec/fixtures/projects/bundler1/invalid_ruby/Gemfile:2: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.
  [2023-04-20 07:34:33] [build-stdout] [2023-04-20 07:34:33] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/bundler/spec/fixtures/projects/bundler2/invalid_ruby/Gemfile:2: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.
```

These two files are test specs and intentionally unparsable, so ignoring
them.

Docs on configuring ignores are here:
* https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning#specifying-directories-to-scan
* https://github.com/github/codeql-action#configuration-via-config-input
@jeffwidman jeffwidman force-pushed the codeql-ignore-purposefully-invalid-ruby-files branch from 246a15c to 3a74ac1 Compare May 12, 2023 15:10
@jeffwidman jeffwidman merged commit 815856b into main May 12, 2023
99 checks passed
@jeffwidman jeffwidman deleted the codeql-ignore-purposefully-invalid-ruby-files branch May 12, 2023 17:01
@jeffwidman jeffwidman added the EE Engineering Efficiency label May 12, 2023
brettfo pushed a commit to brettfo/dependabot-core that referenced this pull request Oct 11, 2023
CodeQL is complaining that these two files are unparsable Ruby:
```
[2023-04-20 07:34:33] [build-stdout] [2023-04-20 07:34:33] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/bundler/spec/fixtures/projects/bundler1/invalid_ruby/Gemfile:2: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.
  [2023-04-20 07:34:33] [build-stdout] [2023-04-20 07:34:33] [build-stdout]  WARN /home/runner/work/dependabot-core/dependabot-core/bundler/spec/fixtures/projects/bundler2/invalid_ruby/Gemfile:2: A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.
```

These two files are test specs and intentionally unparsable, so ignoring
them.

Docs on configuring ignores are here:
* https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning#specifying-directories-to-scan
* https://github.com/github/codeql-action#configuration-via-config-input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EE Engineering Efficiency
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants