This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Micropilot #73
Merged
Merged
Micropilot #73
Changes from 7 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d0db489
rollback this change
b86d69c
Revert "rollback this change"
3fcfb63
Merge branch 'master' of github.com:mozilla/blushproof
ddbb700
Merge branch 'master' of github.com:mozilla/blushproof
ca63f8e
First cut at integrating micropilot
6acd3bc
Clean up some stuff
33d2cf4
Add some comments
6d50291
Fix readme
9a2261b
Merge branch 'master' of github.com:mozilla/blushproof into micropilot
7b34a80
Added micropilot logging
9645900
Fix up tests
560f6be
Fixed more tests
e9990b4
More test cleanups
c192357
More test cleanups
22efa0e
Fixed first 3 tests
195ca83
Fixed first 4 tests
792fb80
blush and forget this broken
279fac2
refactor
149165a
refactor
58f6771
5 tests working
98dafb1
mostly done
880cfbc
really mostly done
ed8a8ac
everything works, hooray
b1957bc
Use global event queue
7d406e9
Use global assert object
0e69d58
cleanups
8c962ba
comments
7389408
comments
a7a24aa
forgot assert
bcbd950
Indentation mostly
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.swp | ||
*~ | ||
packages/micropilot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// This module encapsulates all the micropilot logic. Other modules should only | ||
// ever have to use monitor.record. | ||
|
||
let micropilot = require("micropilot"); | ||
|
||
const { storage } = require("simple-storage"); | ||
|
||
let monitor = micropilot.Micropilot("blushproof").start(); | ||
|
||
function daily_upload() { | ||
// Placeholder for metadata about the upload. We probably want to keep track | ||
// of the last upload. | ||
monitor.record({ts: Date.now()}); | ||
// Placeholder for the upload url. | ||
monitor.upload("fake.com", { simulate: true }).then(function(req) { | ||
console.log(JSON.stringify(req.content)); | ||
}); | ||
}; | ||
|
||
micropilot.Fuse({ | ||
start: Date.now(), | ||
// Run forever | ||
duration: false, | ||
// Upload every day in milliseconds | ||
pulseinterval: 24 * 60 * 60 * 1000, | ||
// (Upload more often for testing) | ||
// pulseinterval: 10 * 1000, | ||
pulsefn: daily_upload | ||
}); | ||
|
||
exports.monitor = monitor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,21 @@ | |
"description": "stop opening naughty sites accidentally", | ||
"author": "David Keeler <[email protected]>, Monica Chew <[email protected]>, Gregg Lind <[email protected]>", | ||
"license": "MPL 2.0", | ||
"version": "0.1" | ||
} | ||
"version": "0.1", | ||
"dependencies": [ | ||
"micropilot" | ||
], | ||
"preferences": [ | ||
{ | ||
"type": "bool", | ||
"title": "micropilotlog", | ||
"name": "micropilotlog", | ||
"value": true | ||
} | ||
], | ||
"volo": { | ||
"dependencies": { | ||
"packages/micropilot": "github:gregglind/micropilot/v0.8" | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, there's no newline at the end of this file. Do we care? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got a trailing whitespace error when I tried to commit! Seems a little strict... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting this to automatically fetch micropilot for me. Too much to ask, or do I not have volo set up correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, but am not sure, that this means that if we use volo to install blushproof itself then volo will fetch packages/micropilot, e.g.
volo create myaddon micropilot-template
However, I'm not sure how/if we can take advantage of that in the development cycle.
@gregglind, any clues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be supported: volojs/volo#149
Seems like the intended workflow is to manually call volo add -f when you want to update the dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, figure out workflow by reading bugs: volojs/volo#22
@jrburke, is the expected workflow to contribute to a git-managed codebase with volo dependencies to
git clone myproject
cd myproject
volo add
?