mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-10 20:56:29 +00:00
7efcc13618
This commit updates the `sourcecred load` command so that it also automatically runs PageRank on completion. The implementation is slightly hacky, in that it prints two sets of task status headers/footers to console, for reasons described in a comment in the source code. The user-visible effect of this hack can be seen below: ``` ❯ node bin/sourcecred.js load sourcecred/example-github Starting tasks GO load-git GO load-github DONE load-github DONE load-git Overview Final result: SUCCESS Starting tasks GO run-pagerank DONE run-pagerank Overview Final result: SUCCESS ``` It would be good to clean this up, but for now I think it's acceptable. Note that it is not safe to assume that a PagerankGraph always exists for repos that are included in the RepoIdRegistry. The repo gets added to the registry before the pagerank task runs. Consumers that are loading the `PagerankGraph` can just check that the file exists, though. Test plan: I've added unit tests that verify that the right tasks are generated. Most importantly, the snapshot of the results of `sourcecred load` now include a snapshotted pagerank graph. (The snapshot was updated via `UPDATE_SNAPSHOT=1 yarn test --full`.) Further progress on #967.