Skip to content

Conversation

@craig8
Copy link
Contributor

@craig8 craig8 commented Dec 11, 2025

This pull request overhauls the project's CI/CD GitHub Actions workflows to modernize, simplify, and better align the automation with current project requirements. It introduces a new unified CI workflow, rewrites the development and production release workflows to use Pixi instead of Poetry, and removes legacy or redundant workflows. The changes streamline versioning, testing, packaging, and Docker publishing for both development and stable releases.

Key changes include:

CI Workflow Modernization:

  • Introduced a new .github/workflows/ci.yml workflow that runs linting, formatting, type checking, tests (across multiple OSes and Python versions), coverage reporting, and build steps using Pixi as the environment and package manager. This replaces fragmented or outdated CI processes and ensures consistent quality checks for pushes and pull requests.

Release Workflow Overhaul:

  • Replaced the previous release.yml with a new workflow that supports both tag-based and manual stable releases. The new workflow uses Pixi for environment management, automates version bumping and tagging, runs all quality checks and tests, builds packages, creates GitHub releases, publishes to PyPI, and builds/pushes multi-platform Docker images.
  • The workflow now only triggers for stable version tags (no prerelease suffixes) and provides a manual dispatch for custom releases.

Development Release Workflow Rewrite:

  • Completely rewrote the deploy-dev-release.yml workflow to support manual, branch-restricted development releases. It enables flexible prerelease version bumping, updates all relevant version files, runs tests and builds, creates GitHub prereleases, and builds/pushes Docker images. The workflow is now Pixi-based and removes PyPI publishing for development releases.

Removal of Legacy and Redundant Workflows:

  • Deleted the old main.yml Docker build/push workflow, consolidating Docker image publishing into the release workflows for better maintainability and consistency.

Build and Docker Publishing Improvements:

  • All workflows now use Docker Buildx for multi-architecture builds and improved caching, and consistently tag/push images using the new versioning scheme. [1] [2]

These changes provide a more robust, maintainable, and consistent CI/CD pipeline for the project.


CI/CD Workflow Modernization

  • Added .github/workflows/ci.yml to run lint, format, typecheck, test (across OSes and Python versions), coverage, and build steps using Pixi, standardizing CI checks for all pushes and PRs.
  • Removed the legacy .github/workflows/main.yml Docker build workflow, consolidating Docker publishing into the new release workflows.

Release Automation and Versioning

  • Rewrote .github/workflows/release.yml to support stable releases via tags or manual dispatch, with automated version bumping, Pixi-based builds, GitHub release creation, PyPI publishing, and Docker image build/push.
  • Ensured only stable versions (no prerelease suffixes) are published as production releases.

Development Release Improvements

  • Overhauled .github/workflows/deploy-dev-release.yml to allow manual, branch-restricted development releases with flexible prerelease version bumping, Pixi-based builds, GitHub prerelease creation, and Docker image build/push (no PyPI publishing).

Build and Docker Publishing Enhancements

  • All build and release workflows now use Docker Buildx for multi-architecture builds and improved caching, and consistently tag/push Docker images using the new versioning scheme. [1] [2]

…y management

- Added pixi.toml for project configuration and dependencies.
- Removed poetry.toml and pyproject.toml files.
- Deleted various scripts related to Poetry build and installation processes.
- Cleaned up project scripts and configurations to align with new dependency management approach.
- Updated import statements and logging configurations for clarity.
- Improved error handling and validation in GridAPPSD class.
- Enhanced formatting and style across multiple files to adhere to PEP 8 standards.
- Consolidated JSON handling functions for better maintainability.
- Added ruff.toml for linting configuration and removed legacy pixi.toml settings.
- General cleanup of comments and docstrings for improved documentation.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modernizes the project's build system and CI/CD pipeline by migrating from Poetry to Pixi and overhauling GitHub Actions workflows. The changes streamline dependency management, standardize code formatting, and improve release automation.

Key changes:

  • Migration from Poetry to Pixi for package and environment management
  • Implementation of new unified CI workflow with comprehensive testing across Python versions and operating systems
  • Overhaul of release workflows to support both stable and development releases with automated versioning and Docker image publishing

Reviewed changes

Copilot reviewed 47 out of 50 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pixi.toml New Pixi workspace configuration replacing Poetry, defines dependencies, tasks, and multi-Python environment support
ruff.toml New Ruff linter/formatter configuration for code quality enforcement
.github/workflows/ci.yml New unified CI workflow for linting, type checking, testing, and building
.github/workflows/release.yml Rewritten stable release workflow with Pixi-based builds and Docker publishing
.github/workflows/deploy-dev-release.yml Rewritten development release workflow with flexible version bumping
README.md Updated with Pixi-based development instructions and improved quick start guide
docs/INSTALLATION.md New comprehensive installation guide for various dependency managers
Dockerfile Simplified multi-stage build using Python 3.12 slim base
gridappsd-python-lib/gridappsd/*.py Code formatting updates to comply with Ruff standards
gridappsd-field-bus-lib/gridappsd_field_bus/*.py Code formatting updates to comply with Ruff standards
Poetry-specific files Removed Poetry configuration files (poetry.toml, pyproject.toml at root)
Legacy scripts Removed Poetry-based build and utility scripts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Dec 11, 2025

@craig8 I've opened a new pull request, #194, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Dec 11, 2025

@craig8 I've opened a new pull request, #195, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 48 out of 51 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

craig8 and others added 3 commits December 11, 2025 16:04
…ck (#194)

Addresses review feedback on PR #193 regarding unused code in the
`__onmeasurement` callback method.

## Changes

- Removed `message["simulation_id"]` access in
`Simulation.__onmeasurement()` that extracted but never used the value
- The simulation ID is already stored as `self.simulation_id` when the
simulation starts, making this extraction redundant

```python
def __onmeasurement(self, headers, message):
    """Call the measurement callbacks"""
-   message["simulation_id"]  # Dead code
    timestamp = message["message"]["timestamp"]
    measurements = message["message"]["measurements"]
    for p in self.__filterable_measurement_callback_set:
        p[0](self, timestamp, measurements)
```

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/GRIDAPPSD/gridappsd-python/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
The `dump()` function wrapper was missing a return type annotation,
causing type checking ambiguity.

## Changes
- Added `-> None` return type annotation to `dump()` in
`gridappsd/json_extension.py`

The function wraps `json.dump()`, which writes to a file object and
returns `None`. The annotation now matches the standard library's
signature.

```python
def dump(
    data: Any,
    fo: TextIO,
    *,
    skipkeys=False,
    ensure_ascii=True,
    check_circular=True,
    allow_nan=True,
    indent=None,
    separators=None,
    default=None,
    sort_keys=False,
    **kw,
) -> None:  # Added
    _json.dump(...)
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
Copy link

Copilot AI commented Dec 12, 2025

@craig8 I've opened a new pull request, #196, to work on those changes. Once the pull request is ready, I'll request review from you.

Thanks for the feedback on #193. I've created this new PR, which merges
into #193, to address your comment. I will work on the changes and keep
this PR's description up to date as I make progress.

Original PR: #193
Triggering review:
#193 (comment)
> @copilot open a new pull request to apply changes based on [this
feedback](#193 (comment))

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
- Included types-python-dateutil version 2.8 or higher
- Included types-pyyaml version 6.0 or higher
Fixed type errors in gridappsd-python-lib:
houses.py: Added TYPE_CHECKING import guard, fixed namedtuple definition
json_extension.py: Fixed dataclasses.asdict type narrowing
goss.py: Removed duplicate on_error method
app_registration.py: Removed Python 2 compatibility import
simulation.py: Converted List, Dict, Union → lowercase generics
main.py: Fixed call to non-existent run_simulation method
Fixed type errors in gridappsd-field-bus-lib:
interfaces.py: Converted to lowercase generics, fixed Optional usage, type-narrowed ConnectionType
gridappsd_field_bus.py: Implemented stub methods returning proper values
context.py: Added missing timeout argument
utils.py: Added proper type annotation
agents.py: Converted Dict → dict, added proper type annotations
context_manager_agents.py: Converted to lowercase generics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants