Skip to content

fix: only check for downgraded packages among the constrained dependencies, do not perform update in that case if warn on error is active#121

Merged
johanneskoester merged 4 commits into
mainfrom
fix/update-env-check-downgrade-only-constrained
Jun 1, 2026
Merged

fix: only check for downgraded packages among the constrained dependencies, do not perform update in that case if warn on error is active#121
johanneskoester merged 4 commits into
mainfrom
fix/update-env-check-downgrade-only-constrained

Conversation

@johanneskoester
Copy link
Copy Markdown
Contributor

@johanneskoester johanneskoester commented May 27, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved dependency parsing for conda environments to enforce stricter constraint validation and discard unparseable entries.
    • Faster failure behavior when package downgrades or conda execution errors occur: updates stop immediately with a warning instead of proceeding.

Review Change Stack

…ncies, do not perform update in that case if warn on error is active
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ccc6a3ca-1413-4cb1-a015-59b0fa953790

📥 Commits

Reviewing files that changed from the base of the PR and between 143d565 and f74d543.

📒 Files selected for processing (1)
  • snakedeploy/conda.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • snakedeploy/conda.py

📝 Walkthrough

Walkthrough

The PR enhances dependency parsing in CondaEnvProcessor.update_env by introducing a new only_constrained mode that filters unparseable dependencies, ensuring downgraded package detection only considers constrained (parseable) entries, and adds an early return when downgraded packages are detected with warn_on_error enabled.

Changes

Conda Environment Update Logic

Layer / File(s) Summary
Dependency filtering and downgraded package handling
snakedeploy/conda.py
Adds process_dependencies(func, only_constrained=False) helper to optionally drop unparseable dependencies. Updates downgraded package detection to intersect with only constrained dependencies via process_dependencies(..., only_constrained=True). When downgraded packages are detected and warn_on_error is enabled, the method now returns False immediately instead of continuing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: checking for downgraded packages only among constrained dependencies and preventing updates when warn_on_error is active.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/update-env-check-downgrade-only-constrained

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@johanneskoester johanneskoester changed the title Fix/update env check downgrade only constrained k for downgraded packages among the constrained dependencies, do not perform update in that case if warn on error is active May 27, 2026
@johanneskoester johanneskoester changed the title k for downgraded packages among the constrained dependencies, do not perform update in that case if warn on error is active fix: only check for downgraded packages among the constrained dependencies, do not perform update in that case if warn on error is active May 27, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@snakedeploy/conda.py`:
- Line 166: process_dependencies currently uses list(filter(process_dependency,
conda_env["dependencies"])) which only filters by truthiness and returns the
original dependency strings instead of the transformed values returned by
process_dependency; change it to map process_dependency over
conda_env["dependencies"] and collect non-None results (e.g., [r for r in
(process_dependency(dep) for dep in conda_env["dependencies"]) if r is not
None]) so callers receive the transformed dependency strings (and ensure any
downstream uses like the downgraded set intersection operate on these
parsed/transformed names rather than the raw dependency entries).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7cba05d9-6182-4267-9f2c-4ae426348ce5

📥 Commits

Reviewing files that changed from the base of the PR and between f482e35 and 143d565.

📒 Files selected for processing (1)
  • snakedeploy/conda.py

Comment thread snakedeploy/conda.py Outdated
@johanneskoester johanneskoester merged commit 4ace455 into main Jun 1, 2026
6 checks passed
@johanneskoester johanneskoester deleted the fix/update-env-check-downgrade-only-constrained branch June 1, 2026 10:29
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