Skip to content

add code-mirror.dlang.io as fallback registry#1190

Merged
s-ludwig merged 1 commit intodlang:masterfrom
MartinNowak:fallback_mirror
Aug 26, 2017
Merged

add code-mirror.dlang.io as fallback registry#1190
s-ludwig merged 1 commit intodlang:masterfrom
MartinNowak:fallback_mirror

Conversation

@MartinNowak
Copy link
Member

new RegistryPackageSupplier(URL(defaultRegistryURL)),
new RegistryPackageSupplier(URL(fallbackRegistryURL))
)
];
Copy link
Member

Choose a reason for hiding this comment

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

Why not simply return an array of the two? The intent is already that later array entries act as fallbacks to the earlier ones.

Copy link
Member Author

Choose a reason for hiding this comment

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

To avoid duplicates, e.g. in dub search and to correctly deal with user-facing error reporting. The current mechanism adds another registry which can be used e.g. to serve private projects, very different use-case than a mirror registry which is expected to serve identical projects.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hope that the documentation on FallbackPackageRegistry is good enough @s-ludwig.


/// The URL to the official package registry.
enum defaultRegistryURL = "http://code.dlang.org/";
enum fallbackRegistryURL = "https://code-mirror.dlang.io/";
Copy link
Contributor

Choose a reason for hiding this comment

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

It would make sense to make this an array (this week will I hopefully finally get around setting up a stable mirror myself).

(http://alpha.dub.pm has been around since a while is an active mirror as well, but we use this VM as a pure staging server to preview PRs, hence I don't consider this as stable.)

Copy link
Contributor

Choose a reason for hiding this comment

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

this week will I hopefully finally get around setting up a stable mirror myself).

GitHub didn't send my review, so I finally got around setting up a stable mirror myself:

-> https://code-mirror2.dlang.io

Heroku Deploy is a bit more difficult to setup due to vibe-d/vibe.d#1785, but I will get around this as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Heroku Deploy is a bit more difficult to setup due to vibe-d/vibe.d#1785, but I will get around this as well.

-> https://dub-registry.herokuapp.com/

With dlang/dub-registry#231 setting up a local mirror should be absolutely easy (and doesn't even require a CLI nor money).

Copy link
Member Author

Choose a reason for hiding this comment

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

http://alpha.dub.pm/ says bad gateway btw.


abstract class AbstractFallbackPackageSupplier : PackageSupplier
{
protected PackageSupplier m_default, m_fallback;
Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned above, imho it would be useful to have multiple fallbacks.

Copy link
Member Author

@MartinNowak MartinNowak Jul 25, 2017

Choose a reason for hiding this comment

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

Simply nest them like a list new FallbackPackageSupplier(new FallbackPackageSupplier(... ;).

Copy link
Member Author

@MartinNowak MartinNowak Jul 25, 2017

Choose a reason for hiding this comment

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

I'd hope though that a third site wouldn't be necessary. We're also far from needing some round-robing load balancing, and should look at server side load-balancing/DNS etc. if that ever becomes a topic.

@dlang-bot
Copy link
Collaborator

Thanks for your pull request, @MartinNowak!

@s-ludwig
Copy link
Member

Can we make AbstractFallbackPackageSupplier and FallbackPackageSupplier package for now? That's the only thing I'm a bit worried about. Since we are now in the stable phase, I'd like to be very conscious about API additions and making one isn't really the primary goal of this change.

It would be nice to allow users to add fallback registries without caring for duplicates, too. So a duplicate detection logic for dub search might be an alternative here. But this doesn't have to be worked out within the context of this PR.

- to handle any code.dlang.org failures
@MartinNowak
Copy link
Member Author

Done @s-ludwig.

It would be nice to allow users to add fallback registries without caring for duplicates, too. So a duplicate detection logic for dub search might be an alternative here. But this doesn't have to be worked out within the context of this PR.

Yes, we could add some syntax, e.g. --registry=http://reg1.example.com,http://reg2.example.com --registry=http://someother.registry.com to be used for fallbacks.
Indeed looks like all operations but search would stop on first success, so dedup in search might work as well.

@MartinNowak
Copy link
Member Author

It might actually be simpler to just implement the dedup feature right away.

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.

4 participants