Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Trèfle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open source
Trèfle
Commits
4e95fed5
Commit
4e95fed5
authored
Apr 21, 2020
by
David Foucher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pre-release 0.8.0
parent
0431f46c
Pipeline
#2787
passed with stage
in 2 minutes and 5 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
46 deletions
+25
-46
CHANGELOG.md
CHANGELOG.md
+12
-0
docker/backoffice/etc/nginx/sites-enabled/trefle.conf
docker/backoffice/etc/nginx/sites-enabled/trefle.conf
+12
-12
setup.py
setup.py
+1
-1
trefle/api.py
trefle/api.py
+0
-31
trefle/rules/core.py
trefle/rules/core.py
+0
-2
No files found.
CHANGELOG.md
View file @
4e95fed5
# Changelog
## 0.8.0
-
new explorer in VueJS with iso fonctionalty with old one
-
new explorer: possibility to modifiy rules
-
api: new authentification endpoint, be authentify to process rules modification
-
api: new remuneration endpoint /remuneration
-
api: new source code endpoint, possibility to interact with gitlab to modifiy rules
-
api: new certifinfo endpoint, to get label of one or more certifinfo
-
api: new healthcheck endpoint
-
change repo from framagit to gitlab PE
## 0.7.0
-
switch to LBF json catalog instead of Intercarif XML
...
...
docker/backoffice/etc/nginx/sites-enabled/trefle.conf
View file @
4e95fed5
...
...
@@ -19,31 +19,31 @@ server {
rewrite
^/$ /
0
.
7
/
explorer
last
;
}
location
/
0
.
7
{
location
/
0
.
8
{
root
/
srv
/
trefle
/
backoffice
;
error_log
/
var
/
log
/
nginx
/
error
.
log
;
access_log
/
var
/
log
/
nginx
/
access
.
log
;
location
/
0
.
7
/
explorer
{
location
/
0
.
8
/
explorer
{
alias
/
srv
/
trefle
/
backoffice
;
index
index
.
html
;
try_files
$
uri
/
0
.
7
/
explorer
/
index
.
html
;
try_files
$
uri
/
0
.
8
/
explorer
/
index
.
html
;
}
rewrite
/
0
.
7
/(.*) /$
1
break
;
rewrite
/
0
.
8
/(.*) /$
1
break
;
try_files
$
uri
@
gunicorn
-
master
;
}
location
/
api
-
moteur
/
0
.
7
{
rewrite
/
api
-
moteur
/
0
.
7
/(.*) /$
1
break
;
location
/
api
-
moteur
/
0
.
8
{
rewrite
/
api
-
moteur
/
0
.
8
/(.*) /$
1
break
;
try_files
$
uri
@
gunicorn
-
master
;
}
location
^~ {
rewrite
^/(.*)$ /
0
.
7
/$
1
last
;
rewrite
^/(.*)$ /
0
.
8
/$
1
last
;
}
#previous API version
...
...
@@ -54,25 +54,25 @@ server {
proxy_set_header
Host
$
host
;
}
location
/
0
.
6
{
location
/
0
.
7
{
root
/
srv
/
trefle
-
old
/
trefle
;
error_log
/
var
/
log
/
nginx
/
error
.
log
;
access_log
/
var
/
log
/
nginx
/
access
.
log
;
location
/
0
.
6
/
explorer
{
location
/
0
.
7
/
explorer
{
alias
/
srv
/
trefle
-
old
/
trefle
/
explorer
;
index
index
.
html
;
}
rewrite
/
0
.
6
/(.*) /$
1
break
;
rewrite
/
0
.
7
/(.*) /$
1
break
;
try_files
$
uri
@
gunicorn
-
old
;
}
location
/
api
-
moteur
/
0
.
6
{
rewrite
/
api
-
moteur
/
0
.
6
/(.*) /$
1
break
;
location
/
api
-
moteur
/
0
.
7
{
rewrite
/
api
-
moteur
/
0
.
7
/(.*) /$
1
break
;
try_files
$
uri
@
gunicorn
-
old
;
}
...
...
setup.py
View file @
4e95fed5
...
...
@@ -9,7 +9,7 @@ def is_pkg(line):
with
Path
(
"requirements.txt"
).
open
()
as
reqs
:
install_requires
=
[
l
for
l
in
reqs
.
read
().
split
(
"
\n
"
)
if
is_pkg
(
l
)]
VERSION
=
(
0
,
7
,
16
)
VERSION
=
(
0
,
8
,
0
)
__author__
=
"Yohan Boniface"
__contact__
=
"yohan.boniface@data.gouv.fr"
...
...
trefle/api.py
View file @
4e95fed5
...
...
@@ -129,37 +129,6 @@ async def remuneration_(request, response):
# k: v for k, v in context.items()
# if k in SCHEMA and "label" in SCHEMA[k]}
response
.
json
=
body
"""
try:
await simulate(context, financements)
except DataError as err:
error = {err.key: err.error}
log_simulate(context, errors=error)
raise HttpError(HTTPStatus.UNPROCESSABLE_ENTITY, error)
eligible = request.query.bool("eligible", None)
if eligible is not None:
financements = [f for f in financements if f["eligible"] == eligible]
else:
financements = sorted(financements, key=lambda value: value["eligible"],
reverse=True)
explain = request.query.bool("explain", False)
for financement in financements:
financement["explain"] = (
[s.json for s in financement["explain"]] if explain else None
)
body = {"financements": financements}
if request.query.bool("context", False):
body["context"] = {
k: v for k, v in context.items() if k in SCHEMA and "label" in SCHEMA[k]
}
if request.query.bool("scenario", False):
body["scenario"] = make_scenario(context, financements)
response.json = body
log_simulate(context, financements=financements)
"""
app
.
route
(
"/legacy"
,
methods
=
[
"POST"
])(
simulate_legacy
)
...
...
trefle/rules/core.py
View file @
4e95fed5
...
...
@@ -333,8 +333,6 @@ class Condition(Step):
super
().
compile
()
# TODO add some context for knowing if financement or remuneration is the target
keys
=
[
pointer
.
key
for
pointer
in
self
.
params
.
values
()
if
pointer
.
key
]
# print(self.params.value())
# print(keys)
for
pointer
in
self
.
params
.
values
():
try
:
pointer
.
resolve_labels
(
*
keys
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment