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

VEN-99 Run brakeman #11537

Merged
merged 28 commits into from
Dec 2, 2021
Merged

VEN-99 Run brakeman #11537

merged 28 commits into from
Dec 2, 2021

Conversation

aleksandarpetrushev
Copy link
Contributor

No description provided.

@viezly
Copy link

viezly bot commented Nov 29, 2021

Changes preview:

Legend:

👀 Review pull request on Viezly

@aleksandarpetrushev
Copy link
Contributor Author

@damianlegawiec You can not pass in an array of applications for brakeman to check (no implicit conversion of Array into String (TypeError)), you must specify one path. There is a --force-scan option to check all files and it disregards any other options, but it works only locally and not with codeclimate.

@aleksandarpetrushev aleksandarpetrushev changed the title Run brakeman VEN-99 Run brakeman Nov 29, 2021
@damianlegawiec
Copy link
Member

@damianlegawiec You can not pass in an array of applications for brakeman to check (no implicit conversion of Array into String (TypeError)), you must specify one path. There is a --force-scan option to check all files and it disregards any other options, but it works only locally and not with codeclimate.

locally doesn't work for us

if we cannot use code climate, please add brakeman as an additional step for circle ci

- run:
name: Ensure Brakeman Installed
command: |
gem install brakeman -v 4.3.1 && bundle install
Copy link
Member

Choose a reason for hiding this comment

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

@aleksandarpetrushev please add this gem to common_spree_dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@damianlegawiec it is added, but when I try to execute with bundle, I get an error (https://app.circleci.com/pipelines/github/spree/spree/5491/workflows/3f2a5355-920e-4742-800a-97cffe8a22a6/jobs/48149). Same happens locally when I execute from repository root (with bundler). But when I just run brakeman --options (no bundle exec) it runs. Not sure how to go about this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and same error without bundler on CircleCI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@damianlegawiec it is definitely an incompatibility with brakeman versions and Rails/Ruby or other gems versions. It works with brakeman latest version.

.circleci/config.yml Outdated Show resolved Hide resolved
@aleksandarpetrushev aleksandarpetrushev marked this pull request as ready for review December 1, 2021 08:55
@aleksandarpetrushev
Copy link
Contributor Author

@damianlegawiec Now basically the brakeman check will always pass, and output the results in an artifact. There are no serious issues. Just ones where example we interpolate a quoted table name in a scope (we are not interpolating params or something like that).

@damianlegawiec
Copy link
Member

@damianlegawiec Now basically the brakeman check will always pass, and output the results in an artifact. There are no serious issues. Just ones where example we interpolate a quoted table name in a scope (we are not interpolating params or something like that).

We don't want it to always pass, we definitely want it to fail on serious issues, will it?

@aleksandarpetrushev
Copy link
Contributor Author

@damianlegawiec Now it is set up to fail on warnings. I have tested it. When we have a warning, it will be red

@damianlegawiec damianlegawiec merged commit aa96ebd into main Dec 2, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix/brakeman branch December 2, 2021 14:15
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