Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Modernize Hooks#36

Merged
djmitche merged 6 commits intotaskcluster:masterfrom
djmitche:modernize
Jan 30, 2017
Merged

Modernize Hooks#36
djmitche merged 6 commits intotaskcluster:masterfrom
djmitche:modernize

Conversation

@djmitche
Copy link
Copy Markdown
Contributor

This adheres to modern standards for TC microservices.

I'm starting to write those standards down, too and will create a docs page with the results.

r? jhford since you built a lot of these modernizations :)

@djmitche djmitche self-assigned this Jan 21, 2017
@djmitche djmitche requested a review from jhford January 21, 2017 06:15
@jonasfj
Copy link
Copy Markdown
Contributor

jonasfj commented Jan 22, 2017

@djmitche please consider documenting them in the taskcluster-skeleton repository... I already started on the folder layout....

@djmitche djmitche mentioned this pull request Jan 23, 2017
Copy link
Copy Markdown

@jhford jhford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I didn't get a chance to run the tests, but I assume you did that and they pass. I hope you knew about the --fix flag to eslint for fixing all the lint :)

r+, with the fixes to the babel stuff.

Comment thread Procfile Outdated
@@ -1,2 +1,2 @@
web: babel-node bin/main.js server
scheduler: babel-node bin/main.js scheduler No newline at end of file
web: babel-node src/main.js server
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this might work, but it will end up actually not using the compiled (and tested) javascript code. Instead, what you should be doing is node lib/main.js ... for both entries.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and also, this behaviour is depending on babel-node being installed, but that binary was removed (iirc) in an update to the 'babel' package a while ago, so this would likely fail on deploy as the required binary would be absent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch, thanks! It definitely won't work as-is!

Comment thread config.yml Outdated
region: us-west-2
apiVersion: 2014-01-01
monitor:
mock: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other main.js files, we usually compare the environment to production and use that truthiness value instead of coding a true or false into the config files. not too important.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to go both ways (I copied this from another service). I'll add this to my list for best practices.

Comment thread src/main.js Outdated
setup: ({process, profile, cfg}) => monitor({
project: 'taskcluster-hooks',
credentials: cfg.taskcluster.credentials,
mock: cfg.monitor.mock, // true in production, false in testing
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is where i'd do the mock: profile !== 'production' check.

Comment thread test/runtests.sh Outdated
# USAGE: Run this file using `npm test` from repository root

mocha test/*_test.js
mocha .test/*_test.js
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can safely delete this file i believe? Its only purpose was to wrap the package.json script entry iirc, so now that you're calling into mocha directly, It's not important to exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another good catch :)

Comment thread package.json Outdated
"aws-sdk": "^2.2.0",
"azure-entities": "^0.9.0",
"azure-entities": "^0.9.1",
"babel": "^5.8.21",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be removed because it's no longer needed as babel-compile pulls in the correct version of babel-core.

@djmitche
Copy link
Copy Markdown
Contributor Author

@jhford I think that addresses the fixes you mentioned. I'm away until Monday, so there's plenty of time if you want to have another look -- otherwise I can just merge on Monday given the r+ above.

@jhford
Copy link
Copy Markdown

jhford commented Jan 30, 2017

Looks good to me!

@djmitche djmitche merged commit 2e3ca31 into taskcluster:master Jan 30, 2017
djmitche added a commit to djmitche/taskcluster-hooks that referenced this pull request Jan 30, 2017
This was missed in conflict resolution in taskcluster#36.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants