Release workflows#2260
Conversation
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Keep it alongside the other CI scripts (ci/setup-postgres.sh etc.) rather than a standalone bin/ directory. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Runs tutorials 1-4 and the HEMS walkthrough against the local docker compose stack, using the runner scripts kept in FlexMeasures/tsc and the HEMS example kept in FlexMeasures/flexmeasures-client (not duplicated here). Manual trigger only, to avoid slowing down every push while still cutting release QA toil. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The HEMS example's report-generation step shells out to a local flexmeasures CLI, which doesn't work as-is against a dockerized server. Bind-mount examples/HEMS/configs into the server container and point FLEXMEASURES_CLI_CMD/FLEXMEASURES_CLI_CONFIG_DIR (added in FlexMeasures/flexmeasures-client#qa/hems-report-cli-override) at it, so report generation runs for real instead of being silently skipped. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Gate docker-publish.yml behind the dockerhub GitHub environment, mirroring the approval gate already used by pypi-publish.yml. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nto ci/ Rename build.yml -> docker-build.yml and release.yml -> pypi-publish.yml so filenames reflect what they actually build/publish, and qa-release.yml -> docker-qa.yml to distinguish it from the release-publishing pair. Move generate-dummy-price.sh into ci/, alongside the other CI helper scripts, and update references accordingly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
nhoening
left a comment
There was a problem hiding this comment.
Very good start, I found just a few things for now.
| Release process | ||
| ================ | ||
|
|
||
| This page describes how FlexMeasures releases are cut, and which parts are automated versus manual. |
There was a problem hiding this comment.
| This page describes how FlexMeasures releases are cut, and which parts are automated versus manual. | |
| This page describes how FlexMeasures releases are done, and which parts are automated versus manual. |
I have never seen "cut" used like this, is that usual?
There was a problem hiding this comment.
Good catch, fixed — changed to "done".
| * ``uv sync --group dev --group test`` and ``uv run poe test``. | ||
| * For MINOR/MAJOR releases, do QA using the Docker Compose stack, and write the accompanying blog post. | ||
|
|
||
| Tutorials 1-4 and the HEMS walkthrough can be run via the manually-triggered ``QA (release)`` GitHub Actions workflow (``.github/workflows/docker-qa.yml``). It spins up the local docker compose stack and runs the tutorial runner scripts from `FlexMeasures/tsc <https://github.com/FlexMeasures/tsc/tree/main/tsc/scripts>`_ and the HEMS example from `FlexMeasures/flexmeasures-client <https://github.com/FlexMeasures/flexmeasures-client/tree/main/examples/HEMS>`_ (both kept in their own repos, not duplicated here). Trigger it from the Actions tab; it does not run automatically. This does not replace manual UI login/graph checks, tutorial 5, or exploratory QA. |
There was a problem hiding this comment.
We moved the tutorial runner scripts into the FM repo, at documentation/tut/scripts. There is even a script for tutorial 5 there. And RELEASE.md points to those, actually. I suggest using those, probably makes the QA task lighter, as well.
Maybe they should have been deleted from the TSC repo, I'll do that.
There was a problem hiding this comment.
Done — switched the QA workflow and docs to use documentation/tut/scripts (including tutorial 5) instead of checking out tsc.
| This lists merged PRs since the last tag (via ``ci/list-merged-prs-since-tag.sh``), pre-formatted as changelog bullets. | ||
| It is read-only: it does not edit or commit anything. | ||
| Review, categorize each entry into *New features* / *Infrastructure / Support* / *Bugfixes*, | ||
| and paste them into ``documentation/changelog.rst`` (and ``documentation/cli/change_log.rst`` / ``documentation/api/change_log.rst`` where relevant). |
There was a problem hiding this comment.
This should only be done if PR IDs are missing at that point, right?
Maybe the task can even look that up (missing PR IDs) and suggest which need to still be added.
There was a problem hiding this comment.
Good idea, done — the script now cross-references PR numbers already linked in the changelog files and only lists the ones that are still missing.
| push: true | ||
| tags: lfenergy/flexmeasures:${{ steps.version.outputs.tag }} | ||
|
|
||
| - name: Build and push (latest) |
There was a problem hiding this comment.
Technically, we don't need to build again, in the RELEASE file we tag the image from the last step as latest, then push that.
I know that Docker will also use the cached layers so the end result is maybe the same, but tagging seems cleaner (pushing the very same image).
There was a problem hiding this comment.
Agreed, fixed — now a single build-push-action call with both tags, so the exact same image gets pushed under both, no second build.
| tags: lfenergy/flexmeasures:${{ steps.version.outputs.tag }} | ||
|
|
||
| - name: Build and push (latest) | ||
| if: ${{ !github.event.release.prerelease }} |
There was a problem hiding this comment.
I don't know what a release.prerelease event is
There was a problem hiding this comment.
It's not an event, it's a field — github.event.release.prerelease is a boolean GitHub sets on the release webhook payload, true/false depending on whether "Set as a pre-release" was checked when the GitHub Release was created. Added a comment explaining this inline.
| # flexmeasures-client's FLEXMEASURES_CLI_CMD/FLEXMEASURES_CLI_CONFIG_DIR | ||
| # support, used below to run that CLI inside the `server` container) | ||
| # | ||
| # This does not replace manual QA (e.g. UI login/graph checks, tutorial 5, |
There was a problem hiding this comment.
tutorial 5 can be covered, see other comment
There was a problem hiding this comment.
Resolved via the same change — tutorial 5's runner script is now included, so the QA workflow runs tutorials 1-5.
- release_process.rst: fix "cut" -> "done" wording; point QA at the in-repo documentation/tut/scripts tutorial runners (including tutorial 5) instead of the tsc repo, since those scripts live here now. - docker-qa.yml: run tutorials 1-5 from documentation/tut/scripts directly, dropping the tsc checkout step and tsc-ref input. - list-merged-prs-since-tag.sh: only list merged PRs not yet referenced by a `PR #NNNN` link in an existing changelog file, instead of listing every merged PR unconditionally. - docker-publish.yml: build the image once and push it under both the version tag and (for stable releases) `latest`, instead of building twice; add a comment explaining what `github.event.release.prerelease` is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* feat(ci): automate PyPI smoke test Signed-off-by: F.N. Claessen <claessen@seita.nl> * feat(ci): add Docker Hub release workflow Signed-off-by: F.N. Claessen <claessen@seita.nl> * feat(ci): add script to list PRs since the given (or latest) git tag Signed-off-by: F.N. Claessen <claessen@seita.nl> * docs(ci): add dev section on the release process Signed-off-by: F.N. Claessen <claessen@seita.nl> * refactor(ci): move changelog helper script into ci/ folder Keep it alongside the other CI scripts (ci/setup-postgres.sh etc.) rather than a standalone bin/ directory. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat(ci): add manually-triggered QA workflow for tutorials and HEMS Runs tutorials 1-4 and the HEMS walkthrough against the local docker compose stack, using the runner scripts kept in FlexMeasures/tsc and the HEMS example kept in FlexMeasures/flexmeasures-client (not duplicated here). Manual trigger only, to avoid slowing down every push while still cutting release QA toil. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat(ci): make qa-release.yml also validate HEMS report generation The HEMS example's report-generation step shells out to a local flexmeasures CLI, which doesn't work as-is against a dockerized server. Bind-mount examples/HEMS/configs into the server container and point FLEXMEASURES_CLI_CMD/FLEXMEASURES_CLI_CONFIG_DIR (added in FlexMeasures/flexmeasures-client#qa/hems-report-cli-override) at it, so report generation runs for real instead of being silently skipped. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs: add changelog entry for release automation workflows Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * feat(ci): require manual approval for Docker Hub publish Gate docker-publish.yml behind the dockerhub GitHub environment, mirroring the approval gate already used by pypi-publish.yml. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * refactor(ci): rename workflows for clarity, move dummy-price script into ci/ Rename build.yml -> docker-build.yml and release.yml -> pypi-publish.yml so filenames reflect what they actually build/publish, and qa-release.yml -> docker-qa.yml to distinguish it from the release-publishing pair. Move generate-dummy-price.sh into ci/, alongside the other CI helper scripts, and update references accordingly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: address PR #2260 review comments - release_process.rst: fix "cut" -> "done" wording; point QA at the in-repo documentation/tut/scripts tutorial runners (including tutorial 5) instead of the tsc repo, since those scripts live here now. - docker-qa.yml: run tutorials 1-5 from documentation/tut/scripts directly, dropping the tsc checkout step and tsc-ref input. - list-merged-prs-since-tag.sh: only list merged PRs not yet referenced by a `PR #NNNN` link in an existing changelog file, instead of listing every merged PR unconditionally. - docker-publish.yml: build the image once and push it under both the version tag and (for stable releases) `latest`, instead of building twice; add a comment explaining what `github.event.release.prerelease` is. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Signed-off-by: F.N. Claessen <claessen@seita.nl> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> (cherry picked from commit 870c560) Signed-off-by: F.N. Claessen <claessen@seita.nl>
Description
Automations to help with releasing.
.shscript to thecipackage.documentation/changelog.rstThe HEMS step of the QA workflow depends on FlexMeasures/flexmeasures-client#216, which has been merged. It:
FLEXMEASURES_CLI_CMD/FLEXMEASURES_CLI_CONFIG_DIRenv vars so the HEMS example's report-generation step can run against a dockerizedflexmeasures(viadocker compose exec -T server flexmeasures) instead of requiring a local CLI install, and202 Accepted(async job) response as an error, which silently broke the HEMS tutorial before it ever reached forecasting/scheduling/reporting.Look & Feel
...
How to test
Testing the workflows may require merging to main first.
Locally validated the full
qa-release.ymllogic (docker compose stack + tutorials 1-4 + HEMS with report generation) against flexmeasures-client#216's branch: all 6 HEMS simulation steps completed, all data uploads succeeded, all report-generation calls succeeded via the dockerized CLI, ending in "HEMS Tutorial completed successfully!" with zero failures.Further Improvements
The tutorial scripts remain on the tsc repo, as well as the original release checklist. Not sure if that situation should remain as is.
Related Items
Depends on FlexMeasures/flexmeasures-client#216 (merged).