pavelzw / pixi-diff-to-markdown

Generate markdown summaries from pixi update
https://pixi.sh/dev/advanced/updates_github_actions
BSD 3-Clause "New" or "Revised" License
14 stars 3 forks source link

AssertionError: assert self.before.build is not None #39

Open maresb opened 21 hours ago

maresb commented 21 hours ago

I suspect this might be due to the recent upgrade to lockfile format v6?

update.json

  File "/home/mambauser/.cache/rattler/cache/cached-envs-v0/pixi-diff-to-markdown-5008bbbec36a6a5d/lib/python3.12/site-packages/pixi_diff_to_markdown/models.py", line 99, in change_type
    assert self.before.build is not None
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
benmoss commented 21 hours ago

wtf I just ran into this too!

benmoss commented 21 hours ago

I have a JSON diff where the structure is

{
  "version": 1,
  "environment": {
    "default": {
      "linux-64": [
        {
          "name": "pkg",
          "before": {
            "conda": "https://artifactory.corp.com/artifactory/conda/noarch/pkg-0.23.0-gcc70d65.conda"
          },
          "after": {
            "conda": "https://conda.registry.hosted.com/prod/noarch/pkg-0.23.0-gcc70d65.conda"
          },
          "type": "conda",
          "explicit": true
        }
      ]
    }
  }
}

I got this by removing a channel override and so it makes sense, the build didn't change, just the URL

maresb commented 20 hours ago

Workaround: downgrade pixi to v0.38.0. If you're using GHA, this is:

      uses: prefix-dev/setup-pixi@v0.8.1
      with:
        pixi-version: v0.38.0

This prevents a lockfile format change.

maresb commented 2 hours ago

It seems to be not just the transitional diff that's broken. It seems that there was a schema change in the diff, corresponding to a lockfile version change. So unless I'm mistaken, this is simply broken for pixi v0.39.0.