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

Feature/v9 #18

Merged
merged 47 commits into from
Jan 6, 2024
Merged

Feature/v9 #18

merged 47 commits into from
Jan 6, 2024

Conversation

mrinc
Copy link
Member

@mrinc mrinc commented Aug 3, 2023

No description provided.

mrinc added 10 commits July 22, 2023 11:33
Updated to use yaml instead of json

updated pluginClient definitions for more consistent inits

Updated templates for new platform

Removing default service plugins from final npm package
Added more tests

Added more documentation on methods

Updated templates -1
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Attention: 872 lines in your changes are missing coverage. Please review.

Comparison is base (278c9ae) 61.87% compared to head (2887b6d) 30.30%.
Report is 6 commits behind head on develop.

❗ Current head 2887b6d differs from pull request most recent head 9767049. Consider uploading reports for the commit 9767049 to get more accurate results

Files Patch % Lines
nodejs/src/serviceBase/events.ts 3.11% 218 Missing ⚠️
nodejs/src/serviceBase/services.ts 3.10% 125 Missing ⚠️
nodejs/src/serviceBase/logging.ts 17.24% 120 Missing ⚠️
nodejs/src/plugins/config-default/plugin.ts 6.57% 71 Missing ⚠️
nodejs/src/serviceBase/serviceBase.ts 9.23% 59 Missing ⚠️
nodejs/src/serviceBase/plugins.ts 3.33% 58 Missing ⚠️
nodejs/src/serviceBase/config.ts 7.69% 48 Missing ⚠️
nodejs/src/base/PluginEvents.ts 2.50% 39 Missing ⚠️
nodejs/src/client.ts 15.00% 34 Missing ⚠️
nodejs/src/base/events.ts 26.08% 17 Missing ⚠️
... and 10 more
Additional details and impacted files
@@             Coverage Diff              @@
##           develop      #18       +/-   ##
============================================
- Coverage    61.87%   30.30%   -31.58%     
============================================
  Files           15       34       +19     
  Lines          522     1376      +854     
  Branches        59      235      +176     
============================================
+ Hits           323      417       +94     
- Misses         199      959      +760     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
yaml 2.3.1 None +0 660 kB eemeli

…fter tsc

chore(package.json): update file paths in files array to point to build directory
chore(service.ts): change IPluginDefinition enum to PluginDefinitions object
chore(colours.ts): change ConsoleColours enum to CONSOLE_COLOURS object

fix(plugin.ts): change import statement for ConsoleColours enum
feat(plugin.ts): add LOG_LEVELS constant and LogLevels type
fix(config.ts): change import statements for PluginDefinitions and PluginDefinition types

refactor(plugins.ts): change interface names to match updated interface names
refactor(serviceBase.ts): change enum to const enum and add type for enum values
refactor(services.ts): change interface names to match updated interface names

fix(plugin.ts): import LOG_LEVELS constant from log-default plugin
fix(plugin.ts): change parameter type from number to LogLevels in fakeLogFunc function
Changed config to be yaml instead of json

Changed config format for simpler configuration

Changed config format for multi-plugin services running concurrently with different names for monilith deployments

Multi-log handler functionality added

Logs can filter between different log plugins - allowing for log/plugin direction logging/stats - eg: logs to graylog but stats to grafana

Added multi-events ability as well - you can route specific plugins/events over specific event plugins

Starting migration away from sec.config.ts definitions for config of plugins

More type-safety built into all elements

callable methods are now a type safe object on the service - and a function to call them that is type linked

events are now in the events object on the BSB service class for a cleaner plugin.

init and run can be sync/async

initial setup of a BSB plugin invoked abstract classes for more type-safety

Split logging/events/plugins/services from SB into extendable classes for unique cases where the standard classes do not work the way you need them too - so you can extend and change what is needed without hacking around the problem

Initial setup speed from from +1s to ~40ms

Included cleanups during the setup to optimize memory usage

config plugins are simplified even more for less data transfer from the config plugin to other services/ or the BSB itself

Plugin search algorithim now uses defined info in config instead of trying to search for plugins - initial setup will require PDK for easier configuration

prepped for zod - config validation

prepped for future expansion with interoperability between languages with zod for input and output data from events.

client setup is minified as well for simpler use

clients get their own logging defition so you can identify what is creating logs

PI data in logs are removed since it is more complex to handle in client code - so rather just control the data coming into logs better

logging is now sync - but pushed to an events bus which then pushes to the logging plugins

config plugin is disposed after use for memory and safety

Plugin constructors now just have a single object passed in just to make it easier to setup/create a plugin

Added more comments/ts info to functions to make use easier

Simplified the setup of plugins for logging/events/config/services and moved them to their own classes

Overall big cleanup and optimize as well as additional features for more flexibility in deployments
…ervice-default2X, and service-default3X plugins

feat(base.ts): import BSBServiceConfig from serviceConfig
feat(base.ts): change BSBConfigDefinition to BSBConfigType
feat(base.ts): add BSBConfigDefinition type alias for BSBServiceConfig<z.AnyZodObject>
feat(config.ts): add run() function to BSBConfigRef class
feat(events.ts): add run() function to BSBEventsRef class
feat(logging.ts): add run() function to BSBLoggingRef class
feat(serviceConfig.ts): create BSBServiceConfig abstract class
feat(serviceConfig.ts): create BSBServiceConfigRef class
refactor(index.ts): update import path for serviceConfig
refactor(serviceConfig.ts): move serviceConfig interface to base folder and rename to BSBServiceConfig

chore(interfaces.ts): add ExtendedConfig interface to extend logging, events, and services config interfaces
chore(interfaces.ts): update logging, events, and services config interfaces to include ExtendedConfig
chore(plugin.ts): remove unused run method in Plugin class
chore(plugin.ts): update return value of getConfig method in Plugin class to handle undefined config
chore(plugin.ts): remove unused run method in Plugin class
chore(plugin.ts): remove unused dispose method in Plugin class
chore(plugin.ts): remove unused run method in Plugin class
chore(plugin.ts): remove unused dispose method in Plugin class
chore(plugin.ts): remove unused run method in Plugin class
chore(plugin.ts): remove unused dispose method in Plugin class
chore(plugin.ts): remove unused run method in Plugin class
chore(plugin.ts): remove unused dispose method in Plugin class
chore(plugin.ts): remove unused run method in Plugin class
chore(plugin.ts): remove

fix(config.ts): change variable names from loggerPackage to configPackage and loggerPlugin to configPluginName
feat(config.ts): add support for process.env.BSB_LOGGER_PLUGIN and process.env.BSB_LOGGER_PLUGIN_PACKAGE environment variables
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update plugin loading to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new variable names
fix(config.ts): update log messages to use the new

fix(plugins.ts): fix import statement for BSBServiceConfig
fix(plugins.ts): fix variable name from installerFile to configDefFile
fix(plugins.ts): fix variable name from importedConfig.Config to importedConfig.ConfigRef
fix(plugins.ts): fix variable name from serviceConfigDef to serviceConfig
fix(plugins.ts): fix condition for importing serviceConfig
fix(plugins.ts): fix error message for missing Config class in sec-config.ts/js
fix(serviceBase.ts): add missing await statements for logging and events
fix(services.ts): fix import statement for SmartFunctionCallAsync and SmartFunctionCallSync
fix(services.ts): fix indentation
fix(services.ts): fix variable name from pluginConfig to newPlugin.serviceConfig
fix(services.ts): fix condition for parsing pluginConfig
fix(services.ts): fix log level for adding service plugin
fix(services.ts): fix log level for constructing service plugin client
fix(services.ts):
Copy link

coderabbitai bot commented Dec 20, 2023

Important

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit's AI:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@mrinc
Copy link
Member Author

mrinc commented Jan 6, 2024

Closes #25 - 4 demo services result: [INFO] [CORE] [TIMER] BSB took (25249989ns) (25.249989ms)
Closes #22 - removed old files/code
Closes #21 - Changed to yaml and now mapped by new name - prepped for version mapping as well.
Closes #20 - No longer searches and only uses what is referenced.

@mrinc mrinc merged commit 3f4b38c into develop Jan 6, 2024
6 of 8 checks passed
@mrinc mrinc deleted the feature/v9 branch January 6, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment