Skip to content

Commit

Permalink
Fix failing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Haritha-Kotte committed Oct 16, 2024
1 parent a0e9ba7 commit 25c51d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
ruby-version: .ruby-version
bundler-cache: true

- name: Scan for security vulnerabilities in JavaScript dependencies
run: bin/importmap audit

lint:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -79,7 +76,7 @@ jobs:
env:
RAILS_ENV: test
# REDIS_URL: redis://localhost:6379/0
run: bin/rails db:test:prepare test test:system
run: bundle exec rails test

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ group :development, :test do
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
gem "rubocop-rails-omakase", require: false
end


9 changes: 6 additions & 3 deletions app/controllers/queries_controller.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
require "shellwords"

class QueriesController < ApplicationController
before_action :set_query, only: %i[ show update destroy ]

def get_query_results
# Retrieve the query results by executing a Python script with the given query.
query_results = `python3 lib/tasks/query_result.py "#{params[:query]}"`

render json: { query_results: query_results }
query = Shellwords.escape(params[:query])
query_results = system("python3 lib/tasks/query_result.py #{query}")

render json: { query_results: query_results }
end

# GET /queries
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

resource "*",
headers: :any,
methods: [:get, :post, :put, :patch, :delete, :options, :head]
methods: [ :get, :post, :put, :patch, :delete, :options, :head ]
end
end

0 comments on commit 25c51d0

Please sign in to comment.