Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Spring cleaning fall 2017 #48

Closed
wants to merge 17 commits into from

Conversation

djmitche
Copy link
Contributor

No description provided.

@djmitche djmitche self-assigned this Dec 20, 2017
imbstack
imbstack previously approved these changes Dec 20, 2017
Copy link
Contributor

@imbstack imbstack left a comment

Choose a reason for hiding this comment

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

these changes were split up nicely!

Copy link
Contributor

@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 nice! R+ aside from renaming src/ to lib/ and the string building to form the /v1.

I second Brian's remark about splitting the changes out. Review was really easy as a result.

@@ -378,7 +378,6 @@ if (!module.parent) {
log.fatal({err}, 'Unhandled Promise Rejection!');
throw err;
});
require('source-map-support').install();
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks!

package.json Outdated
"eslint": "^4.9.0",
"eslint-config-taskcluster": "^2.0.0",
"eslint-plugin-taskcluster": "^1.0.2",
"eslint-config-taskcluster": "^3.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

oh neat! we declared all the deps as deps of this package? great!

Procfile Outdated
@@ -1 +1 @@
web: node lib/main start | ./node_modules/.bin/bunyan -o short
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I'd like to leave this as lib/. This tool was the first to use babel-less node again, and has used lib/ from day one. Best practises should have been written after examining prior art like this repository.

As for the reason, this code is not source for a compiler, rather it's executable code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find these little differences trip me up repeatedly when working across multiple services, for example when upgrading a widely-used TC library. Remembering that ec2-manager is "different" is just a little cognitive drag.

It will take quite a bit of time to shift every other service over to lib/, rather than shifting this one to src/. Is it worth spending that time for three letters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We agreed to just leave these different.

src/main.js Outdated
@@ -82,6 +83,21 @@ let load = loader({
},
},

docs: {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have something here to ensure that docs are only published for those environments which have requested publishing in their config.yml entry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default is

    publish: process.env.NODE_ENV == 'production',

so this shouldn't need any special handling.

Copy link
Contributor

Choose a reason for hiding this comment

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

nope, NODE_ENV is set to production even for staging apps. We should also not be reading the NODE_ENV variable outside of lib/main.js

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, then we should pass an explicit publish to this argument, based on a config.yml value.

package.json Outdated
@@ -19,7 +19,7 @@
},
"dependencies": {
"aws-sdk": "^2.172.0",
"bluebird": "^3.5.0",
"bluebird": "^3.5.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure we're not actually using bluebird at all... It can probably be deleted.

@@ -56,7 +55,7 @@ production:
env: production
forceSSL: true
trustProxy: true
baseUrl: 'https://ec2-manager.herokuapp.com/v1'
Copy link
Contributor

Choose a reason for hiding this comment

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

I was under the impression that the base url was supposed to have the /v1 in it

src/main.js Outdated
@@ -119,7 +119,7 @@ let load = loader({
instancePubKey: cfg.app.instancePubKey,
state: state,
regions: cfg.app.regions,
apiBaseUrl: cfg.server.baseUrl,
apiBaseUrl: cfg.server.publicUrl + '/v1',
Copy link
Contributor

Choose a reason for hiding this comment

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

ahh, you're adding it here. Let's leave this as a hard coded value in the config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is bringing the approach into line with taskcluster-queue and other services. That service doesn't send the API base URL as context, but does include it as an argument to v1.setup(..).

@djmitche
Copy link
Contributor Author

djmitche commented Jan 5, 2018

I dropped the lib/ -> src/ move.

I think that handling publicUrl consistently will be important when we are deploying all of the services using taskcluster-standalone, so I'd like to keep that in.

@djmitche djmitche requested a review from jhford January 5, 2018 15:35
@djmitche djmitche assigned jhford and unassigned djmitche Jan 9, 2018
@djmitche
Copy link
Contributor Author

djmitche commented Jan 9, 2018

Conversation yesterday indicated @jhford is manually rebasing this and will land.

@djmitche
Copy link
Contributor Author

djmitche commented May 1, 2018

I don't know if this ever landed, but it's too far bitrotted to recover now..

@djmitche djmitche closed this May 1, 2018
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.

None yet

3 participants