-
Notifications
You must be signed in to change notification settings - Fork 72
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
Remove defaults channel on input channel: nodefaults
#364
Closed
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
680a72b
Remove defaults on channel nodefaults
liamhuber 5dae362
Allow removing defaults to fail
liamhuber 503b0a3
Refactor: rename error variable to be consistent with codebase
liamhuber e2848d3
Update src/conda.ts
liamhuber 5f0df52
Build the ts committed suggestions into the js
liamhuber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -47284,8 +47284,19 @@ function applyCondaConfiguration(inputs, options) { | |||||||||
// LIFO: reverse order to preserve higher priority as listed in the option | ||||||||||
// .slice ensures working against a copy | ||||||||||
for (const channel of channels.slice().reverse()) { | ||||||||||
core.info(`Adding channel '${channel}'`); | ||||||||||
yield condaCommand(["config", "--add", "channels", channel], options); | ||||||||||
core.info("Removing channel defaults"); | ||||||||||
if (channel === "nodefaults") { | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
try { | ||||||||||
yield condaCommand(["config", "--remove", "channels", "defaults"], options); | ||||||||||
} | ||||||||||
catch (err) { | ||||||||||
core.info("Removing defaults raised an error -- it was probably not present."); | ||||||||||
} | ||||||||||
} | ||||||||||
else { | ||||||||||
core.info(`Adding channel '${channel}'`); | ||||||||||
yield condaCommand(["config", "--add", "channels", channel], options); | ||||||||||
} | ||||||||||
} | ||||||||||
// All other options are just passed as their string representations | ||||||||||
for (const [key, value] of configEntries) { | ||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -126,8 +126,22 @@ export async function applyCondaConfiguration( | |||||||||||
// LIFO: reverse order to preserve higher priority as listed in the option | ||||||||||||
// .slice ensures working against a copy | ||||||||||||
for (const channel of channels.slice().reverse()) { | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
core.info(`Adding channel '${channel}'`); | ||||||||||||
await condaCommand(["config", "--add", "channels", channel], options); | ||||||||||||
core.info("Removing channel defaults"); | ||||||||||||
if (channel === "nodefaults") { | ||||||||||||
liamhuber marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
try { | ||||||||||||
await condaCommand( | ||||||||||||
["config", "--remove", "channels", "defaults"], | ||||||||||||
options, | ||||||||||||
); | ||||||||||||
} catch (err) { | ||||||||||||
core.info( | ||||||||||||
"Removing defaults raised an error -- it was probably not present.", | ||||||||||||
); | ||||||||||||
} | ||||||||||||
} else { | ||||||||||||
core.info(`Adding channel '${channel}'`); | ||||||||||||
await condaCommand(["config", "--add", "channels", channel], options); | ||||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
// All other options are just passed as their string representations | ||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this change the behaviour so that the absence of
defaults
is the new default behaviour?I actually disagree with @oursland that including
defaults
by default is a bug that needs to be removed -- at least here. I'm 100% in favour of getting rid of it in the default behaviour ofconda
itself, but for me it's important thatsetup-miniconda
be consistent withconda
where they share terminology (like "channels"). To this end I actually don't recommend changing the default behaviour, and still never want to see the channelnodefaults
explicitly get added to the channels list.Ie fix problems upstream, and keep behaviour downstream consistent with upstream (maybe adding extra convenience on top of that consistency as in... can't find the link on mobile, but you know, the other PR relevant here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case when a user specifies
channels
(like below), it would only use thosechannels
setup-miniconda/README.md
Lines 349 to 353 in 8f65dda
If no
channels
are specified, it would fallback to the default behavior of the selected installer/Conda (typically usingdefaults
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this still differs from default
conda
behviour, yeah? Wheredefaults
is included by default and setting the channelnodefaults
removes it rather than adding a channelnodefaults
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I follow
We don't specify how the
channel
public API of this GHA is implemented. It could be specified throughconda config
commands (like now) or it could be specified by writing out acondarc
or it could be options tacked onto eachconda create
/conda install
command or some other way not currently being consideredThink relying on how these public APIs are implemented under-the-hood is relying on an implementation detail, which would be subject to change. There is no guarantee the implementation details would remain the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though did miss we do say we will add
defaults
to the end of the list 🤦♂️setup-miniconda/README.md
Lines 335 to 337 in 8f65dda
That said, I think this is worth breaking. It would mean using a major version bump