New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@moj-bichard7-developers/bichard7-next-core

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moj-bichard7-developers/bichard7-next-core

The code to replace the processing logic of Bichard 7

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Bichard 7 Core

The code to replace the processing logic of Bichard 7

Publishing package updates

The code in this repository is packaged in the @moj-bichard7-developers/bichard7-next-core NPM package.

To deploy a new version of the package:

  1. Manually bump the version number in package.json in your PR. It's recommended to follow semantic versioning principles.
  2. Merge your PR into the main branch.
  3. Run the Release GitHub action against the main branch, by clicking the "Run workflow" button in the Actions interface.

Testing

To run unit tests against new Bichard:

npm i # If packages not already installed
npm t

To run unit tests against old Bichard (requires the old Bichard stack to be running):

npm i # If packages not already installed
npm run test:bichard

Excluding Triggers

Triggers can be excluded for either a specific force or court by adding the trigger code (e.g, TRPR0001) to either data/excluded-trigger-configuration.json for production systems or data/excluded-trigger-configuration.test.json for test environments.

The choice of which excluded-trigger-configuration file to use is decided in src/lib/excludedTriggerConfig.ts using the NODE_ENV environment variable. The test configuration file (excluded-trigger-configuration.test.json) is run if NODE_ENV is set as testing.

Environment VariableDescription
NODE_ENVThe environment node is being run in

Comparing New and Old Bichard

Old Bichard is currently configured to publish its outputs (AHO, triggers, exceptions), plus the original message it received to the PROCESSING_VALIDATION_QUEUE queue in ActiveMQ. We can compare these outputs against new Bichard by running:

npm i # If packages not already installed
npm run compare

This requires the old Bichard stack to be running. Outputs from old Bichard can be driven onto the queue by running either make pushq in the old Bichard repo, or by running npm t in the e2e testing repo.

npm run compare runs the scripts/compareResults.ts script to check the output of old Bichard against new Bichard. A tally is kept of the results and can be seen by exiting the script with Ctrl-C. If compareResults.ts can't process any messages off the queue (empty messages, ActiveMQ errors ect), these are recorded as skipped and will be counted seperatly.

If all comparisons between the new and old Bichard are successful, compareResults.ts will exit with a 0 code. If any comparisions have failed or messages have been skipped, it will exit with a code of 1.

Checking a comparison file

You can run a cli tool to see if a comparison json file matches using:

npm run compare -- <path to json file>

You can also run this tool against the comparison files collected in production using the following arguments:

Options

  -f, --file string     Specify either the local file path or an S3 URL
  -s, --start string    Specify the start timestamp in ISO8601 format
  -e, --end string      Specify the end timestamp in ISO8601 format
  -p, --filter string   Filter based on the last result. Specify either 'failure', 'success', 'both'.
                        Default is 'failure'
  -c, --cache           Cache the comparison files
  -h, --help            Prints this usage guide

You will need to run it using aws-vault

Comparing outputs locally

If being run locally, it may be clearer to run:

npm run compare:dev

This mode pretty-prints the Pino logs and makes it a bit clearer as to what's going on. However, it is NOT suitable for production environments (as per their docs).

Configuration

Environment VariableDescriptionDefault
MQ_HOSTThe host URL of the ActiveMQ messaging queuelocalhost
MQ_PORTThe host port of the ActiveMQ messaging queue61613
MQ_CONNECTION_HOSTThe connection target for the ActiveMQ messaging queue/
MQ_CONNECTION_LOGINThe login username for the ActiveMQ messaging queueadmin
MQ_CONNECTION_PASSCODEThe login password for the ActiveMQ messaging queueadmin
MQ_QUEUE_NAMEThe ActiveMQ queue to subscribe to/queue/PROCESSING_VALIDATION_QUEUE
PINO_LOG_LEVELThe logging level used by Pino, the logger used within the scriptinfo

FAQs

Package last updated on 18 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc