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

Add command component sync #607

Merged
merged 12 commits into from
Aug 25, 2022
Merged

Add command component sync #607

merged 12 commits into from
Aug 25, 2022

Conversation

simu
Copy link
Member

@simu simu commented Aug 24, 2022

This PR refactors the implementation of package sync to be generic over the Commodore dependency types (Component and Package) and their corresponding templating types (base class Templater). This allows us to use the exact same code with slightly different invocations to implement both package sync and component sync. Currently we don't even provide wrapper functions for the refactored sync_dependencies() but instead explicitly call it with the appropriate classes as arguments.

Additionally, we ensure that Component and Package provide a common interface for base operations required by sync_dependencies(). Side-note: we should introduce a common base class for the two classes (#608).

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Update the documentation.
  • Update tests.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Link this PR to related issues.

This method creates a MultiDependency and Component object from the
given clone URL and name and checks out the requested version.
This should ensure that we properly manage multiple packages in a single
repo when creating `Package` objects via `clone()`.
This ensures that the type checker is happy if we have a variable of
type `Type[Templater]` and call `from_existing()` on that variable.
@simu simu added the enhancement New feature or request label Aug 24, 2022
Prepare implementation to also work for `component sync`.
This is pretty much a carbon copy of `package sync`
We add a helper which returns the passed object's type name in
lower-case. This avoids the need for using `instanceof()` to use the
correct dependency identifier ('component' or 'package') in the
dependency sync outputs.
@simu simu marked this pull request as ready for review August 25, 2022 08:37
@simu simu requested a review from a team as a code owner August 25, 2022 08:37
@simu simu merged commit 6b6e816 into master Aug 25, 2022
@simu simu deleted the feat/component-sync branch August 25, 2022 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants