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

feat(spells): add opt alias arg to spell install [NET-529] #1772

Merged
merged 5 commits into from
Aug 31, 2023

Conversation

justprosh
Copy link
Member

@justprosh justprosh commented Aug 29, 2023

Description

Add an optional alias argument to Spell.install.

Motivation

Decider installs new installation spells and sets worker-spell aliases, and with this feature it will be more atomic and decider's Aqua code can be simpler.

Proposed Changes

Add optional argument and remove spell if add_alias has failed.

Checklist

  • The code follows the project's coding conventions and style guidelines.
  • All tests related to the changes have passed successfully.
  • Documentation has been updated to reflect the changes (if applicable).
  • All new and existing unit tests have passed.
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Code has been reviewed for quality and adherence to guidelines.
  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

@linear
Copy link

linear bot commented Aug 29, 2023

@justprosh justprosh requested review from folex and kmd-fl August 29, 2023 12:12
@justprosh justprosh added the e2e Run e2e workflow label Aug 30, 2023
@justprosh justprosh enabled auto-merge (squash) August 31, 2023 09:00
@justprosh justprosh merged commit fe8eab2 into master Aug 31, 2023
14 checks passed
@justprosh justprosh deleted the spell_install_alias branch August 31, 2023 09:16
@@ -372,7 +372,7 @@ impl ParticleAppServices {
&self.aliases.read(),
worker_id,
self.config.local_peer_id,
service_id_or_alias,
service_id_or_alias.to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is a bad pattern. Although it removes a lot of top-level clones, which makes the code look cleaner, it also introduces a deceiving function signature (ref => don't need to own) and deprives the ability to control your allocations on the top level.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can use Borrow trait if you'd like to offer flexibility, but I don't see it as a bad pattern at all. I see only one case, but it can be resolved with cloning to closure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants