Skip to content

Commit

Permalink
Merge branch 'master' into cadeban/new-feat-popover
Browse files Browse the repository at this point in the history
  • Loading branch information
cadeban committed Nov 28, 2024
2 parents 9d6377e + e6b0ee9 commit 877bf7a
Show file tree
Hide file tree
Showing 50 changed files with 18,012 additions and 678 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy_preview_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true
VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN:
VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN_V9:
required: true
jobs:
deploy:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
working-directory: ./web
run: pnpm run build
env:
VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN: '${{ secrets.VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN }}'
VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN_V9: '${{ secrets.VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN_V9 }}'
- name: Publish
uses: cloudflare/pages-action@1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
working-directory: ./web
run: pnpm run build
env:
VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN: '${{ secrets.VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN }}'
VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN_V9: '${{ secrets.VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN_V9 }}'
- name: Publish
uses: cloudflare/pages-action@1
with:
Expand Down
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,61 @@ If these jobs fail and you need to format the code you can run `yarn lint --fix`

Check the [wiki page][wiki js code formatting] on formatting for more details and tips.

# Contribution lifecycle

In order for your PR to be accepted and deployed it will need to pass a series of checks, these checks will be defined and explained in the following section of this document.

## Overview

```mermaid
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
flowchart LR
subgraph idContrib["Electricity Maps contrib"]
direction LR
id1((Open a PR))
id2{First time contributor?}
id3(Await EMaps team CI approval)
id4{Is the CI tests passing?}
id5(Make changes)
id6{Passing review from EMaps team member}
id7(PR is merged)
id8(Deployed to Staging)
id1-->id2
id2-->|Yes|id3
id2-->|No|id4
id3-->id4
id4-->|No|id5
id5-->id4
id4-->|Yes|id6
id6-->|No|id5
id6-->|Yes|id7
id7-->id8
end
subgraph idInternal["Electricity Maps internal"]
direction LR
id9((Automatic PR created))
id10{Are internal CI tests passing}
id11(Make changes)
id12{Passing review from Emaps member?}
id13(Deployed to production)
id9-->id10
id10-->|No|id11
id11-->id10
id10-->|Yes|id12
id12-->|No|id11
id12-->|Yes|id13
end
id7-->id9
```

## Description

In order to do code changes to the Electricity Maps repository you need to fork the repo and make changes in your own fork and then open a pull request (PR) against the Electricity Maps repository.

Once this has been done the automatic and manual review process starts, this consists of manual approval of the CI pipeline if you are a first time contributor, if the CI pipeline passes a team member will review your specific code changes. If they pass all automated tests and manual review from a Electricity Maps Employee it will be merged in our contrib PR. This does not mean it will be automatically de deployed or that the changes will be instantly visible.

If it is frontend changes it will be deployed to our staging environment at https://staging.electricitymaps.com and if there is parser changes these go on to more internal tests that includes both automated test suits and manual reviews. Once everything passes and an approval has been granted a new release will be created that updates the production environment for both the frontend and parser changes.

<!-- Link definitions to keep the text clean -->

[poetry homepage]: https://python-poetry.org/
Expand Down
2 changes: 1 addition & 1 deletion config/zones/GP.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ parsers:
price: FR_O.fetch_price
production: FR_O.fetch_production
region: Americas
timezone: Europe/Paris
timezone: America/Puerto_Rico
5 changes: 3 additions & 2 deletions config/zones/US-TEX-ERCO.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ contributors:
- systemcatch
- robertahunt
- KabelWlan
- silkeholmebonnen
country: US
delays:
consumption: 30
Expand Down Expand Up @@ -466,9 +467,9 @@ fallbackZoneMixes:
unknown: 0.0026028574593210904
wind: 0.24233286045039404
parsers:
consumption: EIA.fetch_consumption
consumption: US_ERCOT.fetch_consumption
consumptionForecast: EIA.fetch_consumption_forecast
production: EIA.fetch_production_mix
production: US_ERCOT.fetch_production
productionCapacity: EIA.fetch_production_capacity
region: Americas
sources:
Expand Down
2 changes: 1 addition & 1 deletion mobileapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pnpm dev-ios

```bash
SENTRY_AUTH_TOKEN="" VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN="" pnpm run build-web
SENTRY_AUTH_TOKEN="" VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN_V9="" pnpm run build-web
```

2. Then run one of these commands to open the build in XCode or Android Studio:
Expand Down
2 changes: 1 addition & 1 deletion mobileapp/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android_dir = File.expand_path("../android")

private_lane :build_web_app do
ensure_env_vars(
env_vars: ['SENTRY_AUTH_TOKEN', 'VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN']
env_vars: ['SENTRY_AUTH_TOKEN', 'VITE_PUBLIC_ELECTRICITYMAP_PUBLIC_TOKEN_V9']
)
# Build the web app if we have both environment variables set
sh("pnpm", "run", "build-web")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 877bf7a

Please sign in to comment.