Skip to content

Conversation

@Ongy
Copy link

@Ongy Ongy commented Dec 20, 2024

No description provided.

Copy link
Contributor

@mering mering left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to proposing this upstream!

Copy link
Owner

@abrisco abrisco left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here! @Ongy what do you think about the review from @mering? I think this change is fine as is but the feedback also sounds good to me!

@Ongy Ongy requested a review from abrisco January 7, 2025 09:01
tag_classes = {"options": options},
tag_classes = {
"options": options,
"import_repository": tag_class(attrs = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe call this chart such that helm.chart(...) imports a chart. As this is used in MODULE.bazel I can't imagine anything other than importing from a repository to make sense. All other ways to import charts are probably specified via BUILD files.

Copy link
Author

Choose a reason for hiding this comment

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

NAK

I value the consistency with the documented functions in the Readme.md over isolated potentially better name.
In context, it's also obvious that this is rather: "import from repository" than "import a repository", as there's also a "helm_import" function.

Copy link
Contributor

Choose a reason for hiding this comment

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

@abrisco WDYT?

Copy link
Owner

Choose a reason for hiding this comment

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

I would be happy to rename things if it makes more sense to the larger community. I'm only really familiar with Bazel terminology and loosely familiar with Helm's so whatever names I chose would have skewed more Bazel-like. I do think import_repository is a bit lengthy so maybe import if not chart but I also think whatever the name, docs should describe clearly what this does so people from either camp can figure it out easily.

@Ongy Ongy force-pushed the add-import-repository-extension branch from 0572050 to eebaf6d Compare January 8, 2025 12:18
@Ongy Ongy force-pushed the add-import-repository-extension branch from 0124e8d to 988121b Compare January 24, 2025 08:53
@Ongy
Copy link
Author

Ongy commented Jan 24, 2025

@abrisco can you take a look at the naming discussion, and do another pass over the code? thx.

Copy link
Owner

@abrisco abrisco left a comment

Choose a reason for hiding this comment

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

Thanks! Just one request!

# And the _register_toolchains needs to be called *after* iteration of all modules.
for module in ctx.modules:
for repository in module.tags.import_repository:
if not module.is_root:
Copy link
Owner

Choose a reason for hiding this comment

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

Why can't repositories be instantiated if it's not the root?

Copy link
Contributor

Choose a reason for hiding this comment

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

They can but they shouldn't for now since this would require more elaborate de-duplication based on repository URL. This approach is commonly used in module extensions to facilitate future improvements. This way, one can migrate a breaking change (for example generating the name based on repository and/or chart) completely in the root module while otherwise a change in the interface would require updating all transitive dependencies first.

Copy link
Owner

Choose a reason for hiding this comment

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

It seems like de-duplication needs to be figured out first. I would hate for someone to be unable to pull a transitive dependency because they used rules_helm and now necessary repositories are missing. Would it be reasonable to prefix the dependencies with the name of the module and then require users define the name of a hub repository where these deps are accessed that needs to be globally unique? I also am still fairly new to bzlmod but isn't it supposed to solve for issues like this in transitive dependencies?

@Ongy Ongy requested a review from abrisco September 1, 2025 08:36
@mering
Copy link
Contributor

mering commented Dec 4, 2025

@abrisco Can you please take another look? Thanks!

Copy link
Owner

@abrisco abrisco left a comment

Choose a reason for hiding this comment

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

Sorry this fell off my radar! More questions for you 😄

# And the _register_toolchains needs to be called *after* iteration of all modules.
for module in ctx.modules:
for repository in module.tags.import_repository:
if not module.is_root:
Copy link
Owner

Choose a reason for hiding this comment

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

It seems like de-duplication needs to be figured out first. I would hate for someone to be unable to pull a transitive dependency because they used rules_helm and now necessary repositories are missing. Would it be reasonable to prefix the dependencies with the name of the module and then require users define the name of a hub repository where these deps are accessed that needs to be globally unique? I also am still fairly new to bzlmod but isn't it supposed to solve for issues like this in transitive dependencies?

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.

3 participants