Skip to content

Fix misidentification of retiring generators in allocate_gen_fuel.py #6557

Fix misidentification of retiring generators in allocate_gen_fuel.py

Fix misidentification of retiring generators in allocate_gen_fuel.py #6557

Workflow file for this run

---
name: pytest
on:
pull_request:
merge_group:
types:
- checks_requested
workflow_dispatch:
env:
PUDL_OUTPUT: /home/runner/pudl-work/output/
PUDL_INPUT: /home/runner/pudl-work/input/
DAGSTER_HOME: /home/runner/pudl-work/dagster_home/
ZENODO_SANDBOX_TOKEN_PUBLISH: ${{ secrets.ZENODO_SANDBOX_TOKEN_PUBLISH }}
jobs:
change_filter:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
# 2025-07-17: because merge_group is an Object and run_code_checks is not a conditional, need to explicitly check for null-ness instead of relying on truthiness.
run_code_checks: ${{ github.event_name =='workflow_dispatch' || (steps.filter.outputs.code == 'true' && (github.event.merge_group != null)) }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: filter
with:
# this will raise a warning, but it works: https://github.com/dorny/paths-filter/issues/225
predicate-quantifier: "every"
filters: |
code:
- '!dbt/seeds/etl_full_row_counts.csv'
- '!docker/**'
- '!docs/**'
- '!.github/**.md'
- '!.github/FUNDING.yml'
- '!.github/actionlint.yml'
- '!.github/dependabot.yml'
- '!.github/release.yml'
- '!.github/ISSUE_TEMPLATE/*.yml'
- '!.github/workflows/zenodo-data-release.yml'
- '!AGENTS.md'
- '!README.rst'
- '!CONTRIBUTING.rst'
- '!LICENSE.txt'
- '!CITATION.cff'
- '!.zenodo.json'
- '!**.gitignore'
- '!.git-blame-ignore-revs'
- '!.pre-commit-config.yaml'
- '!.readthedocs.yaml'
- '!.mypy.ini'
- '!test/unit/**'
- name: print out components
run: |
echo "event name (${{ github.event_name }}) is workflow dispatch: ${{ github.event_name == 'workflow_dispatch' }}"
echo "found code changes: ${{ steps.filter.outputs.code }}"
echo "merge_group ${{ github.event.merge_group }} is not null: ${{ github.event.merge_group != null }}"
ci-docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install conda-lock environment with micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environments/conda-lock.yml
environment-name: pudl-dev
cache-environment: true
- name: Log environment details
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Make input, output and dagster dirs
run: mkdir -p ${{ env.PUDL_OUTPUT }} ${{ env.PUDL_INPUT}} ${{ env.DAGSTER_HOME }}
- name: Lint and build PUDL documentation with Sphinx
run: |
pip install --no-deps --editable .
make docs-build
- name: Coverage debugging output
run: |
coverage debug config
coverage debug sys
coverage report --fail-under=0
ls -a
- name: Upload docs coverage artifact
uses: actions/upload-artifact@v5
with:
name: coverage-docs
include-hidden-files: true
path: .coverage
ci-unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install conda-lock environment with micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environments/conda-lock.yml
environment-name: pudl-dev
cache-environment: true
- name: Log environment details
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Make input, output and dagster dirs
run: mkdir -p ${{ env.PUDL_OUTPUT }} ${{ env.PUDL_INPUT}} ${{ env.DAGSTER_HOME }}
- name: Log SQLite3 version
run: |
which sqlite3
sqlite3 --version
- name: Run PUDL unit tests and collect test coverage
run: |
pip install --no-deps --editable .
make pytest-unit
- name: Coverage debugging output
run: |
coverage debug config
coverage debug sys
coverage report --fail-under=0
ls -a
- name: Upload unit tests coverage artifact
uses: actions/upload-artifact@v5
with:
name: coverage-unit
include-hidden-files: true
path: .coverage
ci-integration:
# The blacksmith-4vcpu-ubuntu-2404 runner has 4vCPUs, 16GB RAM, 80 GB disk.
# It's much cheaper and a little faster than the 8vCPU GitHub runner, which
# is the smallest GitHub runner we seemt to be able to run our integration
# tests on.
# Dashboard at https://app.blacksmith.sh/catalyst-cooperative/
# runs-on: ubuntu-latest-8core
runs-on: blacksmith-4vcpu-ubuntu-2404
needs: change_filter
if: ${{ needs.change_filter.outputs.run_code_checks == 'true' }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
- uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install Conda environment using mamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environments/conda-lock.yml
environment-name: pudl-dev
cache-environment: true
- name: Show disk space usage 1
run: |
du -sh /home/runner/*
- name: Log environment details
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Log SQLite3 version
run: |
which sqlite3
sqlite3 --version
- name: Compile Zenodo datastore DOIs for cache invalidation
run:
grep -e '.*10\.\(5281\|5072\)/zenodo\..*' src/pudl/workspace/datastore.py
| sed -e 's/",*$//g' | sed -e 's/^.*"//g' | sort > datastore-dois.txt
- name: Restore Zenodo datastore from cache if possible
uses: actions/cache@v4
id: cache-zenodo-datastore
with:
path: ${{ env.PUDL_INPUT }}
key: zenodo-datastore-${{ hashFiles('datastore-dois.txt') }}
- name: Make input, output and dagster dirs
run: mkdir -p ${{ env.PUDL_OUTPUT }} ${{ env.PUDL_INPUT}} ${{ env.DAGSTER_HOME }}
- name: Show disk space usage 2
run: |
du -sh /home/runner/*
du -sh /home/runner/pudl-work/*
du -sh /home/runner/_work/*
- name: Set default GCP credentials
id: gcloud-auth
continue-on-error: true
uses: "google-github-actions/auth@v3"
with:
workload_identity_provider: "projects/345950277072/locations/global/workloadIdentityPools/gh-actions-pool/providers/gh-actions-provider"
service_account: "tox-pytest-github-action@catalyst-cooperative-pudl.iam.gserviceaccount.com"
- name: Run integration tests, trying to use GCS cache if possible
run: |
pip install --no-deps --editable .
pudl_datastore --dataset epacems --partition year_quarter=2023q1
make pytest-integration
- name: Show disk space usage 3
run: |
du -sh /home/runner/*
du -sh /home/runner/pudl-work/*
du -sh /home/runner/_work/*
du -sh /tmp/pytest-of-runner/
- name: Coverage debugging output
run: |
coverage debug config
coverage debug sys
coverage report --fail-under=0
ls -a
- name: Upload integration test coverage artifact
uses: actions/upload-artifact@v5
with:
name: coverage-integration
include-hidden-files: true
path: .coverage
- name: Upload dbt test failure database artifact
if: always()
uses: actions/upload-artifact@v5
with:
name: dbt-failures
path: pudl_dbt_tests.duckdb
- name: Log post-test Zenodo datastore contents
run: find ${{ env.PUDL_INPUT }}
ci-coverage:
runs-on: ubuntu-latest
needs:
- ci-docs
- ci-unit
- ci-integration
- change_filter
if: ${{ needs.change_filter.outputs.run_code_checks == 'true' }}
steps:
- uses: actions/checkout@v6
- name: Download coverage
id: download-coverage
uses: actions/download-artifact@v6
with:
path: coverage
- name: List downloaded files
run: |
find coverage -type f
- name: Install Micromamba
uses: mamba-org/setup-micromamba@v2
with:
init-shell: bash
environment-name: coverage
create-args: >-
python=3.13
coverage>=7.6.1
- name: Combine coverage data, output XML, and report
run: |
micromamba run -n coverage coverage combine coverage/*/.coverage
micromamba run -n coverage coverage xml --fail-under=0
micromamba run -n coverage coverage report --fail-under=0
- name: Upload XML coverage report to CodeCov
uses: codecov/codecov-action@v5
with:
disable_search: true
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true # optional (default = false)
plugins: noop
verbose: true
- name: Run coverage report again but fail if we're under the minimum
run: |
micromamba run -n coverage coverage report