Skip to content

Instantly share code, notes, and snippets.

View gregblake's full-sized avatar
👨‍💻

Greg Blake gregblake

👨‍💻
View GitHub Profile
@gregblake
gregblake / jenkins_cleanup.sh
Created May 16, 2019 14:09
Jenkins Cleanup
# Build Directory
root@ci-jenkins-worker17:/var/lib/jenkins/workspace# ls -lthr
total 120K
drwxr-xr-x 3 jenkins jenkins 4.0K Feb 28 2018 bundle
drwxr-xr-x 3 jenkins jenkins 4.0K Apr 16 2018 powerhome_APP_master-J5G4RJZTP34PGOQRLMB5WI6LQDR6XYOPWYG6TBUWFF7XWNN4XXRQ@2@tmp
drwxr-xr-x 2 jenkins jenkins 4.0K Oct 25 2018 powerhome_APP_PR-192-UJZ7UBZSKMLDUOJV5ARJMZXJWEA7QVM5H74IQ3BOOITDUCTIL4PQ@tmp
drwxr-xr-x 2 jenkins jenkins 4.0K Dec 14 13:12 powerhome_APP_PR-232-5XUFTFXON36MKQ5VKFBZJCKJQAHXKPMYK6LX45UELNN5B2SPCD2Q@tmp
drwxr-xr-x 2 jenkins jenkins 4.0K Dec 18 13:11 powerhome_APP_PR-233-OV4XFRFSTXRXNA5TKJ6N3B53BHW2Q4SG4ITQZYEWFRUMJOMQBVQA@tmp
drwxr-xr-x 2 jenkins jenkins 4.0K Jan 2 08:18 powerhome_APP_PR-251-T2LISWURUIDI2ZWNMR4XWLIEUZ6UKAUNHAMVES4P6NANJ2SR3YRA@tmp
@gregblake
gregblake / cacem_specs.rb
Created May 14, 2019 16:07
CACEM Specs with rspec bisect
nitro-web/components/connect_and_corporate_events_models git/master* 72s
❯ be rspec --bisect spec/models/connect/room_membership_spec.rb
Bisect started using options: "spec/models/connect/room_membership_spec.rb"
Running suite to find failures...RAILS_ENV=test environment is not defined in config/webpacker.yml, falling back to production environment
Bisect failed!
No failures found. Bisect only works in the presence of one or more failing examples.
@gregblake
gregblake / rspsect_bisect.sh
Last active April 25, 2019 17:45
Using rspec bisect on ./nitro-web/components/connect/spec/models/notifiable_message_spec.rb
nitro-web/components/connect git/master* 52s
❯ be rspec /Users/greg/code/nitro-web/components/connect/spec/models/notifiable_message_spec.rb --bisect --seed=15437
Bisect started using options: "/Users/greg/code/nitro-web/components/connect/spec/models/notifiable_message_spec.rb --seed=15437"
Running suite to find failures...
Bisect failed!
No failures found. Bisect only works in the presence of one or more failing examples.
nitro-web/components/connect git/master* 76s
@gregblake
gregblake / flaky_specs.md
Last active April 23, 2019 20:46
Flaky Specs in the Connect and CACEM components
  • The root cause is that a line of code in the scrum_model component used NitroRedis.fluhall deleted every Redis database on the server, before each test in the scrum_model component ran.
  • This had been that way since early 2017. I feel like it was a reasonable choice to make before components were even really a thing in Nitro. There was only one Redis database in the test suite at that time, and the test suite didn't run in parallel.
  • The primary goal of componentizing Connect is to have the Connect tests in parallel with the tests in the other components. This is precisely what makes the build times significantly faster.
  • Along with every other component, the Connect tests now run at the same time as the scrum_model specs (before Connect was componentized, scrum_model specs ran well before the Connect specs, since Connect was part of core_models prior to being extracted into a new component).
  • The side effect of componentizing Connect, though, was a race con
@gregblake
gregblake / stefan_snippet.js
Created April 9, 2019 21:15
stefan_snippet.js
if (permissions && Object.keys(permissions).count > 0) {
let unauthorizedPermission = Object.keys(permissions).find(key => {
return permissions[key] !== 'authorized';
});
if (unauthorizedPermission) {
this.props.requestPermission(unauthorizedPermission);
}
let hasAllPermissions = unauthorizedPermission == null;
this.setState({ hasAllPermissions });
}
@gregblake
gregblake / apns.json
Created April 3, 2019 14:04
Basic APNS Payload
{"aps":
{"alert":
"Actually, I didn't make the claim that Ruby follows the principle of least surprise. Someone felt the design of Ruby follows that philosophy, so they started saying that. I didn't bring that up, actually.",
"sound": "default"},
"headers": {"apns-topic": "com.powerhrg.connect-rn.dev"}}
@gregblake
gregblake / push_notification_payload.json
Last active March 21, 2019 14:41
GCM Push Notification Payload Example
{ "data":
{ "badge":1,
"category":"connect-reply",
"message-type":"connect",
"as-of":"2018-04-12T06:55:32-04:00",
"nitro-environment":"test",
"sound":"nitro_notification.mp3",
"user_id":1001,
"connect_message":
{ "messages":
@gregblake
gregblake / commit.sh
Created February 28, 2019 16:26
Commit hooks
husky > npm run -s precommit (node v8.7.0)
↓ Running tasks for app/**/*.{js,jsx,json} [skipped]
→ No staged files match app/**/*.{js,jsx,json}
↓ Running tasks for __tests__/**/*.{js,jsx,json} [skipped]
→ No staged files match __tests__/**/*.{js,jsx,json}
[feature/custom_server_picker d1609133] Lint and cleanup
Date: Thu Feb 28 09:36:24 2019 -0500
3 files changed, 13 insertions(+), 4 deletions(-)
create mode 100644 app/components/styles/AddServer.js
@gregblake
gregblake / testing_notes_pr_10485.md
Created February 25, 2019 19:17
Testing Notes: Removing the Support Component's Dependency on NCT

Removing the Support Component's Dependency on NCT

  • Do support ticket tags still work properly?
  • Do tickets still act correctly when nobody is assigned to the ticket?
  • Does user data display (name, title, active, department, profile image) correctly for people who: submitted the ticket, are assigned to the ticket, etc.
  • Do project support tickets work right, too?
  • I don't think these changes effect warranty service tickets...but I'm not positive about that, so it's probably wise to double check.
  • Does the "whitelist user titles controller" still work properly?
  • The changes we made to date ranges are also used on the Scheduler sessions "completed calls" page.
@gregblake
gregblake / call_queue_ui.sh
Created February 7, 2019 17:33
cd components/call_queue_ui; bin/schema && bin/doc && bin/build && bin/test
12:32 $ cd components/call_queue_ui; bin/schema && bin/doc && bin/build && bin/test
This component doesn't have a database
>>> Javascript Components don't yet have documentation. PRs accepted.
> @powerhome/call_queue_ui@0.0.1 lint /Users/greg/code/nitro-web/components/call_queue_ui
> NODE_PATH=app eslint . --ext .js,.jsx
/Users/greg/code/nitro-web/components/call_queue_ui/app/components/AgentsTable.jsx
16:21 warning 'name' is missing in props validation react/prop-types