spongepowered / downloadindexer Goto Github PK
View Code? Open in Web Editor NEWThe download indexer and API for the Sponge project
License: MIT License
The download indexer and API for the Sponge project
License: MIT License
A table should be added with API versions linked to the MC versions that can run them in order to assist ore, and other systems with understanding what game versions plugins support that do not hardcode this information due to factors that limit them to only one version, or a subset of versions of the game.
This will be needed for SpongePowered/Ore#387
Calling this you would expect to get API 6 versions back, but instead you get (currently) 7.1.0 and 8.0.0 versions instead.
https://dl-api.spongepowered.org/v1/org.spongepowered/spongevanilla/downloads?version=6
Adding to SpongePowered/SpongeDownloads#8
Downloads page should be removing the highlight on Latest Build and instead show Recommended Build at the top, hiding all other versions in a spoiler like the Forge site does.
Stable should be renamed to Release, as it doesn't imply stability. Recommended Build will be instead the stable version.
v1/groupId/artifactId/downloads
should have pagination support. an example of how this would function could be ?limit=100&skip=0
or no skip entered as a parameter, then ?limit=100&skip=100
E.g. to support multiple stable versions (API 5 and API 6). Will need to remove the automatic unsupported check and make it manual instead.
SBT uploads snapshots without the date/time suffix (meh). For example:
org/spongepowered/play-discourse/2.0.0-SNAPSHOT/play-discourse-2.0.0-SNAPSHOT.pom
org/spongepowered/play-discourse/2.0.0-SNAPSHOT/play-discourse-2.0.0-20180305.153526-1.jar
I'm not sure if the indexer should allow this, but it should definitely not panic:
[Indexer] 2018/03/05 14:13:35 PANIC: runtime error: slice bounds out of range
/usr/lib/golang/src/runtime/panic.go:491 (0x43ae12)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/lib/golang/src/runtime/panic.go:35 (0x439b5d)
panicslice: panic(sliceError)
$GOPATH/src/github.com/SpongePowered/SpongeDownloads/indexer/path.go:101 (0x835d2f)
parsePath: p.displayVersion = filename[:end]
$GOPATH/src/github.com/SpongePowered/SpongeDownloads/indexer/controller.go:207 (0x82e7d8)
(*Indexer).Put: p, err := parsePath(path, true)
$GOPATH/src/github.com/SpongePowered/SpongeDownloads/indexer/controller.go:130 (0x836583)
(*Indexer).Put-fm: m.Put("/*", i.Put)
/usr/lib/golang/src/runtime/asm_amd64.s:509 (0x4669fa)
call32: CALLFN(·call32, 32)
/usr/lib/golang/src/reflect/value.go:434 (0x4bdb14)
Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
/usr/lib/golang/src/reflect/value.go:302 (0x4bd0f3)
Value.Call: return v.call("Call", in)
$GOPATH/src/github.com/go-macaron/inject/inject.go:177 (0x739c18)
(*injector).callInvoke: return reflect.ValueOf(f).Call(in), nil
$GOPATH/src/github.com/go-macaron/inject/inject.go:137 (0x739519)
(*injector).Invoke: return inj.callInvoke(f, t, t.NumIn())
$GOPATH/src/gopkg.in/macaron.v1/context.go:121 (0x756a6d)
(*Context).run: vals, err := c.Invoke(c.handler())
$GOPATH/src/gopkg.in/macaron.v1/context.go:112 (0x7569a5)
(*Context).Next: c.run()
$GOPATH/src/gopkg.in/macaron.v1/recovery.go:161 (0x768a7a)
Recovery.func1: c.Next()
$GOPATH/src/gopkg.in/macaron.v1/logger.go:40 (0x759d3b)
LoggerInvoker.Invoke: invoke(params[0].(*Context), params[1].(*log.Logger))
$GOPATH/src/github.com/go-macaron/inject/inject.go:157 (0x7398d3)
(*injector).fastInvoke: return f.Invoke(in)
$GOPATH/src/github.com/go-macaron/inject/inject.go:135 (0x73960a)
(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
$GOPATH/src/gopkg.in/macaron.v1/context.go:121 (0x756a6d)
(*Context).run: vals, err := c.Invoke(c.handler())
$GOPATH/src/gopkg.in/macaron.v1/context.go:112 (0x7569a5)
(*Context).Next: c.run()
$GOPATH/src/github.com/SpongePowered/SpongeDownloads/indexer/controller.go:366 (0x83047e)
(*Indexer).ErrorHandler: ctx.Next()
$GOPATH/src/github.com/SpongePowered/SpongeDownloads/indexer/controller.go:133 (0x8365e3)
(*Indexer).ErrorHandler-fm: i.ErrorHandler,
$GOPATH/src/gopkg.in/macaron.v1/context.go:79 (0x756850)
ContextInvoker.Invoke: invoke(params[0].(*Context))
$GOPATH/src/github.com/go-macaron/inject/inject.go:157 (0x7398d3)
(*injector).fastInvoke: return f.Invoke(in)
$GOPATH/src/github.com/go-macaron/inject/inject.go:135 (0x73960a)
(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
$GOPATH/src/gopkg.in/macaron.v1/context.go:121 (0x756a6d)
(*Context).run: vals, err := c.Invoke(c.handler())
$GOPATH/src/gopkg.in/macaron.v1/context.go:112 (0x7569a5)
(*Context).Next: c.run()
$GOPATH/src/gopkg.in/macaron.v1/logger.go:52 (0x767d0b)
Logger.func1: ctx.Next()
/usr/lib/golang/src/runtime/asm_amd64.s:509 (0x4669fa)
call32: CALLFN(·call32, 32)
/usr/lib/golang/src/reflect/value.go:434 (0x4bdb14)
Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
/usr/lib/golang/src/reflect/value.go:302 (0x4bd0f3)
Value.Call: return v.call("Call", in)
$GOPATH/src/github.com/go-macaron/inject/inject.go:177 (0x739c18)
(*injector).callInvoke: return reflect.ValueOf(f).Call(in), nil
$GOPATH/src/github.com/go-macaron/inject/inject.go:137 (0x739519)
(*injector).Invoke: return inj.callInvoke(f, t, t.NumIn())
$GOPATH/src/github.com/SpongePowered/SpongeWebGo/fastly/healthcheck.go:21 (0x785425)
(*Cache).LogHandler.func1: if _, err := ctx.Invoke(fallback); err != nil {
$GOPATH/src/gopkg.in/macaron.v1/context.go:79 (0x756850)
ContextInvoker.Invoke: invoke(params[0].(*Context))
$GOPATH/src/github.com/go-macaron/inject/inject.go:157 (0x7398d3)
(*injector).fastInvoke: return f.Invoke(in)
$GOPATH/src/github.com/go-macaron/inject/inject.go:135 (0x73960a)
(*injector).Invoke: return inj.fastInvoke(v, t, t.NumIn())
$GOPATH/src/gopkg.in/macaron.v1/context.go:121 (0x756a6d)
(*Context).run: vals, err := c.Invoke(c.handler())
$GOPATH/src/gopkg.in/macaron.v1/router.go:187 (0x769d62)
(*Router).Handle.func1: c.run()
$GOPATH/src/gopkg.in/macaron.v1/router.go:303 (0x76327b)
(*Router).ServeHTTP: h(rw, req, p)
$GOPATH/src/gopkg.in/macaron.v1/macaron.go:220 (0x75b2a7)
(*Macaron).ServeHTTP: m.Router.ServeHTTP(rw, req)
/usr/lib/golang/src/net/http/server.go:2619 (0x6ec933)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/lib/golang/src/net/http/server.go:1801 (0x6e8cbc)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/lib/golang/src/runtime/asm_amd64.s:2337 (0x469260)
goexit: BYTE $0x90 // NOP
This is also needed for assisting API users with building dropdowns
https://dl-api.spongepowered.org/v1/org.spongepowered/spongevanilla/ for example should show something like this for buildtypes
{
"name": "SpongeVanilla",
"pluginId": "sponge",
"github": {
"owner": "SpongePowered",
"repo": "SpongeVanilla"
},
"buildTypes": {
"bleeding": {
"latest": {
"version": "1.12.2-8.0.0-BETA-394",
"dependencies": {
"minecraft": "1.12.2",
"spongeapi": "8.0.0-SNAPSHOT-4ae8f537"
}
},
"recommended": {
"version": "1.12.2-7.1.0-BETA-15",
"dependencies": {
"minecraft": "1.12.2",
"spongeapi": "7.1.0-SNAPSHOT-b1637867"
}
}
},
"stable": {
"latest": {
"version": "1.12.2-7.1.0-BETA-15",
"dependencies": {
"minecraft": "1.12.2",
"spongeapi": "7.1.0-SNAPSHOT-b1637867"
}
},
"recommended": {
"version": "1.12.2-7.1.0-BETA-15",
"dependencies": {
"minecraft": "1.12.2",
"spongeapi": "7.1.0-SNAPSHOT-b1637867"
}
}
}
}
...
}
name = id
spongeforge = spongeforge
spongevanilla = spongevanilla
spongecommon = sponge
An API should be added to show what Minecraft versions are supported for the artifact to assist API users in generating drop downs for installing sponge
TODOs exist already for this throughout the code. It just needs to be a simple API method that adds the recommended label to the specified build.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.