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

Reduce mode #221

Merged
merged 14 commits into from
Jul 10, 2018
Merged

Reduce mode #221

merged 14 commits into from
Jul 10, 2018

Conversation

tapaswenipathak
Copy link
Contributor

@tapaswenipathak tapaswenipathak commented Jun 18, 2018

Branch for #212 as git rebase master is....

Updates in the linked PR.

cc @mapbox/platform-engine-room.

For some reason jest is not passing, I deleted the repo, cloned it and then again run npn run update-jest-snapshots, doesn't work. Tried with deleted package-lock.json and rm -rf node_modules/ and then again npm ci, this has worked before.

@tapaswenipathak tapaswenipathak force-pushed the watchbot4 branch 6 times, most recently from bb7f2aa to 9f219d9 Compare June 18, 2018 12:31
@arunasank
Copy link
Contributor

arunasank commented Jun 18, 2018

For some reason jest is not passing, I deleted the repo, cloned it and then again run npn run update-jest-snapshots, doesn't work. Tried with deleted package-lock.json and rm -rf node_modules/ and then again npm ci, this has worked before.

👋 @tapasweni-pathak, it seems like some of the updates to the jest dependencies are malfunctioning. To fix:

  • Reset your version of package-lock.json to what's on master (So, revert the changes to package-lock.json alone on 9f219d9)
  • Run npm run update-jest-snapshots

I have tested that this works ^, and is the root cause. Let me know if it works for you! 🙂

@tapaswenipathak
Copy link
Contributor Author

👋@arunasank I have to delete package-lock.json and re run npm ci once as I added a package, can't keep the master one. Plus as I wrote I delete the directory, reclone and install and run update-jest-snapshots it still doesn't work.

@arunasank
Copy link
Contributor

arunasank commented Jun 18, 2018

👋@arunasank I have to delete package-lock.json and re run npm ci once as I added a package, can't keep the master one. Plus as I wrote I delete the directory, reclone and install and run update-jest-snapshots it still doesn't work.

The reason the jest portion is not working is because when you're deleting the package-lock.json and running npm install, the dependencies for jest are getting updated (along with the dependencies for the new packages you're interested in installing), and these updated jest dependencies seem to be malfunctioning on your branch and others. Since you need to delete package-lock.json for using your new packages, maybe you can:

  • Use the package-lock.json from master to update the jest snapshots
  • Then delete package-lock.json and install your new modules.

While this will fix the issue of updating the snapshots, tests will still fail on Travis, because of the updated package-lock.json, and the involvement of jest in some pre-tests. Going to check if there's a way to partially update the package-lock.json file.

@tapaswenipathak
Copy link
Contributor Author

tapaswenipathak commented Jun 18, 2018

@arunasank We can voice on it, this is weird,

  1. rm -rf ecs-watchbot/.
  2. git clone git@github.com:mapbox/ecs-watchbot.git.
  3. cd ecs-watchbot
  4. git fetch origin
  5. rm package-lock.json
  6. npm install && npm link (was using npm ci)
  7. npm run update-jest-snapshots

This is when I need to update package-lock.json. I used the updated package-lock.json and it passed. I plan to ticket in jest, just curious what exactly is happening. I have had this with jest before as well. I agree on dependencies updating, thanks for finding the time to write the notes.

@arunasank
Copy link
Contributor

This is when I need to update package-lock.json. I used the updated package-lock.json and it passed.

👍 Glad it's fixed!

.eslintrc Outdated
@@ -6,7 +6,7 @@
"jest": true
},
"parserOptions": {
"ecmaVersion": "2017"
"ecmaVersion": 8

Choose a reason for hiding this comment

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

Why the switch to ecmaVersion 8 here?

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 think ecmaVersion released in 2017 is 8th edition, so can be written as 2017 or 8.

lib/template.js Outdated
notificationTopic: cf.ref(prefixed('NotificationTopic'))
};

const reduce = (prefixed, Resources, options, ref) => {

Choose a reason for hiding this comment

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

What is your goal with making this section a function, rather than putting this code inside the if statement on line 237?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can change it to be inside the if statement on line 237, added it to be consistent with the other methods defined in the template like mount e.t.c.

@tapaswenipathak tapaswenipathak force-pushed the watchbot4 branch 2 times, most recently from ecd4637 to 5f3f0f4 Compare June 22, 2018 17:43
/**
* watchbot-log "something that you want logged"
* - or -
* echo "somehing that you want logged" | watchbot-log

Choose a reason for hiding this comment

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

We've removed watchbot-log from watchbot 4. Could you delete this file?

lib/template.js Outdated
@@ -145,6 +155,39 @@ module.exports = (options = {}) => {
);
};

const reduce = (prefixed, Resources, options, ref) => {

Choose a reason for hiding this comment

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

I still think the fact that this function is only used once and modifies Resources, options and ref, we shouldn't have the code live in a function, but instead have it live inside of the if statement at line 227. If we do want to keep it as a function, we should have that function live right next to the if statement at line 227 so we can easily reference the function code.

@tapaswenipathak tapaswenipathak force-pushed the watchbot4 branch 2 times, most recently from 74644d7 to 36692a5 Compare June 27, 2018 06:18
@jakepruitt jakepruitt force-pushed the watchbot4 branch 3 times, most recently from d80b833 to 7dd0e45 Compare July 6, 2018 14:57
tapaswenipathak and others added 6 commits July 10, 2018 12:13
CannotLoadTemplateError: Failed to parse CloudFormation template.
ReferenceError: ref is not defined
@jakepruitt
Copy link

This looks good!

@jakepruitt jakepruitt merged commit 49e87be into master Jul 10, 2018
@jakepruitt jakepruitt deleted the watchbot4 branch July 10, 2018 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants