Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@agriyakhetarpal
Copy link
Contributor

@agriyakhetarpal agriyakhetarpal commented Sep 12, 2025

Description

This PR updates the print_plan_results() function in conda.core.initialize, which is called as part of the conda init CLI. The issue was that commands like conda init --dry-run <shell> did not clearly indicate that the operation was a dry run and did not actually make any changes to the shell commands. This could mislead users into thinking that their shell configuration or dotfiles had been altered.

I have added a few print statements that activate when context.dry_run is truthy. I'd welcome any feedback on how these statements should be worded. Additionally, I believe that in a future PR, we could improve this further by changing the keywords so that Result.MODIFIED in the output table reads "would be modified" instead of simply "modified" when a dry run is executed.

Closes #15097
Related to #15096

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@agriyakhetarpal agriyakhetarpal requested a review from a team as a code owner September 12, 2025 22:35
@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Sep 12, 2025
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Sep 12, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 14, 2025

CodSpeed Instrumentation Performance Report

Merging #15211 will not alter performance

Comparing agriyakhetarpal:fix/dry-run-indication (5c0df71) with main (f7f4653)

Summary

✅ 21 untouched

@agriyakhetarpal
Copy link
Contributor Author

Thanks @jaimergp, I wasn't sure whether to use monkeypatch.setenv() + reset_context() or to keep using env_var/env_vars, as not all of them have been removed yet, and some tests in this test file were using them. However, it does make sense not to reintroduce them in new tests.

soapy1
soapy1 previously approved these changes Sep 15, 2025
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Approved in 🔎 Review Sep 15, 2025
@agriyakhetarpal
Copy link
Contributor Author

I have resolved the merge conflicts that occurred with recent merges. Thank you!

@ForgottenProgramme ForgottenProgramme merged commit 15c5ddf into conda:main Sep 18, 2025
141 of 143 checks passed
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Sep 18, 2025
@agriyakhetarpal agriyakhetarpal deleted the fix/dry-run-indication branch September 18, 2025 10:37
@kenodegard kenodegard mentioned this pull request Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

conda init --dry-run incorrect output showing changes made

5 participants