Skip to content

Additional refactoring of ManagedDependencies #3750

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

Merged
merged 3 commits into from
Oct 5, 2021

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Sep 16, 2021

As suggested in #3698 (comment), this PR provides additional refactoring of ManagedDependencies by rebasing changes in #3640 against #3698.

Motivation:

Improve convenience and correctness of Workspace APIs.

Modifications:

  • Converted ManagedDependency from class to structure and made ManagedDependency.State an indirect enumeration. It makes sense for this to be a value type and has the added benefit of automatic Equatable synthesis.
  • Removed ManagedDependency.packageIdentity property. This was a helper for self.packageRef.identity and only used in a couple places.
  • Consolidated dependency path determination into dedicated APIs. There are a few places where we determine the location of a repository checkout or edited package by appending to a location. To ensure consistent routing (i.e. case normalization), these now go through a single API.
  • Removed ManagedDependency.subpath property. The location of a managed dependency is determined by the workspace (except in the case of an unmanaged edited dependency, which stores its path separately), so we don't need to store it separately. I wasn't able to get this working. To be considered for a future refactoring pass.

@mattt mattt changed the title Refactor managed dependencies redux Additional refactoring of ManagedDependencies Sep 16, 2021
@tomerd tomerd self-assigned this Sep 20, 2021
@tomerd
Copy link
Contributor

tomerd commented Sep 26, 2021

@matt #3698 should be ready for you to test against, when you are happy with it I will merge it as the rest of our tests pass

@mattt mattt force-pushed the refactor-managed-dependencies-redux branch from 62907ea to 781e490 Compare September 27, 2021 13:09
@mattt

This comment has been minimized.

@mattt

This comment has been minimized.

@mattt mattt marked this pull request as ready for review September 27, 2021 13:18
@mattt mattt requested a review from tomerd September 27, 2021 13:18
@mattt mattt force-pushed the refactor-managed-dependencies-redux branch from 781e490 to 33cc5e5 Compare September 30, 2021 13:06
@mattt mattt added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Sep 30, 2021
@mattt

This comment has been minimized.

@mattt mattt marked this pull request as draft September 30, 2021 20:53
@mattt mattt force-pushed the refactor-managed-dependencies-redux branch from 33cc5e5 to 358c206 Compare October 4, 2021 18:26
@mattt mattt marked this pull request as ready for review October 4, 2021 18:26
@mattt
Copy link
Contributor Author

mattt commented Oct 4, 2021

@swift-ci Please smoke test

@tomerd
Copy link
Contributor

tomerd commented Oct 5, 2021

nice. thank you

@tomerd tomerd merged commit 522d8c7 into swiftlang:main Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants