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

Include incompatible dependencies in outdated output #2254

Merged
merged 25 commits into from Dec 18, 2017

Conversation

iv-mexx
Copy link
Contributor

@iv-mexx iv-mexx commented Nov 13, 2017

carthage outdated now lists all dependencies, even those that will not be updated because of the specified version in the Cartfile.

The output shows the current version, the latest compatible version to which the dependency will be updated when running carthage update as well as the latest available version.

Showing incompatible updates is very helpful to get a complete overview about a projects dependency. This is also the same behaviour as all the other dependency managers that I know of (E.g. Cocoapods, npm, yarn, bundler, ...).

In a follow-up PR (#2257) I will also add colors to the output to make it easier to read (which is also the behaviour of other existing dependency managers).

screen shot 2017-11-13 at 22 17 00

This PR is a continuation of #1369 (resolving #1260) which has not seen progress since more than a year.
I resumed the work from @mattprowse's branch to keep his commits, but in the meantime the codebase has changed considerably so I had to redo the most part. Actually, once I discovered that Resolver already does everything necessary, the latestDependencies all of a sudden was only 3 lines long 😌

Breaking Change

I had to change the signature of Project.updatedResolvedCartfile which is a public function in CarthageKit. In Carthage/CarthageKit it is not called from outsied of Project but since its public I don't know if it may be used somewhere else.

Earlier Comments

The two comments by @mdiep mentioned in #1369 (comment) have been discussed further down in this PR:

It doesn't work with dependencies that have no tagged versions.

Since this issue is not caused by this PR (it also happens before this PR), I will not try to fix it here.

It prints results for dependencies that are using a branch when there's nothing new on the branch. (Because it's not on the latest version.)

This has been taken care of in 5279bce

@iv-mexx
Copy link
Contributor Author

iv-mexx commented Nov 14, 2017

Hi, I'm having a few questions:

Regarding the points raised by @mdiep in #1369 (comment)

It doesn't work with dependencies that have no tagged versions.

If i'm understanding correctly, the same does not work even before this PR. Carthage throws an error (No tagged versions found for <Dependency>) in Project.versions(for:), called by Project.updatedResolvedCartfile.

It prints results for dependencies that are using a branch when there's nothing new on the branch. (Because it's not on the latest version.)

E.g. FormatterKit "2ea246..." -> "2ea246..." (Latest: "1.8.0"). How should this be handled?

  • Keep as is
  • Omit from the output
  • Print separately (e.g. "There could be newer commits" so the user does not forget about those dependencies... Usually I pin to a branch or commit just when there is no release yet)
  • I guess we could also parse the git tree from that commit to find the actual newest version / commit (Seems overkill to me)

Regarding testing

Any hints how I would mock a Cartfile, Carfile.resolved and Latest Versions with specific Versions for a testcase?

@iv-mexx iv-mexx mentioned this pull request Nov 14, 2017
@mdiep
Copy link
Member

mdiep commented Dec 3, 2017

If i'm understanding correctly, the same does not work even before this PR. Carthage throws an error (No tagged versions found for ) in Project.versions(for:), called by Project.updatedResolvedCartfile.

If it's broken before, then I guess fixing it isn't a prerequisite here. But it'd be nice. 😉

E.g. FormatterKit "2ea246..." -> "2ea246..." (Latest: "1.8.0"). How should this be handled?

Ideally, it would fetch the branch and show you only if the branch resolves to a different SHA now.

But failing that, I think it could just be omitted.

Any hints how I would mock a Cartfile, Carfile.resolved and Latest Versions with specific Versions for a testcase?

Maybe look at ResolverSpec?

@mdiep
Copy link
Member

mdiep commented Dec 4, 2017

When this is ready to be reviewed, please leave a comment saying so. ☺️



// swiftlint:enable identifier_name
private struct DB {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This DB struct is copied 1:1 from ResolverSpec. Should it rather be extracted into a separate file?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please extract it and the github1, github2, etc. 👍

@iv-mexx
Copy link
Contributor Author

iv-mexx commented Dec 4, 2017

@mdiep yup, will do! I still have to fix at least the issue with branches (the second note).
I will not tackle the first note currently though, maybe in a separate PR later.

@iv-mexx iv-mexx changed the title [WIP] Include incompatible dependencies in outdated output Include incompatible dependencies in outdated output Dec 4, 2017
@iv-mexx
Copy link
Contributor Author

iv-mexx commented Dec 4, 2017

@mdiep this is now ready for review! 🎉

@iv-mexx
Copy link
Contributor Author

iv-mexx commented Dec 16, 2017

@mdiep 🏓



// swiftlint:enable identifier_name
private struct DB {
Copy link
Member

Choose a reason for hiding this comment

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

Yes, please extract it and the github1, github2, etc. 👍

@mdiep
Copy link
Member

mdiep commented Dec 16, 2017

Sorry for the delay!

This is looking good. Just need to extract the DB and resolve the conflict. 👍

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.

None yet

3 participants