Skip to content

Commit

Permalink
Merge branch 'master' into trims
Browse files Browse the repository at this point in the history
  • Loading branch information
paulboosz committed Dec 19, 2024
2 parents 2e6dc9c + 0c5bbe9 commit 81c2fad
Show file tree
Hide file tree
Showing 119 changed files with 35,807 additions and 21,923 deletions.
2 changes: 1 addition & 1 deletion .buildpacks
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/Scalingo/ssh-private-key-buildpack.git
https://github.com/Scalingo/apt-buildpack.git
https://github.com/Scalingo/python-buildpack
https://github.com/MTES-MCT/ecobalyse-buildpack-run.git
https://github.com/Scalingo/nodejs-buildpack
Expand Down
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ MATOMO_TOKEN=xxx
NODE_ENV=development
SCALINGO_POSTGRESQL_URL=please-change-this
SENTRY_DSN=please-change-this
TRANSCRYPT_KEY=use-key-in-vaultwarden
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pattern filter=crypt diff=crypt merge=crypt
public/data/textile/processes_impacts.json filter=crypt diff=crypt merge=crypt
public/data/food/processes_impacts.json filter=crypt diff=crypt merge=crypt
public/data/object/processes_impacts.json filter=crypt diff=crypt merge=crypt
23 changes: 10 additions & 13 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ permissions:
contents: write
pull-requests: write

env:
ECOBALYSE_DATA_DIR: ./ecobalyse-private

jobs:
create_tag_and_release:
# The tag and the release should be created only when the automated PR created by `create_pr_for_changelog` is merged
Expand All @@ -27,6 +24,13 @@ jobs:
with:
fetch-depth: 0

- name: Install transcrypt
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
wget https://raw.githubusercontent.com/elasticdog/transcrypt/016b2e4b31951be5ea96233d8d2badef9c9836b6/transcrypt -O "$HOME/.local/bin/transcrypt"
chmod +x "$HOME/.local/bin/transcrypt"
- name: Get latest version
uses: orhun/git-cliff-action@v4
id: git_cliff
Expand Down Expand Up @@ -60,13 +64,6 @@ jobs:
if: steps.tag_creation.outputs.tag_created
run: npm ci --prefer-offline --no-audit

- name: Clone the detailed impacts
if: steps.tag_creation.outputs.tag_created
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
git clone [email protected]:MTES-MCT/ecobalyse-private.git
- name: Build app
if: steps.tag_creation.outputs.tag_created
env:
Expand All @@ -84,9 +81,9 @@ jobs:
# We include the encrypted detailed processes with the dist
# so that people with the encryption key could later on use the app with the exact
# files it was using on production
npm run encrypt $ECOBALYSE_DATA_DIR/data/textile/processes_impacts.json dist/processes_impacts_textile.json.enc
npm run encrypt $ECOBALYSE_DATA_DIR/data/food/processes_impacts.json dist/processes_impacts_food.json.enc
npm run encrypt $ECOBALYSE_DATA_DIR/data/object/processes_impacts.json dist/processes_impacts_object.json.enc
npm run encrypt public/data/textile/processes_impacts.json dist/processes_impacts_textile.json.enc
npm run encrypt public/data/food/processes_impacts.json dist/processes_impacts_food.json.enc
npm run encrypt public/data/object/processes_impacts.json dist/processes_impacts_object.json.enc
- name: Generate dist archive
if: steps.tag_creation.outputs.tag_created
Expand Down
32 changes: 11 additions & 21 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Node.js CI

env:
NODE_ENV: test
ECOBALYSE_DATA_DIR: ./ecobalyse-private
TRANSCRYPT_KEY: ${{ secrets.TRANSCRYPT_KEY }}
on:
push:
branches: [ master, staging ]
Expand All @@ -24,6 +24,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install transcrypt
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
wget https://raw.githubusercontent.com/elasticdog/transcrypt/016b2e4b31951be5ea96233d8d2badef9c9836b6/transcrypt -O "$HOME/.local/bin/transcrypt"
chmod +x "$HOME/.local/bin/transcrypt"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -53,6 +60,9 @@ jobs:
- name: Install Node dependencies
run: npm ci --prefer-offline --no-audit

- name: Check JSON db formating
run: npm run db:validate

- name: Install Python dependencies
run: pip install pipenv && pipenv install -d

Expand All @@ -61,26 +71,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y gettext
- name: Clone the detailed impacts
run: |
eval `ssh-agent -s`
# Private ssh key used by this Github action to clone the private repo
# The corresponding public key must be set as a deploy key of the private repo
ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
git clone [email protected]:MTES-MCT/ecobalyse-private.git
- name: Checkout specific ecobalyse-private branch
if: ${{ github.event_name == 'pull_request' }}
env:
LAST_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_REST_ACCESS_TOKEN }}
run: |
eval `ssh-agent -s`
# Private ssh key used by this Github action to clone the private repo
# The corresponding public key must be set as a deploy key of the private repo
ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
pipenv run ./bin/checkout-ecobalyse-private-branch.sh $LAST_COMMIT_SHA
- name: Build app
run: npm run build --if-present

Expand Down
27 changes: 8 additions & 19 deletions .github/workflows/score_history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
NODE_ENV: test
ECOBALYSE_DATA_DIR: ./ecobalyse-private
TRANSCRYPT_KEY: ${{ secrets.TRANSCRYPT_KEY }}

jobs:
score_history:
Expand All @@ -25,6 +25,13 @@ jobs:

- uses: actions/checkout@v4

- name: Install transcrypt
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
wget https://raw.githubusercontent.com/elasticdog/transcrypt/016b2e4b31951be5ea96233d8d2badef9c9836b6/transcrypt -O "$HOME/.local/bin/transcrypt"
chmod +x "$HOME/.local/bin/transcrypt"
- name: Install Scalingo CLI
uses: ./.github/actions/scalingo-cli

Expand Down Expand Up @@ -72,24 +79,6 @@ jobs:
run: pip install numpy pandas requests python-dotenv GitPython sqlalchemy psycopg2


- name: Clone the detailed impacts
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
git clone [email protected]:MTES-MCT/ecobalyse-private.git
- name: Checkout specific ecobalyse-private branch
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
eval `ssh-agent -s`
# Private ssh key used by this Github action to clone the private repo
# The corresponding public key must be set as a deploy key of the private repo
ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
# As this action is not triggered by the pull_request event, the current sha
# can be found in $GITHUB_SHA (setup by github actions)
pipenv run ./bin/checkout-ecobalyse-private-branch.sh $GITHUB_SHA
- name: Add scalingo to know hosts
run: echo "KNOWN_HOSTS=$(ssh-keyscan -H ssh.osc-fr1.scalingo.com)" >> $GITHUB_ENV

Expand Down
1 change: 1 addition & 0 deletions Aptfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bsdmainutils
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Changelog


## [2.7.0](https://github.com/MTES-MCT/ecobalyse/compare/v2.6.0..v2.7.0) (2024-12-04)



### 🚀 Features

- *(objects)* Introduce components for objects and veli ([#825](https://github.com/MTES-MCT/ecobalyse/issues/825))
- *(textile)* Update number of references index thresholds. ([#839](https://github.com/MTES-MCT/ecobalyse/issues/839))
- Introduce objects/veli components db and explorer ([#841](https://github.com/MTES-MCT/ecobalyse/issues/841))

### 🚜 Refactor

- Move weaving elec_pppm to textile wellknown. ([#843](https://github.com/MTES-MCT/ecobalyse/issues/843))

### ⚙️ Miscellaneous Tasks

- *(data)* New ingredients ([#814](https://github.com/MTES-MCT/ecobalyse/issues/814))
- *(data)* Add irrigation to the Ecoinvent organic cotton ([#832](https://github.com/MTES-MCT/ecobalyse/issues/832))


## [2.6.0](https://github.com/MTES-MCT/ecobalyse/compare/v2.5.0..v2.6.0) (2024-11-20)


Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pygithub = "*"
ecobalyse = {file = "packages/python/ecobalyse"}
typer = "*"
pytest-mock = "*"
frozendict = "*"

[dev-packages]
numpy = ">=1,<2"
Expand Down
Loading

0 comments on commit 81c2fad

Please sign in to comment.