The project's main objective is to handle every feature that lives under the Analytics section of Coveo Cloud Administration Console.
All the commands in the instructions must be run at the root of the
jsadmin-usage-analytics folder, unless otherwise specified.
First you need to install the project's dependencies.
Once the operation is complete, you should see a
node_modules folder at the root of the
This command builds the source code, and automatically triggers a rebuild when a source file is saved.
Run the complete test suite to ensure your local
jsadmin-usage-analytics build is healthy and does not introduce any unwanted regressions.
hg updateon the tip of
hg pull && hg update default).
- Create a branch to work on following our branching model.
- Work work work!
- Create a pull request, our team will automatically be notified.
- We will review your awesome fix/feature as soon as we manage to.
- Once your PR gets enough approvals (at least 2 different members of our team), you can merge (or ask us to do so if you don't have the required credentials).
- Our automated build system will take care of the rest.
- A pull request that increases or maintain the code coverage ratio has higher chances of being merged quickly.
- Make sure your pull requests follow the project's code style. To do so, you can simply run
npm run lintfixand it'll fix all the code style errors by itself. Don't forget to commit those changes.
- We're pretty flexible on the commit messages structure and pull requests descriptions, but still, make sure your commit messages and pull request descriptions provide enough details for fellow reviewers.
- We tend to avoid comments in our code base, we strongly prefer good naming and code structure.
Pull request demos
Our automated build system kindly provides a demo link for each pull request, given the build is healthy (all unit tests have run successfully). When available, the links are automatically posted in our
#cloudadminbuild private Slack channel. We will gladly invite you to the channel if you're not already a member when you submit a pull request. If we forget to do so, just ping us in Slack and we'll do it right away.
Front-end developpers are visual creatures!
We always like to see your changes in action (when it is relevant) before merging pull requests. Therefore, please include a comment in your pull requests that provides the demo link once it is available. Also, it makes things easier for everone when the link points towards the exact section where lies the bulk of your changes.
Tips and tricks
npm testcommand creates a local coverage report at the end of its execution. You can browse this report to see the hits and misses of your unit tests. To do so, open the
coverage/lcov-report/index.htmlfile in your favorite web browser.
npm run test:watchcommand will run tests on file save.
npm run reconstructcommand will reinstall and rebuild your local branch from scratch without discarding any pending change. Run this if you think your current state is corrupted.
- You can target specific unit tests or test suites by putting an
fcharacter in front of any
describeblock (thus writing
fdescribe). Only tests in the targeted blocks will be run on the next execution. Don't forget to remove the
jsadmin-usage-analytics changes locally in the administration console
|Step||Terminal window 1||Terminal window 2|
You can leave both terminal windows running. Changes saved in either repositories will trigger a rebuild of the local demo.
npm installin either of the linked repos might break the npm link. Running again the steps above will fix the situation.
Sometimes you might also need to use your local changes from
jsadmin-common. If that is the case:
jsadmin-usage-analytics, this step is only to provide the proper typings to your IDE, it would still work at runtime without it;
jsadmin-v2using the commands described above.