-
Notifications
You must be signed in to change notification settings - Fork 516
services/horizon: make our fork of throttled the primary dependency #1642
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
services/horizon: make our fork of throttled the primary dependency #1642
Conversation
should we use a |
@MonsieurNicolas We could. The fork's README needs tidying up, and I'm not sure if we want to promote it as 'Stellar has this thing you should use' because @bartekn has some ideas on how his fixes in the fork could be done in a way that would be easier to propose to the upstream repo. Long term that might be better to pursue getting fixes merged upstream and swapping back to it? |
I'm ok with this, it looks like throttled isn't a very active project so I'm not worried about maintenance in the short term. If we actually have plans to push fixes upstream I don't think we should jump through the hoops of making a stellar project. |
@MonsieurNicolas made the suggestion stellar/go#1642 (comment) that we should take @bartekn's into the @stellar org. He setup the project and I pushed the `master` branch from over there. This change updates the imports and package name internally so that it knows itself at this repo address.
source = "https://github.com/bartekn/throttled.git" | ||
revision = "c99eef3ad70a3be5a983770523e0e379699c805c" | ||
name = "github.com/stellar/throttled" | ||
revision = "89d75816f59db3124e575e96b35d4b7d927cde93" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using a revision here and not a tag because it's a little confusing to introduce tags into our stellar/throttled
fork if we plan for it to converge with upstream someday. This commit is on the stellar
branch of that repo where our commits live.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
PR Checklist
PR Structure
otherwise).
services/friendbot
Thoroughness
This PR adds tests for the most critical parts of the new functionality or fixes.I've updated any docs (developer docs,.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
I've updated the relevant CHANGELOG (here for Horizon) ifneeded with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
Summary
Make @bartekn's fork of the
throttled
dependency the primary dependency for that dependency instead of being just a custom source, which is now hosted atg.yxqyang.asia/stellar/throttled
.Goal and scope
This is part of the initiative to move to Modules (#1634) and is a small change to simplify our Gopkg.toml/lock files to make that transition possible and simpler.
Using the fork seems to be confusing the go tooling in go1.12 and go1.13rc1, with both behaving a little differently. There is an issue open golang/go#33795 about it. The issue seems to be limited to replacing modules that don't have a
go.mod
, which is the case with thethrottled
module. Since this fork is the only fork of a dependency we use and it is simple package, it is straight forward for us to switch to using the fork fully in name rather than to try and make it work consistently with both versions, and we did that in bartekn/throttled#2. See that issue for more details about why we felt like this is the right move.For context, in modules a
replace
directive is how we tell the go toolchain that we want to use a fork of a module. However, a replace statement only applies when go commands are executed inside this repo as the main module and so importers of our repo won't be using the fork. This doesn't really matter forthrottled
because we only use it ininternal
andmain
modules ofhorizon
, but because of this the go toolchain does care about the original source since importers of our repo will get the original source, not the replacement.Important
The revision of
stellar/throttled
that we are importing did change. You can see the diff here:stellar/throttled@c99eef3...89d7581
Summary of changes
github.com/throttled/throttled
as a dependency withg.yxqyang.asia/stellar/throttled
so that it is the name of the dependency and not just the source used to retrieve the dependency.github.com/throttled/throttled
in import paths withg.yxqyang.asia/stellar/throttled
.g.yxqyang.asia/stellar/throttled
to include additional commits, see diff above.Known limitations & issues
What shouldn't be reviewed
[TODO]
Related
This change supersedes #1636.