Skip to content

Commit

Permalink
Preview ready (#23)
Browse files Browse the repository at this point in the history
* Create release workflow

* Create scorecard.yml workflow

* Update test_bundle to install all dependencies

* Set Gemfile_test as BUNDLE_GEMFILE for test task

* Removing system configuration API call

* Create PR CI workflow

This workflow includes:
* Rubocop, with a todo file to get the linter passing
* Unit tests running on each supported Ruby version
* Simplecov report, with threshold numbers adjusted for the current
coverage on the repo and the test directory excluded from coverage
numbers

* Use whole numbers for Simplecov Report thresholds

* Rails4 support (#20)

* fix for NR-116469(rails4 sqlite3_adapter and postgresql_adapter support)

* fix for NR-116468(rails4 application routes extraction)

* fix for NR-117826(regression)

* added active log message for QA automation

* updated support matrix for rails

* Added websocket library into agent code base (#19)

* use NR's log_file_path for log writing (#21)

* use NR's log_file_path for log writing

* fix for NR-118308

* add check for mime type response data (#22)

* fix for NR-120698

* fix for NR-118299

* fix-NR-100839 - websocket retry fixes (#26)

* fix-NR-100839 - websocket retry fixes

* added fix for Errno::ECONNRESET: Connection reset by peer

* update init log message

* fix for exception in health sending when conn not established

* fix for IO error when stream closed while communication

* add third party notices (#27)

* added more rubocop_todo

* update README.md and THIRD_PARTY_NOTICES.md

* Test (#30)

* Created unit tests for sqlite3, mongo, pg, mysql2

* Provided fixes for unit tests run warnings

* Created unit tests for Sinatra

* Created unit tests for Rails, sqlite3_adapter and postgresql_adapter

* minor changes

* fix for sqlite3_adapter & postgresql_adapter test

* Added servers for pg, mysql2, mongo, postgresql_adapter

* Updated .gitignore

* updated test setup

* added rubocop_todo for tests (#31)

* Test (#32)

* Created unit tests for sqlite3, mongo, pg, mysql2

* Provided fixes for unit tests run warnings

* Created unit tests for Sinatra

* Created unit tests for Rails, sqlite3_adapter and postgresql_adapter

* minor changes

* fix for sqlite3_adapter & postgresql_adapter test

* Added servers for pg, mysql2, mongo, postgresql_adapter

* Updated .gitignore

* updated test setup

* Updated Gemfile_test

---------

Co-authored-by: Manoj Yadav <manojy@k2io.com>
Co-authored-by: manoj-k2 <myadav@newrelic.com>

* Test (#34)

* Created unit tests for sqlite3, mongo, pg, mysql2

* Provided fixes for unit tests run warnings

* Created unit tests for Sinatra

* Created unit tests for Rails, sqlite3_adapter and postgresql_adapter

* minor changes

* fix for sqlite3_adapter & postgresql_adapter test

* Added servers for pg, mysql2, mongo, postgresql_adapter

* Updated .gitignore

* updated test setup

* Updated Gemfile_test

* enable simplecov

---------

Co-authored-by: prateek-ap <psen@newrelic.com>

* fix for NR-122228 (#33)

* fix for NR-122228

* separate handling for ruby below 2.7 and above

* updated rubocop_todo

* added hooks for mongo collection view class (#35)

* Test (#36)

* Created unit tests for sqlite3, mongo, pg, mysql2

* Provided fixes for unit tests run warnings

* Created unit tests for Sinatra

* Created unit tests for Rails, sqlite3_adapter and postgresql_adapter

* minor changes

* fix for sqlite3_adapter & postgresql_adapter test

* Added servers for pg, mysql2, mongo, postgresql_adapter

* Updated .gitignore

* updated test setup

* Updated Gemfile_test

* enable simplecov

* event count fix in mongo test

* minor changes in test helper

* changed testcontainers to docker api

* db image pull fix

* assertion fix for mongo new hooks

* updated rubocop_todo for mongo

* minor change in mongo

* fix for Ruby 2.4.x in postgresql_adapter, sqlite3_adapter, excon

* updated rubocop_todo

---------

Co-authored-by: prateek-ap <psen@newrelic.com>

* fix for sinatra on ruby2.4, disabled require hook, dir permission 666 (#37)

* fix for sinatra on ruby2.4, disabled require hook, dir permission 666

* minor change for rubocop

* public define_transform_keys

* Test (#38)

* Created unit tests for sqlite3, mongo, pg, mysql2

* Provided fixes for unit tests run warnings

* Created unit tests for Sinatra

* Created unit tests for Rails, sqlite3_adapter and postgresql_adapter

* minor changes

* fix for sqlite3_adapter & postgresql_adapter test

* Added servers for pg, mysql2, mongo, postgresql_adapter

* Updated .gitignore

* updated test setup

* Updated Gemfile_test

* enable simplecov

* event count fix in mongo test

* minor changes in test helper

* changed testcontainers to docker api

* db image pull fix

* assertion fix for mongo new hooks

* updated rubocop_todo for mongo

* minor change in mongo

* fix for Ruby 2.4.x in postgresql_adapter, sqlite3_adapter, excon

* updated rubocop_todo

* fix for rails test dependency issue for Ruby 2.4.x

* regression fix for sinatra

---------

Co-authored-by: prateek-ap <psen@newrelic.com>

* Separate Simplecov action (#39)

* trial commit for simplecov

* minor change

* diabling fork check for testing

* added authentication

* permission changes

* add rake tasks loading mechanism

* reverted commented check

* updated coverage threshold

* updated coverage threshold

* updated scorecard action for private repo (#40)

* updated newrelic config

* fix for invalid utf-8 encoding in rxss (#42)

* regression fix due to log_file_path change (#44)

* regression fix due to log_file_path change

* fix for generate uuid in sinatra

* Test (#45)

* Created unit tests for sqlite3, mongo, pg, mysql2

* Provided fixes for unit tests run warnings

* Created unit tests for Sinatra

* Created unit tests for Rails, sqlite3_adapter and postgresql_adapter

* minor changes

* fix for sqlite3_adapter & postgresql_adapter test

* Added servers for pg, mysql2, mongo, postgresql_adapter

* Updated .gitignore

* updated test setup

* Updated Gemfile_test

* enable simplecov

* event count fix in mongo test

* minor changes in test helper

* changed testcontainers to docker api

* db image pull fix

* assertion fix for mongo new hooks

* updated rubocop_todo for mongo

* minor change in mongo

* fix for Ruby 2.4.x in postgresql_adapter, sqlite3_adapter, excon

* updated rubocop_todo

* fix for rails test dependency issue for Ruby 2.4.x

* regression fix for sinatra

* run db server before all tests run

* updated rubocop todo

* fix for version change in excon test

---------

Co-authored-by: prateek-ap <psen@newrelic.com>

* fix for https://issues.newrelic.com/browse/NR-96605 (#43)

* Test (#47)

* Created unit tests for sqlite3, mongo, pg, mysql2

* Provided fixes for unit tests run warnings

* Created unit tests for Sinatra

* Created unit tests for Rails, sqlite3_adapter and postgresql_adapter

* minor changes

* fix for sqlite3_adapter & postgresql_adapter test

* Added servers for pg, mysql2, mongo, postgresql_adapter

* Updated .gitignore

* updated test setup

* Updated Gemfile_test

* enable simplecov

* event count fix in mongo test

* minor changes in test helper

* changed testcontainers to docker api

* db image pull fix

* assertion fix for mongo new hooks

* updated rubocop_todo for mongo

* minor change in mongo

* fix for Ruby 2.4.x in postgresql_adapter, sqlite3_adapter, excon

* updated rubocop_todo

* fix for rails test dependency issue for Ruby 2.4.x

* regression fix for sinatra

* run db server before all tests run

* updated rubocop todo

* fix for version change in excon test

* updated README files for tests

* update mongo test for event count

* Updated mongo event count verify

---------

Co-authored-by: prateek-ap <psen@newrelic.com>

* Websocket fixes (#49)

* probable fix for multiple connection remain open

* updated reconnect logic

* added intentional closing functionality

* added safe navigation operator and rubocop_todo update

* added check for high security flag, event category for file events, a… (#46)

* added check for high security flag, event category for file events, added impl for NR_CSEC_VALIDATOR_FILE_SEPARATOR

* update rubocop_todo

* added instrumentation for mysql2_adapter (#48)

* added instrumentation for mysql2_adapter

* update mysql instrumentation installing mechanism

* fix for NR-138768, set IAST client open timeout to 5s

* added additional ws headers (NR-173803) (#53)

* added implementation for data pull mechanism (#51)

* added implementation for data pull mechanism

* rubocop fixes

* fix for NR-141803

* updated logging for data pull mechanism

* updated logging for data pull mechanism .

* updated rubocop

* fix for NR-142165

* add parentId in event and nr-csec-parent-id in fuzz request

* Last leg implementation

* New changes (#63)

* calculate apiId with http_method

* added response content type filtering for reflected xss

* request body limit

* minor update in dataTrucated logic

* added critical messages implementation

* added iastEventStats, raspEventStats & exitEventStats in healthcheck

* Send healthcheck message on high priority (#68)

* calculate apiId with http_method

* added response content type filtering for reflected xss

* request body limit

* minor update in dataTrucated logic

* added critical messages implementation

* added iastEventStats, raspEventStats & exitEventStats in healthcheck

* send healthcheck on high priority

* fix for corner case, healthcheck not sending when reconnect request arrived and queue not empty

* fix for Absolute file path is not found in parameters in file events(NR-234949) (#69)

* add support for roda framework (#55)

* add support for roda framework

* minor fix

* add padrino framework support (#28)

* Added support for grape framework (#54)

* Grape support (#72)

* Added support for grape framework

* merge conflict fix

* add support for falcon server (#62)

* add support for falcon server

* minor syntx fix

* Bug fixes of Sprint: F1APR2024-IAST  (#71)

* fix for jruby bug: NR-158981

* fix for rails 5 bug: NR-116027

* fix for license_key priniting in logs: NR-138768

* update gha for checkout version & ruby version and remove scorecard workflow (#75)

* Update gha for repolinter (#76)

* update gha for checkout version & ruby version and remove scorecard workflow

* update repolinter workflow

* commented needs: to run unit_test and code_coverage till release

* Revert "commented needs: to run unit_test and code_coverage till release"

This reverts commit 0392e08.

* run unit_test and code_coverage always till release

* update sequence

* fix for rails and sinatra test

* test commit for BUNDLE_GEMFILE var

* add railties for require rails

* update sqlite3 gem in Gemfile_test

* Update gha (#77)

* update gha for checkout version & ruby version and remove scorecard workflow

* update repolinter workflow

* commented needs: to run unit_test and code_coverage till release

* Revert "commented needs: to run unit_test and code_coverage till release"

This reverts commit 0392e08.

* run unit_test and code_coverage always till release

* update sequence

* fix for rails and sinatra test

* test commit for BUNDLE_GEMFILE var

* add railties for require rails

* update sqlite3 gem in Gemfile_test

* update action/upload-artifact versio

* update action/github-scripts version

* Update gha (#78)

* update gha for checkout version & ruby version and remove scorecard workflow

* update repolinter workflow

* commented needs: to run unit_test and code_coverage till release

* Revert "commented needs: to run unit_test and code_coverage till release"

This reverts commit 0392e08.

* run unit_test and code_coverage always till release

* update sequence

* fix for rails and sinatra test

* test commit for BUNDLE_GEMFILE var

* add railties for require rails

* update sqlite3 gem in Gemfile_test

* update action/upload-artifact versio

* update action/github-scripts version

* fix for gha hangs in ruby 3.0.6

* changed rails version for Gemfile_test

* changed rails version for Gemfile_test

* fix for duplicate artifact error after v4 upgrade

* more fix for duplicate artifact error after v4 upgrade

* Update gha (#79)

* update gha for checkout version & ruby version and remove scorecard workflow

* update repolinter workflow

* commented needs: to run unit_test and code_coverage till release

* Revert "commented needs: to run unit_test and code_coverage till release"

This reverts commit 0392e08.

* run unit_test and code_coverage always till release

* update sequence

* fix for rails and sinatra test

* test commit for BUNDLE_GEMFILE var

* add railties for require rails

* update sqlite3 gem in Gemfile_test

* update action/upload-artifact versio

* update action/github-scripts version

* fix for gha hangs in ruby 3.0.6

* changed rails version for Gemfile_test

* changed rails version for Gemfile_test

* fix for duplicate artifact error after v4 upgrade

* more fix for duplicate artifact error after v4 upgrade

* update code coverage workflow

* separate workflow for rubocop

* fix for wrong filename of coverage report

* debug

* debug 2

* final fix

* more debug

* final fixx

* Replay header decryption (#73)

* implemented functionality for replay header decryption

* update apiId format to '<case_type>-<apiId>'

* added log for QA testing ease

* added support for httprb http client (#56)

* added support for httprb http client

* added unit test cases for httprb

* added local sample server in test suite for rest client tests

* update assertion

* sending application url mappings json to validator (#50)

* sending application url mappings json to validator

* minor changes for rubocop

* added support for httpx http client (#61)

* added support for httpx http client

* add unit test cases for httpx

* update httpx tests

* update httpx tests for event count

* update case type check for httpx

* Typhoeus http client support (#57)

* Typhoeus http client support

* add unit test cases for typhoeus

* update typhoeus unit tests

* add support for async-http http client (#59)

* add support for async-http http client

* add unit test cases for asyn-http

* update async-http unit tests

* fix for ensure_error in ruby 2.4 for async-http unit tests

* added support for ethon http client (#60)

* added support for ethon http client

* add unit test cases for ethon

* update ethon tests

* fix for ethon mutli failing cases

* update logic for event count check

* update test

* update test

* test-arch-update (#81)

* removed typhoeus instrumentation, add setup and teardown

* update sqlite3 hook(replace prepare hook with initialize hook) and test cases

* minor code clean for postgresql_adapter

* update unit tests removed @@vars, event_list clear in setup, add filter event method, use assert_nil

* update count as previous

* fix for ldap tests failing in chain hooking

* fix for async-http tests failing in chain hooking

* rename httprb test class

* more changes to unit test architecture

* minor changes

* Run unit_tests using both [prepend, chain] instrumentation method (#82)

* removed typhoeus instrumentation, add setup and teardown

* update sqlite3 hook(replace prepare hook with initialize hook) and test cases

* minor code clean for postgresql_adapter

* update unit tests removed @@vars, event_list clear in setup, add filter event method, use assert_nil

* update count as previous

* fix for ldap tests failing in chain hooking

* fix for async-http tests failing in chain hooking

* rename httprb test class

* more changes to unit test architecture

* minor changes

* test commit for instrumentation-method based gha

* test commit

* test commit2

* revert test commit

* skipping failing postgresql tests for now

* update branch coverage threshold to 30%

* Bug fixes of Sprint: F15APR2024-IAST (#74)

* fix for NR-255708

* fix for NR-256408

* fix for NR-256426

* Fix for NR-233114 & NR-233125

* fix for NR-256451

* Update reconnect sequence & require 'resolv-replace'

* update http client test for casetype based count check

* update event count for http client tests

* reverted unit tests related fixes

* fix for regression issue: NR-264721

* fix for regression due to last fix

* Added unit test cases for padrino framework (#80)

* Added unit test cases for padrino framework

* url_not_found test name change

* test suite name change

* Grape & Roda unit tests (#84)

* Added unit tests for grape framework

* added unit tests for roda framework

* fix for rails test failing for route

* update coverage threshold

---------

Co-authored-by: Kayla Reopelle <kreopelle@newrelic.com>
Co-authored-by: Manoj Yadav <93419948+manoj-k2@users.noreply.github.com>
Co-authored-by: Manoj Yadav <manojy@k2io.com>
Co-authored-by: manoj-k2 <myadav@newrelic.com>
  • Loading branch information
5 people authored May 13, 2024
1 parent 7d6d35f commit 11bbbfe
Show file tree
Hide file tree
Showing 188 changed files with 20,710 additions and 954 deletions.
22 changes: 22 additions & 0 deletions .github/actions/simplecov-report/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2018 GitHub, Inc. and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
36 changes: 36 additions & 0 deletions .github/actions/simplecov-report/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SimpleCov Report

A GitHub Action that reports SimpleCov coverage.

**This is overwritten by New Relic to allow support for branch coverage**

![Demo](https://i.gyazo.com/c4e572c91fe8048c95392ea3ddce79f5.png)

## Usage:

The action works only with `pull_request` event.

### Inputs

- `token` - The GITHUB_TOKEN secret.
- `failedThreshold` - Failed threshold. (default: `93`)
- `resultPath` - Path to last_run json file. (default: `coverage/.last_run.json`)

## Example

```yaml
name: Tests
on:
pull_request:

jobs:
build:
steps:
- name: Test
run: bundle exec rspec

- name: SimpleCov Report
uses: aki77/simplecov-report-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
```
Empty file.
3 changes: 3 additions & 0 deletions .github/actions/simplecov-report/__tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test('test runs', () => {
console.log('todo')
})
25 changes: 25 additions & 0 deletions .github/actions/simplecov-report/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "SimpleCov Report"
description: "SimpleCov Report"
author: aki77
branding:
icon: check-square
color: green
inputs:
failedThreshold:
description: Failed threshold (line)
default: "93"
required: false
failedThresholdBranch:
description: Failed threshold (branch)
default: "84"
required: false
resultPath:
description: "json path"
default: "coverage/.last_run.json"
required: false
token:
description: "GitHub token"
required: true
runs:
using: "node16"
main: "dist/index.js"
Loading

0 comments on commit 11bbbfe

Please sign in to comment.