= oVirt Dashboard

== Introduction

This project contains http://www.ovirt.org/[oVirt]
http://www.ovirt.org/develop/release-management/features/ux/uiplugins/[UI plugin]
that gives overview of the virtualized environment and its specific objects.

This plugin is installed during oVirt Engine installation and upgraded via `engine-setup`.
This means no manual steps are required in order to install this plugin in production env.

== Setting up development environment

=== Prerequisites

Install https://nodejs.org/[Node.js] v4 (LTS). https://github.com/creationix/nvm[nvm]
can be used to manage multiple Node.js versions.

Run `node -v` to check the current Node.js version.

Build and configure oVirt Engine according to its
https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob_plain;f=README.adoc;hb=master[developer instructions].

=== Dashboard setup

* `npm install` to install dependencies (this might take a while)
* `npm test` to run tests (single run)
* `npm run test:watch` for continuous testing (watch & rerun tests on change)
* `npm run dev` for development build and watch & recompile files on change
* `npm run build` for production build

=== Engine setup

Symlink plugin resources to `ui-plugins` directory as following:

  cd ${PREFIX}/share/ovirt-engine/ui-plugins/
  ln -s ${PLUGIN_HOME}/dist/dashboard.json dashboard.json
  ln -s ${PLUGIN_HOME}/dist/dashboard-resources dashboard-resources

=== Accessing plugin

Open WebAdmin in your browser, you should land on *Dashboard* main tab automatically:

  https://engine.example:8443/ovirt-engine/webadmin/WebAdmin.html

== Instructions for maintainers

=== Managing dependencies

Dependencies not related to production build (not needed for `npm run build`)
should go into `devDependencies`. Try to keep as few `dependencies` as possible.

Whenever `dependencies` are changed:

* submit patch for https://gerrit.ovirt.org/#/q/project:releng-tools[releng-tools]:
** `specs/ovirt-engine-nodejs-modules/package.json` - reflect required dependencies
** `specs/ovirt-engine-nodejs-modules/ovirt-engine-nodejs-modules.spec.in` - bump `Version` and update `%changelog`
** `specs/ovirt-engine-nodejs-modules/CHANGES.adoc` - document changes made to `package.json`

=== Package versioning

* alpha and beta builds (pre-releases): `x.y.z-0.N` where version stays the same
* RC and GA builds (releases): `x.y.z-N` where version grows between releases

`version` in `package.json` is reflected into the RPM `x.y.z` version.

=== Release process

Only covers release builds (RC and GA).

. switch to appropriate stable branch
. submit & merge patch that prepares the branch for release:
.. `package.json` - ensure proper `version`
.. `packaging/spec.in` - ensure proper `Release` number and update `%changelog`
.. `automation/*.repos` - ensure proper repos (don't use `ovirt-master-snapshot`)
. pull changes from remote, tag release-prep patch and push the tag to remote:
.. `git fetch`
.. `git tag -a <tag-name> -m <tag-annotation-message>`
.. `git push origin <tag-name>`
. trigger Jenkins build on release-prep patch or build locally using
  http://ovirt-infra-docs.readthedocs.io/en/latest/CI/Build_and_test_standards.html#testing-the-scripts-locally[mock_runner]
. update oVirt release config in `releng-tools` repo

Tag name example: `ovirt-engine-dashboard-1.0.0-1`

Tag annotation message example: `Dashboard 1.0 RC1`
