Skip to content
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

Fix OCIMirror use #3296

Merged
merged 8 commits into from
May 27, 2024
Merged

Fix OCIMirror use #3296

merged 8 commits into from
May 27, 2024

Conversation

Hind-M
Copy link
Member

@Hind-M Hind-M commented May 15, 2024

No description provided.

@Hind-M Hind-M assigned Hind-M and unassigned Hind-M May 15, 2024
@Hind-M Hind-M added the release::enhancements For enhancements PRs or implementing features label May 15, 2024
@@ -324,26 +325,12 @@ namespace mamba

std::string PackageFetcher::channel() const
{
if (m_package_info.package_type == specs::PackageType::Conda)
Copy link
Member Author

@Hind-M Hind-M May 17, 2024

Choose a reason for hiding this comment

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

Not sure why this was added but the package type is set to its default value Unknown while it should be set to Conda when downloading using OCI mirrors.
That said, changing this (in this PR) still makes the tests pass in the CI, so I don't know what's the use case of the else...
Same for url_path()

Copy link
Member

Choose a reason for hiding this comment

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

I don't remember either Oo

logger->info(fmt::format("< {}", log));
break;
default:
// WARNING Using `hide_secrets` here will give a seg fault on linux,
Copy link
Member Author

Choose a reason for hiding this comment

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

I actually found out that the seg fault was related to the default case, so getting hide_secrets back in the other cases and adding a warning in the default one.

}

// This is not used but could be if we use creds
// cf. OCIMirror constructor comment in header
bool OCIMirror::need_authentication() const
Copy link
Member Author

@Hind-M Hind-M May 17, 2024

Choose a reason for hiding this comment

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

Removing need_authentication() from where it was used to avoid confusion as it's not clear how the credentials are supposed to be used. To pull artifacts we request a token, and we don't support uploading like powerloader, so AFAIK there is no need for credentials at the moment.
I also added this comment for more details.
I left the function implementation though even if it's not used (as a hint for maybe later if needed, like username and password) but we could also decide this is useless and just remove it/them.

@SylvainCorlay
Copy link
Member

🎉

@Hind-M Hind-M marked this pull request as ready for review May 21, 2024 12:43
@Hind-M Hind-M requested a review from JohanMabille May 21, 2024 12:43
@@ -324,26 +325,12 @@ namespace mamba

std::string PackageFetcher::channel() const
{
if (m_package_info.package_type == specs::PackageType::Conda)
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember either Oo

// containing the `checksum` and its `type`
// (to handle other checksums types like md5...)
// cf. `Checksum` struct in powerloader
std::string sha256;
Copy link
Member

Choose a reason for hiding this comment

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

I think we want something even more generic to handle additional parameters specific to a kind of storage. This should be done in a dedicated PR, though.

@JohanMabille JohanMabille merged commit 93d565e into mamba-org:main May 27, 2024
32 checks passed
@SylvainCorlay
Copy link
Member

Bravo! Congrats on getting this in @Hind-M 🎉 🎉 🎉 🎉 🎉 🎉

@Hind-M Hind-M deleted the oci branch May 28, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::enhancements For enhancements PRs or implementing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants