Skip to content

Commit

Permalink
Merge branch 'release/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chronosis committed Mar 27, 2021
2 parents 9c4adaf + 7121162 commit 216aa08
Show file tree
Hide file tree
Showing 21 changed files with 2,780 additions and 2,306 deletions.
3 changes: 3 additions & 0 deletions .github/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- match:
dependency_type: all
update_type: "semver:minor"
34 changes: 34 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 365
# Number of days of inactivity before a stale Issue or Pull Request is closed
daysUntilClose: 14
# Issues or Pull Requests with these labels will never be considered stale
exemptLabels:
- "status: triaged"
- "type: security"
# - regression
# Label to use when marking as stale
staleLabel: "status: stale"
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
Thanks for your contribution!
This issue has been automatically marked as stale because it has not had
recent activity. Because the Out Of Sync team treats their issues
[as their backlog](https://en.wikipedia.org/wiki/Scrum_(software_development)#Product_backlog), stale issues
are closed. If you would like this issue to remain open:
1. Verify that you can still reproduce the issue
1. Comment that the issue is still reproducible and include:
* What OS and version you reproduced the issue on
* What steps you followed to reproduce the issue
Issues that are labeled as triaged will not be automatically marked as stale.
# Comment to post when removing the stale label. Set to `false` to disable
unmarkComment: false
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: issues
44 changes: 44 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: auto-merge

on:
pull_request:
branches:
- develop

jobs:
auto-merge:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2

- name: 'Use Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v1
with:
always-auth: true
node-version: ${{ matrix.node-version }}

- name: 'NPM Test'
shell: bash
run: |
npm version patch
npx -c 'echo "$npm_package_version"'
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry http://registry.npmjs.org
npm config set always-auth true
sudo mkdir ~/.npm || true
sudo chown -R $USER:$GROUP ~/.npm || true
sudo chown -R $USER:$GROUP ~/.config || true
npm ci
gulp
npm run coverage
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.mytoken }}
74 changes: 74 additions & 0 deletions .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and Test Develop

on:
push:
branches:
- develop

jobs:
develop-push:
name: 'Develop Testing'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
slack-channel: ['build-monitoring']
steps:
- name: 'Notify build start'
uses: voxmedia/github-action-slack-notify-build@v1
id: slack
with:
channel: ${{ matrix.slack-channel }}
status: STARTED
color: warning
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: 'Checkout'
uses: actions/checkout@master

- name: 'Use Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v1
with:
always-auth: true
node-version: ${{ matrix.node-version }}

- name: 'NPM Test'
shell: bash
run: |
npm install -g gulp-cli gulp@4
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry http://registry.npmjs.org
npm config set always-auth true
sudo mkdir ~/.npm || true
sudo chown -R $USER:$GROUP ~/.npm || true
sudo chown -R $USER:$GROUP ~/.config || true
npm ci
gulp
npm run coverage
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- name: Notify slack success
if: success()
uses: voxmedia/github-action-slack-notify-build@v1
with:
# Updates existing message from the first step
message_id: ${{ steps.slack.outputs.message_id }}
channel: ${{ matrix.slack-channel }}
status: SUCCESS
color: good
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Notify slack fail
if: failure()
uses: voxmedia/github-action-slack-notify-build@v1
with:
message_id: ${{ steps.slack.outputs.message_id }}
channel: ${{ matrix.slack-channel }}
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
82 changes: 82 additions & 0 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Master build

on:
push:
branches:
- master

jobs:
master-push:
name: 'Master Build'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
slack-channel: ['build-monitoring']
steps:
- name: 'Notify build start'
uses: voxmedia/github-action-slack-notify-build@v1
id: slack
with:
channel: ${{ matrix.slack-channel }}
status: STARTED
color: warning
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: 'Checkout'
uses: actions/checkout@master

- name: 'Use Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v1
with:
always-auth: true
node-version: ${{ matrix.node-version }}

- name: 'NPM Test'
shell: bash
run: |
npm install -g gulp-cli gulp@4
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry http://registry.npmjs.org
npm config set always-auth true
sudo mkdir ~/.npm || true
sudo chown -R $USER:$GROUP ~/.npm || true
sudo chown -R $USER:$GROUP ~/.config || true
npm ci
gulp
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- name: 'NPM Publish'
shell: bash
run: |
npm run coverage || true
npm publish || true
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

- name: Notify slack success
if: success()
uses: voxmedia/github-action-slack-notify-build@v1
with:
# Updates existing message from the first step
message_id: ${{ steps.slack.outputs.message_id }}
channel: ${{ matrix.slack-channel }}
status: SUCCESS
color: good
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Notify slack fail
if: failure()
uses: voxmedia/github-action-slack-notify-build@v1
with:
message_id: ${{ steps.slack.outputs.message_id }}
channel: ${{ matrix.slack-channel }}
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:14

# Create app directory
WORKDIR /usr/src/app
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright © 2017, 2018, 2019 Jay Reardon
Copyright © 2019 Out of Sync Studios LLC
Copyright © 2017-2019 Jay Reardon
Copyright © 2019-2021 Out of Sync Studios LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
[![NPM](https://nodei.co/npm/uriel.png?downloads=true)](https://nodei.co/npm/uriel/)

[![Actual version published on npm](http://img.shields.io/npm/v/uriel.svg)](https://www.npmjs.org/package/uriel)
[![Travis build status](https://travis-ci.org/OutOfSyncStudios/uriel.svg)](https://travis-ci.org/OutOfSyncStudios/uriel)
[![Master build](https://github.com/OutOfSyncStudios/uriel/actions/workflows/build-master.yml/badge.svg)](https://github.com/OutOfSyncStudios/uriel/actions/workflows/build-master.yml)
[![Total npm module downloads](http://img.shields.io/npm/dt/uriel.svg)](https://www.npmjs.org/package/uriel)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ced17e413a2e48b0b27c3bc691a7c479)](https://www.codacy.com/manual/OutOfSyncStudios/uriel?utm_source=github.com&utm_medium=referral&utm_content=OutOfSyncStudios/uriel&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/ced17e413a2e48b0b27c3bc691a7c479)](https://www.codacy.com/app/OutOfSyncStudios/uriel?utm_source=github.com&utm_medium=referral&utm_content=OutOfSyncStudios/uriel&utm_campaign=Badge_Coverage)
[![Dependencies badge](https://david-dm.org/OutOfSyncStudios/uriel/status.svg)](https://david-dm.org/OutOfSyncStudios/uriel?view=list)
[![Dependencies badge](https://status.david-dm.org/gh/OutOfSyncStudios/uriel.svg)](https://david-dm.org/OutOfSyncStudios/uriel?view=list)

A simple service that pushes system information (e.g. system usage, memory, cpu, network, swap, diskio, and disk usage) to any compatible statsd service (e.g. StatsD, Telegraf, DogStatsD, etc.)

Expand Down Expand Up @@ -360,5 +360,5 @@ The following buckets are used to capture statistics:
<a name="license"></a>
# [License](#license)

Copyright © 2017, 2018, 2019 Jay Reardon
Copyright © 2019 Out of Sync Studios LLC -- Licensed under the MIT license.
Copyright © 2017-2019 Jay Reardon
Copyright © 2019-2021 Out of Sync Studios LLC -- Licensed under the MIT license.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// app.js
/* eslint no-console: "off" */

const __ = require('lodash');
const isNil = require('lodash.isnil');
const fs = require('fs');
const program = require('commander');
const pack = require('./package.json');
Expand Down Expand Up @@ -92,7 +92,7 @@ class App {

// Perform gracful shutdown here
this.log.info(`Received exit code ${sigCode}, performing graceful shutdown`);
if (!__.isNull(this.server) && !__.isUndefined(this.server)) {
if (!isNil(this.server)) {
this.server.close();
}
// Shutdown the server
Expand Down
4 changes: 2 additions & 2 deletions app/lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// app/lib/logger.js

// Dependencies
const __ = require('@outofsync/lodash-ex');
const assign = require('lodash.assign');
const fs = require('fs');
const winston = require('winston');
const { format } = winston;
Expand Down Expand Up @@ -49,7 +49,7 @@ class Logger {
}

// Merge options from config into this object
this.options = __.assign(this.options, config.logging.options);
this.options = assign(this.options, config.logging.options);
this.log = winston.createLogger(this.options);
}

Expand Down
4 changes: 2 additions & 2 deletions app/lib/monitor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// app/lib/monitor.js
const __ = require('@outofsync/lodash-ex');
const toPairs = require('lodash.topairs');

class Monitor {
constructor(name, statsFactory) {
Expand All @@ -25,7 +25,7 @@ class Monitor {
this.statistics = [];
for (let itr = 0, itrTest = objArr.length; itr < itrTest; itr++) {
const obj = objArr[itr];
const tempStats = __.toPairs(obj.value).map((pair) => {
const tempStats = toPairs(obj.value).map((pair) => {
const name = this.name + '.' + pair[0];
const val = pair[1];
return this.statsFactory.create(name, val, obj.tags);
Expand Down
7 changes: 4 additions & 3 deletions app/lib/statsFactory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// app/lib/statsFactory.js
const __ = require('@outofsync/lodash-ex');
const snakeCase = require('lodash.snakecase');
const isNil = require('lodash.isnil');

class StatsFactory {
constructor(hostname, statsd, tags, log) {
Expand All @@ -21,7 +22,7 @@ class StatsFactory {
tags = tags || [];
name = name.split('.')
.map((str) => {
return __.snakeCase(str);
return snakeCase(str);
})
.join('.');

Expand All @@ -44,7 +45,7 @@ class StatsFactory {
}

// Only send if the statsd connection has not been shut down
if (__.hasValue(this.statsd)) {
if (!isNil(this.statsd)) {
for (let itr = 0, jtr = collection.length; itr < jtr; itr++) {
let tempTags = Object.assign([], this.tags);
const stat = collection[itr];
Expand Down
Loading

0 comments on commit 216aa08

Please sign in to comment.