8000 Ensure that channel configuration remains identical with --update by maresb · Pull Request #817 · conda/conda-lock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ensure that channel configuration remains identical with --update #817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

maresb
Copy link
Contributor
@maresb maresb commented Jun 29, 2025

Description

If channel order changes, then we need to regenerate the lockfile from scratch (or do something really clever).

Copy link
netlify bot commented Jun 29, 2025

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit 314a70f
🔍 Latest deploy log https://app.netlify.com/projects/conda-lock/deploys/6861b5f5ee44ca00084a3957
😎 Deploy Preview https://deploy-preview-817--conda-lock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@maresb maresb force-pushed the ensure-channels-unchanged-for-update branch from c8fd5f2 to 314a70f Compare June 29, 2025 21:53
@maresb maresb marked this pull request as ready for review June 30, 2025 09:48
@maresb maresb requested a review from a team as a code owner June 30, 2025 09:48
@maresb maresb requested a review from Copilot July 2, 2025 21:36
Copy link
@Copilot 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 PR prevents partial updates when channel configurations change and adds a test to verify the new behavior.

  • Add a channel‐change check in make_lock_files to raise an error if channels differ on --update
  • Introduce test_update_with_changed_channels_raises_error in the test suite

Reviewed Changes

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

File Description
conda_lock/conda_lock.py Add guard and error message when lockfile channels differ
tests/test_conda_lock.py Add test for update flag raising an error on changed channels
Comments suppressed due to low confidence (2)

tests/test_conda_lock.py:3497

  • The test uses Channel.from_string but Channel is not imported; add Channel to the import list from conda_lock.lockfile.v1.models.
    from conda_lock.lockfile.v1.models import (

tests/test_conda_lock.py:3541

  • The test references DEFAULT_MAPPING_URL but it is not imported; add an import for DE 8000 FAULT_MAPPING_URL (for example, from conda_lock.conda_lock).
            mapping_url=DEFAULT_MAPPING_URL,

@@ -385,6 +385,18 @@ def make_lock_files( # noqa: C901
if original_lock_content is not None:
platforms_already_locked = list(original_lock_content.metadata.platforms)
if update is not None:
# Check if channels have changed since lockfile was last generated
if lock_spec.channels != original_lock_content.metadata.channels:
Copy link
Preview
Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

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

The error message prints channel URLs but the test asserts channel names ('defaults' and 'conda-forge') should appear; consider including channel names (e.g., c.name or str(c)) in the formatted message.

Copilot uses AI. Check for mistakes.

@maresb maresb merged commit 6aeaf80 into conda:main Jul 2, 2025
58 checks passed
@maresb maresb deleted the ensure-channels-unchanged-for-update branch July 2, 2025 21:40
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.

1 participant
0