Skip to content

Commit

Permalink
Merge branch 'master' into hkarakus/codecov_ba_demo
Browse files Browse the repository at this point in the history
  • Loading branch information
hazal-karakus authored Jan 13, 2025
2 parents 6e07bb3 + ded90de commit 89b358a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/run_codecov_on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: codecov.yml
# Run Codecov on PR open or change
on: pull_request
on:
push:
branches:
- master
pull_request:

jobs:
codecov:
runs-on: ubuntu-20.04
Expand All @@ -16,8 +21,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Run React tests
# Need to run "npm run build" command for bundle analysis: https://docs.codecov.com/docs/webpack-quick-start
- name: Build React and run tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
Expand Down
2 changes: 0 additions & 2 deletions auto-deploy.exclude
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ laravel
tda
postgres
crons-python
ruby-on-rails
# ^ see https://github.com/sentry-demos/empower/issues/439
next
# ^ uses Vercel automation
1 change: 0 additions & 1 deletion ruby-on-rails/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ group :development do
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

10 changes: 6 additions & 4 deletions ruby-on-rails/app/controllers/api/v1/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ def index
span_products_db.finish

# n+1 to db if done this way
products.each do |prod_slow|
products = products.map do |prod|
span_products_slow_db = transaction.start_child(op: "custom.reviews_slow_db_call")
prod_slow["pg_sleep"] = ""
prod_slow["reviews"] = []
prod_slow["reviews"] = Reviews.select("id, productid, rating, customerid, description, created, Null as pg_sleep").where("productid="+prod_slow.id.to_s).to_a
prod_attrs = prod.attributes
prod_attrs["pg_sleep"] = ""
prod_attrs["reviews"] = []
prod_attrs["reviews"] = Reviews.select("id, productid, rating, customerid, description, created, Null as pg_sleep").where("productid="+prod.id.to_s).as_json
span_products_slow_db.finish
prod_attrs
end

# fewer db calls this way -- done in products-join
Expand Down
2 changes: 1 addition & 1 deletion ruby-on-rails/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

bundle install
# nothing to do

0 comments on commit 89b358a

Please sign in to comment.