Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • web-et-numerique/factory/llle_project/self-data-technical-doc
1 result
Show changes
Commits on Source (6)
No preview for this file type
......@@ -25,4 +25,4 @@ If we want to build a new stack version it's easy ! A manual pipeline has been c
![Stack Pipeline](/img/stack-pipeline.png)
The image will be automaticaly build based on the branch and store in the registry.
The image will be automatically build based on the branch and store in the registry.
### :computer: Commands
# :computer: Commands
This section includes all common commands used on dev environment.
This section includes all common commands used on dev environment. These commands should be runned in `easy-cozy` directory.
```sh
cd easy-cozy
```
### App
## App
#### Install a specific version of an app
### Install a specific version of an app
```bash
$ cd /easy-cozy
$ docker-compose exec cozy ./cozy apps update home --domain "[name].cozy.self-data.alpha.grandlyon.com" git://github.com/doubleface/cozy-collect.git#build-debug
docker-compose exec cozy ./cozy apps update home --domain "[name].cozy.self-data.alpha.grandlyon.com" git://github.com/doubleface/cozy-collect.git#build-debug
```
### Konnector
## Konnector
#### Install a specific version of a konnector
### Install a specific version of a konnector
```bash
$ cd /easy-cozy
# cozy-stack konnectors uninstall ${konn} --domain ${url}
$ docker-compose exec cozy ./cozy konnectors uninstall grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com"
docker-compose exec cozy ./cozy konnectors uninstall grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com"
grdfgrandlyon has been uninstalled
# cozy-stack konnectors install ${konn} --domain ${url}
$ docker-compose exec cozy ./cozy konnectors install grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com" git://forge.grandlyon.com/web-et-numerique/llle_project/grdf-adict-konnector.git#build
docker-compose exec cozy ./cozy konnectors install grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com" git://forge.grandlyon.com/web-et-numerique/llle_project/grdf-adict-konnector.git#build
grdfgrandlyon (0.1.5) has been installed on [name].cozy.self-data.alpha.grandlyon.com
```
#### Update the version of a konnector
### Update the version of a konnector
```bash
$ cd /easy-cozy
......@@ -33,42 +34,38 @@ $ cd /easy-cozy
$ docker-compose exec cozy ./cozy konnectors update grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com"
grdfgrandlyon has been upgraded to 0.1.5-d4bbe7350ecf13d13734f559c538e3c0ee8dc7ae
```
#### Run a konnector from the stack
### Run a konnector from the stack
```bash
$ cd /root/easy-cozy
# cozy-stack konnectors run ${konn} --domain ${url}
$ docker-compose exec cozy ./cozy konnectors run grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com"
docker-compose exec cozy ./cozy konnectors run grdfgrandlyon --domain "[name].cozy.self-data.alpha.grandlyon.com"
```
### Instance
## Instance
#### Set log level to debug for an instance
### Set log level to debug for an instance
```bash
$ cd /root/easy-cozy
# cozy-stack instances debug ${url} true
$ docker-compose exec cozy ./cozy instances debug --domain "[name].cozy.self-data.alpha.grandlyon.com" true
docker-compose exec cozy ./cozy instances debug --domain "[name].cozy.self-data.alpha.grandlyon.com" true
```
#### List all instances
```bash
$ cd /root/easy-cozy
# cozy-stack instances ls
$ docker-compose exec cozy ./cozy instances ls
docker-compose exec cozy ./cozy instances ls
```
### Stack
## Stack
#### Check stack version
### Check stack version
```bash
$ cd /easy-cozy
$ docker-compose exec cozy ./cozy version
docker-compose exec cozy ./cozy version
```
#### Update stack version
### Update stack version
Update version in the Dockerfile on gitlab.
......@@ -94,3 +91,12 @@ Update version in the Dockerfile on gitlab.
> ./cozy: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./cozy)
We have replaced debian:stable-slim with ubuntu:20.10 as installer for our docker build: [https://forge.grandlyon.com/pocs/cozy/easy-cozy/-/commit/48a30a03f209169e0f1ebb0d106bb4361e7cd167](https://forge.grandlyon.com/pocs/cozy/easy-cozy/-/commit/48a30a03f209169e0f1ebb0d106bb4361e7cd167)
### Manipulate data
To read/write data from the stack you can run the following commands
```sh
docker-compose exec db curl -u [USER]:[PASSWORD] -X [METHOD] http://127.0.0.1:5984/[DATABASE]
```
:warning: When updating a document, make sure to remove the `_id` and to add `_rev` fields
......@@ -44,15 +44,15 @@ In order to prevent manual action for deployment, a gitlab-runner has been confi
## Deploy build-test branch to one Scaleway instance for testing
You can directly use the content of build-test branch to update one instance for test purpose.
Simply use the dedicated script "update_ecolyo_test.sh <instance_name>" with the targeted instance (from the server).
Simply use the dedicated script `update_ecolyo_test.sh <instance_name>` with the targeted instance (from the server).
By default we use the ecolyotest instance for testing intermediate functionality.
For more information you can check for [Easy Cozy scripts](../../../easycozy/scripts/).
For more information you can check for [Easy Cozy scripts](../../../easycozy/commands/).
## Deploy build-dev branch to all Scaleway instances
You can directly use the content of build-dev branch to update apps on dev environment using scripts (from the server).
Simply use the dedicated script "update_all_ecolyo_dev.sh" (from the server).
For more information you can check for [Easy Cozy scripts](../../../easycozy/scripts/).
Simply use the dedicated script `update_all_ecolyo_dev.sh` (from the server).
For more information you can check for [Easy Cozy scripts](../../../easycozy/commands/).
## Deploy build branch to Cozy
......@@ -62,8 +62,12 @@ You can deploy content of build branch into Cozy registry by using the cozy-app-
- $VERSION_NUMBER: version of the application
- $COZY_SPACE: space of the Cozy
```
$ yarn cozy-app-publish --token $REGISTRY_TOKEN --build-url https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/-/archive/build/ecolyo-build.tar.gz --manual-version $VERSION_NUMBER --space $COZY_SPACE
```sh
$ yarn cozy-app-publish \
--token $REGISTRY_TOKEN \
--build-url https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/-/archive/build/ecolyo-build.tar.gz \
--manual-version $VERSION_NUMBER \
--space $COZY_SPACE
```
More information at [cozy-app-publish/](https://docs.cozy.io/en/cozy-app-publish/)
More information at [cozy-app-publish](https://docs.cozy.io/en/cozy-app-publish)
......@@ -2,7 +2,7 @@
## Conventional commit
The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.
The [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary) is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.
The commit message should be structured as follows:
......@@ -22,32 +22,30 @@ The commit contains the following structural elements, to communicate intent to
* types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the the Angular convention) recommends `build:`, `chore:`, `ci:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`, and others.
* footers other than BREAKING CHANGE: <description> may be provided and follow a convention similar to git trailer format.
Find out more [here](https://www.conventionalcommits.org/en/v1.0.0/#summary)
## Release Ecolyo with Standard-version
Standard-version is library javascript that allow to handle easily tags and changelog file.
[Standard-version](https://github.com/conventional-changelog/standard-version) is library javascript that allow to handle easily tags and changelog file.
To create a new release, you have to :
1. the following command in order to create a release tag, bump package.json version and update changelog file.
1. checkout on the branch `dev` and bump the version number in `manifest.webapp`. Use the following commit format: 'bump manifest version to X.X.X'
2. checkout on the branch `dev` and bump the version number in `manifest.webapp`. Use the following commit format: 'bump manifest version to X.X.X'
2. then run
3. then run the script
```bash
yarn run release -- --release-as X.X.X # replace with version number (ex: 1.2.0)
yarn run release --release-as X.X.X # replace with version number (ex: 1.2.0)
```
3. once the command has finished, push with
4. once the command has finished, push with
```
git push --follow-tags origin dev
```
:warning: Do not push with VS Code
Finally, add release notes in gitlab in your project -> repository -> [tags](https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/-/tags) -> **edit release notes**
5. Finally, add release notes in gitlab in your project -> repository -> [tags](https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/-/tags) -> **edit release notes**
You can copy paste the last changes in [CHANGELOG.MD](https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/-/blob/dev/CHANGELOG.md)
......@@ -75,8 +73,3 @@ git tag -a v2.1.3 COMMIT_SHA -m 'chore(release): 2.1.3' -f
```
This command will annotate an existing tag (v2.1.3 with chore(release): 2.1.3 here) to the right commit. You'll have to pass the commit_sha from the related chore commit.
## Useful links
[Conventional commit doc](https://www.conventionalcommits.org/en/v1.0.0/)
[Lib link](https://github.com/conventional-changelog/standard-version)
......@@ -32,7 +32,7 @@ For EGL, the interval is **5 days**
### Description
This view is the main view of the application. It displays an agreggation view of all connected fluids.
This view is the main view of the application. It displays an aggregation view of all connected fluids.
It is the entrypoint to several children components that each handles a particular feature :
- DateNavigator
......@@ -83,7 +83,7 @@ The component allows the user to navigate through the different fluid views (mul
This component is the one that shows the user its consumption, according to the selected fluid, timestep and date.
It is split in 3 distinct parts:
- The ConsumptionVisualier
- The ConsumptionVisualizer
- The FluidSlides
- The TimeStep Navigator
......
......@@ -195,7 +195,7 @@ node srcipts/server.js
- Generate usage events by navigating through the app
You will be able to see previous events and freshly genereated events in the db `com-grandlyon-ecolyo-usageevent`
You will be able to see previous events and freshly generated events in the db `com-grandlyon-ecolyo-usageevent`
:warning: because the cron run every day at 2am, it will take events from the day before. So if you want to test specific usage, you will have to edit the `eventDate` of events you want to send.
......
......@@ -43,6 +43,13 @@ Launch the stack with the following command:
docker-compose up
```
If you have an access denied issue, try to docker login
```
docker login registry.forge.grandlyon.com
```
A Powershell window will open. Wait until the success message:
> Everything is setup. Go to http://ecolyo.cozy.tools:8080/
......@@ -55,7 +62,7 @@ Local database can also be consulted at the following url: [Cozy local DB](http:
## Use local konnectors
In most case you will use mocked konnectors with mock data, but for some testing goals you will need real accounts.
In local, it is possible to run EGL en SGE-Enedis konnectors, with real accounts, but it needs somme specific manipulation as well as you'll need to use api secrets that are, of course, basically not available in the project. If you need to use konnectors with real accounts in testing goals, please follow the following steps. Otherwise, refer to the next two sections 'Import Mock Data' et 'Simulate konnector connexions'.
In local, it is possible to run EGL en SGE-Enedis konnectors, with real accounts, but it needs some specific manipulation as well as you'll need to use api secrets that are, of course, basically not available in the project. If you need to use konnectors with real accounts in testing goals, please follow the following steps. Otherwise, refer to the next two sections 'Import Mock Data' et 'Simulate konnector connections'.
First step, make sure your stack is running. Then open your [couchDB](http://localhost:5984/_utils/) and look for the ```secrets/io-cozy-account_types``` entry.
Then add a new document like this :
......@@ -89,7 +96,7 @@ SGE Enedis example
!!! info ""
You'll need to use konnector slug as is to make it work properly
You can contact an administrator in order to get the proper informations to fill in your secret.
You can contact an administrator in order to get the proper information to fill in your secret.
Once it is done, you will be able to use these 2 Konnectors with real accounts.
!!! warning "You might see this message before trying to log with SGE Account"
......
docs/img/ecolyo.png

3.01 KiB | W: 0px | H: 0px

docs/img/ecolyo.png

24.2 KiB | W: 0px | H: 0px

docs/img/ecolyo.png
docs/img/ecolyo.png
docs/img/ecolyo.png
docs/img/ecolyo.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -27,9 +27,9 @@ For now enedis API are proxied by WSO2 api manager. You can find documentation a
- core/types: contains jsdoc types
- core/: requests wrapper with error handling logic
- helpers/ : contains helpers for aggregation, env and parsing
- requests/: contain all methods for : Parsing sge requests, Send/get backoffice data, interacte with cozy stack
- requests/: contain all methods for : Parsing sge requests, Send/get backoffice data, interactions with cozy stack
- index.js: main file where default konnector methods are launch (start, ...)
- onDeleteAccount.js: hold consent suppresion when a user delete an account. Automatically launched on delete.
- onDeleteAccount.js: hold consent suppression when a user delete an account. Automatically launched on delete.
### ts-check
In order to have better comfort while coding, we have enable ts-checking with vs-code. The verification is based on js-doc, please take time to maintain the js-doc.
......@@ -61,7 +61,7 @@ In order to local test you have to put the following configuration in `konnector
}
```
Replace every `<***>` with yout test values and corresponding secrets.
Replace every `<***>` with your test values and corresponding secrets.
!!! warning "user consent"
While running in dev mode, be sure to have user consent, either on production env or with enedis standard form.
......@@ -75,7 +75,7 @@ yarn onDeleteAccount:standalone #Run onDeleteAccount script
yarn onDeleteAccount #Run onDeleteAccount script with real cozy
```
For standalone cmd you can find konnector resulte in `/data/importedData.json`
For standalone cmd you can find konnector results in `/data/importedData.json`
### Konnector Methods
| Method | Description |
......@@ -89,13 +89,13 @@ For standalone cmd you can find konnector resulte in `/data/importedData.json`
| setStartDate | Save startDate with the right time range |
| storeData | Save data to user's cozy |
| agregateMonthAndYearData | Sum daily data for months and years |
| isFirstStart | Check if it's first start or an alternate starte base on boId in cozy.account |
| isFirstStart | Check if it's first start or an alternate start base on boId in cozy.account |
## Dataflow
### Overview
Fonctionnal and technichal flow chart:
Functional and technical flow chart:
[Lien du schema](https://whimsical.com/sge-tech-DxbYM8DdajRjTr6WZat1bV)
......@@ -362,7 +362,7 @@ Data Route : **enedis_SGE_ConsultationDonneesTechniquesContractuelles/1.0**
#### Contract deletion and creation on same day
If you stop a contract on a day, (for exemple 8/08/22), you cannot start a new contract for this date with [start contract route](#user_contract_start). You have to wait for the next day. This might cause somme production issues
If you stop a contract on a day, (for exemple 8/08/22), you cannot start a new contract for this date with [start contract route](#user_contract_start). You have to wait for the next day. This might cause some production issues
#### User data collect opposition
......
......@@ -23,7 +23,7 @@ A swagger documentation can be consulted at [http://localhost:3000/api/doc/](htt
- `/api/beneficiaire/create'`: This route is used in order to store Usager domain and his trigger process from Cozy. This route is protected by a COZY_SECRET env variable token. This token is generated by us. If you change it, you need to inform Cozy team because this token is store in their side also.
- `/api/beneficiaire/remove'`: This route is used in order to remove Usager domain and his trigger process. Only availabe by POST. This route is not accessible from any part of TS FRONT application. Protected rout by the same token of create route.
- `/api/beneficiaire/remove'`: This route is used in order to remove Usager domain and his trigger process. Only available by POST. This route is not accessible from any part of TS FRONT application. Protected rout by the same token of create route.
## Add one beneficiary by Postman
- Create a POST request
......
......@@ -61,25 +61,43 @@ NestJs
Oauth
OAuth
Pilote
anonymised
developpement
existant
importData
repo
Usager
UploadDocument
PDL
CONSOS
PNGs
subType
devtools
Postgre
concat
PNG
Powershell
Ressources
README
SMS
Recette
sge
fetchJSON
SGE
ConsultationMesuresDetaillees
SVG
SVGs
TabOut
TaskItem
TaskItems
Téléo
CommandeCollectePublicationMesures
RechercheServicesMesures
TypeAgregats
Typescript
Ui
UI
UUID
YYYY
ValeurIndex
WSL
......@@ -124,6 +142,7 @@ duelEntity
fluidType
couchDB
dataEntity
jsdoc
userData
userDataName
fluidtype
......@@ -369,15 +388,21 @@ mesureName
lastDataDate
FluidForecast
VM
OTP
MonthlyForecast
blackbox
dropdown
mailData
createDayDataFiles
sendEmail
DataloadNoValue
checkboxes
aggregatorUsageEvents
AnalysisConsumptionRow
sandboxed
GCU
isWelcomeSeen
Equipments
createConnection
HasMany
FluidButtons
......