diff --git a/.github/cite/run.sh b/.github/cite/run.sh index 1060303f..b6fa8820 100755 --- a/.github/cite/run.sh +++ b/.github/cite/run.sh @@ -43,14 +43,7 @@ OUT=${5:-cite-$SCHEME.xml} # run that silently tested nothing fails instead of passing. MIN_PASSED=${MIN_PASSED:-15} -# SHIGOLA_PORT, falling back to the pre-rename TEGOLA_PORT so an existing caller -# keeps working. internal/env.Getenv resolves the same way and warns on the -# legacy name; warn here too, or the deprecation is silent in exactly the place -# someone is still using it. -if [ -z "${SHIGOLA_PORT:-}" ] && [ -n "${TEGOLA_PORT:-}" ]; then - echo "warning: TEGOLA_PORT is deprecated, use SHIGOLA_PORT" >&2 -fi -SHIGOLA_PORT=${SHIGOLA_PORT:-${TEGOLA_PORT:-8081}} +SHIGOLA_PORT=${SHIGOLA_PORT:-8081} TE_PORT=${TE_PORT:-8080} TE_IMAGE=${TE_IMAGE:-ogccite/ets-ogcapi-tiles10} TE_NAME=${TE_NAME:-cite-teamengine} diff --git a/.github/workflows/ogc_cite.yml b/.github/workflows/ogc_cite.yml index c5498155..527e8de5 100644 --- a/.github/workflows/ogc_cite.yml +++ b/.github/workflows/ogc_cite.yml @@ -104,12 +104,12 @@ jobs: # workflow-level `env:` default would not -- that takes precedence over the # process environment and would pin the port at its literal. # - # The TEGOLA_PORT leg must match run.sh exactly. Without it, setting only - # the legacy name binds the server on 8081 while the suite polls 9081, and - # the only symptom is run.sh's readiness poll timing out. + # The default must match run.sh's. Otherwise the server binds one port + # while the suite polls another, and the only symptom is run.sh's + # readiness poll timing out. - name: Start shigola run: | - "${{ runner.temp }}/shigola" serve --config .github/cite/config.toml --port ":${SHIGOLA_PORT:-${TEGOLA_PORT:-8081}}" & + "${{ runner.temp }}/shigola" serve --config .github/cite/config.toml --port ":${SHIGOLA_PORT:-8081}" & echo $! > shigola.pid # Both declared tiling schemes: the tile differs because the same ground is diff --git a/.github/workflows/on_pr_push.yml b/.github/workflows/on_pr_push.yml index 2217c5ee..4bfc2815 100644 --- a/.github/workflows/on_pr_push.yml +++ b/.github/workflows/on_pr_push.yml @@ -78,6 +78,9 @@ jobs: # AWS S3 tests RUN_S3_TESTS: yes + # The bucket keeps its pre-rename name: it is an existing S3 bucket, + # and a bucket cannot be renamed, only replaced. Rename it here when + # that happens. AWS_TEST_BUCKET: tegola-ci AWS_REGION: us-east-2 diff --git a/.gitignore b/.gitignore index 9ab87d40..98adff7d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ yarn-error.log* *.njsproj *.sln *.sw? -cmd/tegola_lambda/tegola_lambda +cmd/shigola_lambda/shigola_lambda # Coverage profiles. The measured baseline in ci/coverage-baseline.txt is # committed; the profile it is derived from is a build artifact and is not. diff --git a/atlas/atlas.go b/atlas/atlas.go index 2fd3fd92..3a4a30db 100644 --- a/atlas/atlas.go +++ b/atlas/atlas.go @@ -403,7 +403,7 @@ func (a *Atlas) SetObservability(o observability.Interface) { } for _, aMap := range a.maps { - collectors, err := aMap.Collectors("tegola", o.CollectorConfig) + collectors, err := aMap.Collectors(metricPrefix, o.CollectorConfig) if err != nil { log.Errorf("failed to register collector for map: %v ignoring", aMap.Name) continue diff --git a/atlas/cache_collectors.go b/atlas/cache_collectors.go index 5751553d..80f8d836 100644 --- a/atlas/cache_collectors.go +++ b/atlas/cache_collectors.go @@ -7,6 +7,12 @@ import ( "github.com/MapColonies/shigola/observability" ) +// metricPrefix names every metric family atlas publishes on behalf of +// something else: the cache's pool and chain counters, and each map's provider +// collectors. It matches the prefix the prometheus observer gives its own +// families, so one product publishes under one name. +const metricPrefix = "shigola" + // cacheStatsCollector publishes the write pool's and the chain's counters. // // They cannot publish themselves: observability imports cache, so cache can @@ -52,7 +58,7 @@ func newCacheStatsCollector(prefix string, pool *cache.WritePool, chain cache.Ch slotsInFlight: desc("_write_slots_in_flight", "Detached cache writes currently in flight. Alert on this approaching capacity: drops only begin once the pool is already exhausted."), slotsCapacity: desc("_write_slots_capacity", - "Configured detached write slots (TEGOLA_OPTIONS=DetachedWriteSlots)."), + "Configured detached write slots (SHIGOLA_OPTIONS=DetachedWriteSlots)."), dropped: desc("_writes_dropped_total", "Detached writes never attempted because the pool was full at admission."), @@ -64,7 +70,7 @@ func newCacheStatsCollector(prefix string, pool *cache.WritePool, chain cache.Ch failed: desc("_writes_failed_total", "Detached writes attempted that returned an error."), completed: desc("_writes_completed_total", "Detached writes attempted that succeeded."), writeDuration: desc("_write_duration_seconds_total", - "Cumulative duration of completed detached writes. A mean when divided by writes_completed_total; read the tail from tegola_cache_tier_duration_seconds{sub_command=\"set\"} instead."), + "Cumulative duration of completed detached writes. A mean when divided by writes_completed_total; read the tail from shigola_cache_tier_duration_seconds{sub_command=\"set\"} instead."), promotions: desc("_promotions_total", "Tiles promoted into an earlier tier after a lower-tier hit."), promotionsDropped: desc("_promotions_dropped_total", "Promotions the write pool refused at admission."), @@ -122,5 +128,5 @@ func cacheCollectors(c cache.Interface) []observability.Collector { return nil } - return []observability.Collector{newCacheStatsCollector("shigola_cache", pool, chain)} + return []observability.Collector{newCacheStatsCollector(metricPrefix+"_cache", pool, chain)} } diff --git a/atlas/cache_multi_test.go b/atlas/cache_multi_test.go index 736b640e..609711d5 100644 --- a/atlas/cache_multi_test.go +++ b/atlas/cache_multi_test.go @@ -61,7 +61,7 @@ func TestMultiCacheEndToEnd(t *testing.T) { t.Fatalf("building the hot-tier lens: unexpected error: %v", err) } - // Write the durable tier only — what `tegola cache seed` does by default, + // Write the durable tier only — what `shigola cache seed` does by default, // including its synchronous writes. Without those the write is handed to // the detached pool and Set returns before anything has been written, which // is exactly why the CLI path sets the flag. diff --git a/atlas/cache_observability_test.go b/atlas/cache_observability_test.go index b85213ff..2390b515 100644 --- a/atlas/cache_observability_test.go +++ b/atlas/cache_observability_test.go @@ -13,6 +13,7 @@ import ( "github.com/MapColonies/shigola/internal/faketier" "github.com/MapColonies/shigola/observability" "github.com/MapColonies/shigola/observability/prometheus" + "github.com/MapColonies/shigola/provider" ) // The prometheus observer registers against prometheus.DefaultRegisterer, so @@ -428,3 +429,41 @@ func TestErrorsCounterIsPrefixed(t *testing.T) { t.Errorf("hot tier errors: got %v, expected 1", got) } } + +// collectingProvider is an MVT provider that publishes one gauge under +// whatever prefix the atlas hands it, so the test reads the prefix off the +// metric name an operator would actually scrape. +type collectingProvider struct { + provider.MVTTiler +} + +func (collectingProvider) Collectors(prefix string, _ func(string) map[string]interface{}) ([]observability.Collector, error) { + return []observability.Collector{ + promclient.NewGauge(promclient.GaugeOpts{Name: prefix + "_collecting_provider_up"}), + }, nil +} + +// TestProviderCollectorsArePrefixed pins provider metrics to the shigola_ +// prefix. They were the last family still published as tegola_*, because the +// prefix was a literal at the call site rather than the one the rest of the +// metrics use. +func TestProviderCollectorsArePrefixed(t *testing.T) { + m := NewWebMercatorMap("collecting") + m.SetMVTProvider("collecting", collectingProvider{}) + + a := &Atlas{} + a.AddMap(m) + a.SetObservability(newObserver(t)) + + families, err := promclient.DefaultGatherer.Gather() + if err != nil { + t.Fatalf("gather: %v", err) + } + + for _, family := range families { + if family.GetName() == "shigola_collecting_provider_up" { + return + } + } + t.Errorf("shigola_collecting_provider_up is not published") +} diff --git a/atlas/map.go b/atlas/map.go index 0f856fcb..f3b04523 100644 --- a/atlas/map.go +++ b/atlas/map.go @@ -31,7 +31,7 @@ func NewWebMercatorMap(name string) Map { } // DefaultTileGrid is the TileMatrixSet a Map carries when nothing else names -// one: WebMercatorQuad, the grid tegola has always served. +// one: WebMercatorQuad, the only grid Tegola ever served. // // WebMercatorQuad is bundled and active in every build, so a failure to resolve // it means the tms package's embedded definitions are broken — the same diff --git a/cache/cache.go b/cache/cache.go index 0547d9f8..6d6e933d 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -31,7 +31,7 @@ type Wrapped interface { // NamedTier pairs one tier of a composite cache with its name. // // Names are public API. They appear in the tier metric label and in -// `tegola cache seed --cache-tiers`, which means they end up in dashboards, +// `shigola cache seed --cache-tiers`, which means they end up in dashboards, // alerts and cron jobs — renaming a tier, or reordering layers such that a // derived collision suffix shifts, silently breaks both. type NamedTier struct { @@ -156,7 +156,7 @@ func WritePoolOf(c Interface) *WritePool { // // The decorators forward Tiered, but the observability wrapper does not — so a // caller that wants the tier list has to reach through it. Which callers do: -// `tegola cache seed` resolves --cache-tiers against the tree, and by then the +// `shigola cache seed` resolves --cache-tiers against the tree, and by then the // configured cache has already been instrumented. func TieredOf(c Interface) (Tiered, bool) { for c != nil { @@ -216,7 +216,7 @@ func InjectWritePool(c Interface, pool *WritePool) { // ParseKey will parse a string in the format /:map/:layer/:z/:x/:y into a Key struct. The :layer value is optional // ParseKey also supports other OS delimiters (i.e. Windows - "\") // -// The path carries no tileMatrixSetID — tegola's native routes do not name a +// The path carries no tileMatrixSetID — the z/x/y path form does not name a // grid — so the tile is read as a WebMercatorQuad one. Use ParseKeyForGrid when // the grid is known. func ParseKey(str string) (*Key, error) { @@ -232,7 +232,7 @@ func ParseKey(str string) (*Key, error) { // zoom, and record the grid on the returned Key. // // What it parses is a *request path* — ":map/:layer/:z/:x/:y", the map and layer -// optional — which names no grid, because tegola's native routes do not. The +// optional — which names no grid, because the z/x/y path form does not. The // grid comes from the caller, which knows it from the map being served. // // It deliberately does not parse what Key.String writes. That form leads with @@ -357,8 +357,8 @@ type Key struct { // path or redis key from String() — partitions by grid, and so that a purge // can address one grid's tiles as a subtree. // - // An unset value means WebMercatorQuad, the grid tegola served before this - // field existed. + // An unset value means WebMercatorQuad, the only grid Tegola served, and so + // the grid of every key written before this field existed. TileMatrixSetID string MapName string LayerName string diff --git a/cache/cache_test.go b/cache/cache_test.go index 72f346ed..29bf0ef7 100644 --- a/cache/cache_test.go +++ b/cache/cache_test.go @@ -104,7 +104,7 @@ func TestKeyStringPartitionsByGrid(t *testing.T) { t.Fatalf("keys collide across grids: %v", webMercator.String()) } - // An unset grid means the grid tegola served before the field existed. + // An unset grid means the grid every key had before the field existed. var legacy cache.Key = webMercator legacy.TileMatrixSetID = "" diff --git a/cache/context.go b/cache/context.go index 2b16a1b8..949e3ebf 100644 --- a/cache/context.go +++ b/cache/context.go @@ -27,7 +27,7 @@ const ( // WithoutPromotion suppresses read-through promotion for reads made with the // returned context. // -// `tegola cache seed` without --overwrite reads every tile through the cache +// `shigola cache seed` without --overwrite reads every tile through the cache // before deciding whether to generate it. With promotion on, a seed over a // large area would promote every durable-tier tile into the hot tier, in seed // order, at seeding throughput — overwriting the live working set with cold diff --git a/cache/detached.go b/cache/detached.go index 3f47aaac..72277e09 100644 --- a/cache/detached.go +++ b/cache/detached.go @@ -11,7 +11,7 @@ import "context" // // Applied once, at the top, and this is load-bearing. Detaching per tier would // make a composite Set return before any tier write, so its fan-out would have -// no errors to join and `tegola cache seed` would report success for writes it +// no errors to join and `shigola cache seed` would report success for writes it // never waited on. That is why a composite cache builds its children through // ForTier, which applies the deadline and never this. // @@ -66,7 +66,7 @@ func (d *detachedCache) Get(ctx context.Context, key *Key) ([]byte, bool, error) // written, attempted-and-failed, and dropped — where nothing was attempted and // nil is still returned. A caller that needs the write to have actually // happened sets WithSynchronousWrites; a caller that needs to know drops -// happened watches tegola_cache_writes_dropped_total. +// happened watches shigola_cache_writes_dropped_total. // // val is not copied. The write outlives this call, so a caller must not reuse // or mutate the buffer it passes — which is already true of every backend, all diff --git a/cache/export_test.go b/cache/export_test.go index 8cbb367b..d8d4e2f5 100644 --- a/cache/export_test.go +++ b/cache/export_test.go @@ -18,7 +18,7 @@ var ( ParseOptions = parseOptions ) -// WriteOptions returns the parsed TEGOLA_OPTIONS write-path switches. +// WriteOptions returns the parsed SHIGOLA_OPTIONS write-path switches. func WriteOptions() (slots int, timeout, drain time.Duration) { return detachedWriteSlots, detachedWriteTimeout, detachedWriteDrain } diff --git a/cache/file/file_test.go b/cache/file/file_test.go index c0e0df0f..df2a786c 100644 --- a/cache/file/file_test.go +++ b/cache/file/file_test.go @@ -46,33 +46,33 @@ func TestNew(t *testing.T) { tests := map[string]tcase{ "valid basepath": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", }, expected: &file.Cache{ - Basepath: "testfiles/tegola-cache", + Basepath: "testfiles/shigola-cache", MaxZoom: shigola.MaxZ, }, err: nil, }, "valid basepath and max zoom": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", "max_zoom": uint(9), }, expected: &file.Cache{ - Basepath: "testfiles/tegola-cache", + Basepath: "testfiles/shigola-cache", MaxZoom: 9, }, err: nil, }, "valid basepath, max zoom and ttl": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", "max_zoom": uint(9), "ttl": 9, }, expected: &file.Cache{ - Basepath: "testfiles/tegola-cache", + Basepath: "testfiles/shigola-cache", MaxZoom: 9, Expiration: time.Duration(9) * time.Second, }, @@ -85,7 +85,7 @@ func TestNew(t *testing.T) { }, "invalid zoom": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", "max_zoom": "foo", }, expected: nil, @@ -148,7 +148,7 @@ func TestSetGetPurge(t *testing.T) { tests := map[string]tcase{ "get set purge": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", }, key: cache.Key{ Z: 0, @@ -223,7 +223,7 @@ func TestSetOverwrite(t *testing.T) { tests := map[string]tcase{ "set overwrite": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", }, key: cache.Key{ Z: 0, @@ -290,7 +290,7 @@ func TestMaxZoom(t *testing.T) { tests := map[string]tcase{ "over max zoom": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", "max_zoom": uint(10), }, key: cache.Key{ @@ -303,7 +303,7 @@ func TestMaxZoom(t *testing.T) { }, "under max zoom": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", "max_zoom": uint(10), }, key: cache.Key{ @@ -316,7 +316,7 @@ func TestMaxZoom(t *testing.T) { }, "equals max zoom": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", "max_zoom": uint(10), }, key: cache.Key{ @@ -398,7 +398,7 @@ func TestExpiration(t *testing.T) { tests := map[string]tcase{ "get set purge": { config: map[string]any{ - "basepath": "testfiles/tegola-cache", + "basepath": "testfiles/shigola-cache", "ttl": 1, }, key: cache.Key{ diff --git a/cache/file/testfiles/tegola-cache/0/1/12 b/cache/file/testfiles/shigola-cache/0/1/12 similarity index 100% rename from cache/file/testfiles/tegola-cache/0/1/12 rename to cache/file/testfiles/shigola-cache/0/1/12 diff --git a/cache/multi/multi.go b/cache/multi/multi.go index 0c0e64d5..b5419a88 100644 --- a/cache/multi/multi.go +++ b/cache/multi/multi.go @@ -507,7 +507,7 @@ func TierNames(c cache.Interface) []string { // LastTierName returns the name of the last tier in read order — the durable // one by construction — recursing into a nested chain so the rule is "the last -// tier of the last tier". It is what `tegola cache seed` targets by default. +// tier of the last tier". It is what `shigola cache seed` targets by default. func LastTierName(c cache.Interface) (string, bool) { tiered, ok := cache.TieredOf(c) if !ok { diff --git a/cache/options.go b/cache/options.go index e7578c61..c06701f7 100644 --- a/cache/options.go +++ b/cache/options.go @@ -9,21 +9,21 @@ import ( "github.com/MapColonies/shigola/internal/log" ) -// The write path's three switches live in TEGOLA_OPTIONS rather than in the +// The write path's three switches live in SHIGOLA_OPTIONS rather than in the // [cache] table, because they are process resourcing and lifecycle rather than // cache configuration — and because each must be changeable during the incident // that reveals the need for it, without a config deploy. // -// TEGOLA_OPTIONS=DetachedWriteSlots=1024 # pool capacity; default 256 -// TEGOLA_OPTIONS=DetachedWriteTimeoutMs=10000 # bound on writes; default 10000, 0 disables -// TEGOLA_OPTIONS=DetachedWriteDrainMs=5000 # shutdown drain; default 5000, 0 disables +// SHIGOLA_OPTIONS=DetachedWriteSlots=1024 # pool capacity; default 256 +// SHIGOLA_OPTIONS=DetachedWriteTimeoutMs=10000 # bound on writes; default 10000, 0 disables +// SHIGOLA_OPTIONS=DetachedWriteDrainMs=5000 # shutdown drain; default 5000, 0 disables // // Integers throughout, and the milliseconds carry their unit in the key name // for a second reason beyond clarity: this parser's delimiter set is ",.\t \n", // so it splits on "." and a duration string like "1.5s" would silently truncate // to 1. // -// This is the only place TEGOLA_OPTIONS is read. It was not always: atlas +// This is the only place SHIGOLA_OPTIONS is read. It was not always: atlas // parsed its own switches out of the same variable until MAPCO-11491 retired // them with the Go-side encode path. Parsing lives here because this is the // package that owns the pool, and that reason outlives the other reader — @@ -99,7 +99,7 @@ func parseOptions(raw string) { } } -// optionDelimiters separates TEGOLA_OPTIONS entries. +// optionDelimiters separates SHIGOLA_OPTIONS entries. // // Deliberately *not* the set atlas uses for SimplifyMaxZoom, which also splits // on ".". Splitting on "." makes `DetachedWriteTimeoutMs=1.5s` read as the @@ -108,7 +108,7 @@ func parseOptions(raw string) { // makes Atoi fail, and a failed parse falls back to the safe default. const optionDelimiters = ",\t \n" -// optionInt reads `key=` out of a lowercased TEGOLA_OPTIONS string. +// optionInt reads `key=` out of a lowercased SHIGOLA_OPTIONS string. func optionInt(options, key string) (int, bool) { idx := strings.Index(options, key+"=") if idx == -1 { diff --git a/cache/redis/redis.go b/cache/redis/redis.go index 57a77b25..ff722823 100644 --- a/cache/redis/redis.go +++ b/cache/redis/redis.go @@ -188,8 +188,8 @@ type RedisCache struct { // byte-for-byte the keys this cache wrote before the option existed. // // It is concatenated, not path-joined, so redis' own ':' namespacing works - // as written — and so the separator is the operator's to supply: "tegola:" - // gives "tegola:map/layer/z/x/y" where "tegola" gives "tegolamap/layer/z/x/y". + // as written — and so the separator is the operator's to supply: "shigola:" + // gives "shigola:map/layer/z/x/y" where "shigola" gives "shigolamap/layer/z/x/y". KeyPrefix string } diff --git a/cache/redis/redis_test.go b/cache/redis/redis_test.go index 146b77cc..4a1ad9f5 100644 --- a/cache/redis/redis_test.go +++ b/cache/redis/redis_test.go @@ -373,41 +373,41 @@ func TestRedisKey(t *testing.T) { expected: "WebMercatorQuad/osm/water/10/511/340", }, "colon separated prefix": { - keyPrefix: "tegola:", + keyPrefix: "shigola:", key: key, - expected: "tegola:WebMercatorQuad/osm/water/10/511/340", + expected: "shigola:WebMercatorQuad/osm/water/10/511/340", }, // The documented sharp edge of concatenating rather than path-joining: a // prefix without a separator runs into the grid id. Pinned so it cannot // change silently. "prefix without a separator": { - keyPrefix: "tegola", + keyPrefix: "shigola", key: key, - expected: "tegolaWebMercatorQuad/osm/water/10/511/340", + expected: "shigolaWebMercatorQuad/osm/water/10/511/340", }, // filepath.Join would collapse the doubled slash here. Concatenation does // not touch the prefix, which is what lets ':' namespacing survive. "prefix is passed through verbatim": { - keyPrefix: "tegola//", + keyPrefix: "shigola//", key: key, - expected: "tegola//WebMercatorQuad/osm/water/10/511/340", + expected: "shigola//WebMercatorQuad/osm/water/10/511/340", }, "prefix on a key with no map or layer": { - keyPrefix: "tegola:", + keyPrefix: "shigola:", key: cache.Key{Z: 0, X: 1, Y: 2}, - expected: "tegola:WebMercatorQuad/0/1/2", + expected: "shigola:WebMercatorQuad/0/1/2", }, // The grid partitions the redis keyspace under the same prefix, so a // shared redis cannot serve one grid's tiles for another (ADR-0007). "another grid, same prefix and tile": { - keyPrefix: "tegola:", + keyPrefix: "shigola:", key: cache.Key{ TileMatrixSetID: tms.WorldCRS84Quad, MapName: "osm", LayerName: "water", Z: 10, X: 511, Y: 340, }, - expected: "tegola:WorldCRS84Quad/osm/water/10/511/340", + expected: "shigola:WorldCRS84Quad/osm/water/10/511/340", }, } @@ -489,7 +489,7 @@ func TestNew(t *testing.T) { }, "explicit config with key_prefix": { config: map[string]any{ - "key_prefix": "tegola:", + "key_prefix": "shigola:", }, }, "bad config address": { @@ -819,7 +819,7 @@ func TestMaxZoom(t *testing.T) { // TestKeyPrefix checks the property TestRedisKey cannot: that the prefix reaches // the wire on all three operations. A prefix honoured by Set but not Purge would -// leave keys no tegola can delete, and one honoured by Set but not Get would miss +// leave keys no shigola can delete, and one honoured by Set but not Get would miss // everything it wrote — both pass a round-trip test that only talks to itself, so // this one reads the raw key with a client of its own. func TestKeyPrefix(t *testing.T) { @@ -827,7 +827,7 @@ func TestKeyPrefix(t *testing.T) { ctx := context.Background() - const keyPrefix = "tegola-prefix-test:" + const keyPrefix = "shigola-prefix-test:" key := cache.Key{MapName: "prefixtest", LayerName: "water", Z: 4, X: 2, Y: 3} val := []byte("\x53\x69\x6c\x61\x73") diff --git a/cache/writepool.go b/cache/writepool.go index 155121c6..1ed7d3b3 100644 --- a/cache/writepool.go +++ b/cache/writepool.go @@ -59,7 +59,7 @@ type WritePoolStats struct { // acquisition rather than the write. // // A mean, not a distribution. Read the *tail* from the per-tier histogram - // tegola_cache_tier_duration_seconds{sub_command="set"} instead: the tail + // shigola_cache_tier_duration_seconds{sub_command="set"} instead: the tail // is what holds slots long enough to exhaust the pool, and this hides it. WriteNanos uint64 } @@ -223,7 +223,7 @@ func (p *WritePool) warnSaturated() { log.Warnf( "cache: detached write pool saturated at %v slots, dropping writes (%v further drops suppressed since the last warning). "+ - "raise TEGOLA_OPTIONS=DetachedWriteSlots, or find why writes are slow", + "raise SHIGOLA_OPTIONS=DetachedWriteSlots, or find why writes are slow", p.capacity, p.warnSkip, ) @@ -290,7 +290,7 @@ func (p *WritePool) Drain(deadline time.Duration) { } log.Warnf( "cache: detached write pool drain expired after %v with %v writes still in flight, abandoning them. "+ - "raise TEGOLA_OPTIONS=DetachedWriteDrainMs, or fix a slow durable tier", + "raise SHIGOLA_OPTIONS=DetachedWriteDrainMs, or fix a slow durable tier", deadline, remaining, ) } diff --git a/cmd/shigola/.gitignore b/cmd/shigola/.gitignore index ae6da4d4..a21566bb 100644 --- a/cmd/shigola/.gitignore +++ b/cmd/shigola/.gitignore @@ -1,5 +1,5 @@ *.toml -tegola +shigola static/debug static/landuse2 *.log diff --git a/cmd/shigola/cmd/cache/cache_tiers_test.go b/cmd/shigola/cmd/cache/cache_tiers_test.go index 313f9d46..4238eeab 100644 --- a/cmd/shigola/cmd/cache/cache_tiers_test.go +++ b/cmd/shigola/cmd/cache/cache_tiers_test.go @@ -6,7 +6,7 @@ import ( "reflect" "testing" - tegolaCache "github.com/MapColonies/shigola/cache" + shigolaCache "github.com/MapColonies/shigola/cache" "github.com/MapColonies/shigola/cache/multi" "github.com/MapColonies/shigola/dict" "github.com/MapColonies/shigola/internal/faketier" @@ -14,7 +14,7 @@ import ( _ "github.com/MapColonies/shigola/atlas" ) -var tiersKey = &tegolaCache.Key{MapName: "osm", Z: 7, X: 6, Y: 5} +var tiersKey = &shigolaCache.Key{MapName: "osm", Z: 7, X: 6, Y: 5} func init() { for cacheType, name := range map[string]string{ @@ -23,7 +23,7 @@ func init() { "clisolo": "solo", } { tier := faketier.New(name) - if err := tegolaCache.Register(cacheType, func(dict.Dicter) (tegolaCache.Interface, error) { + if err := shigolaCache.Register(cacheType, func(dict.Dicter) (shigolaCache.Interface, error) { return tier, nil }); err != nil { panic(err) @@ -31,10 +31,10 @@ func init() { } } -func twoTierCache(t *testing.T) tegolaCache.Interface { +func twoTierCache(t *testing.T) shigolaCache.Interface { t.Helper() - c, err := tegolaCache.For("multi", dict.Dict{ + c, err := shigolaCache.For("multi", dict.Dict{ "layers": []map[string]interface{}{ {"type": "clihot", "name": "hot"}, {"type": "clidurable", "name": "durable"}, @@ -49,7 +49,7 @@ func twoTierCache(t *testing.T) tegolaCache.Interface { // TestResolveCacheTiers covers what a seed run is allowed to write, which is // the behaviour most likely to surprise: adding a tier to an existing chain -// config changes what `tegola cache seed` writes. +// config changes what `shigola cache seed` writes. func TestResolveCacheTiers(t *testing.T) { type tcase struct { flag string @@ -105,7 +105,7 @@ func TestResolveCacheTiers(t *testing.T) { // there is nothing to restrict and the seed default is unchanged for every // deployment that is not using a chain. func TestResolveCacheTiersSingleBackend(t *testing.T) { - c, err := tegolaCache.For("clisolo", dict.Dict{}) + c, err := shigolaCache.For("clisolo", dict.Dict{}) if err != nil { t.Fatalf("building the cache: %v", err) } @@ -129,7 +129,7 @@ func TestResolveCacheTiersSingleBackend(t *testing.T) { // TestResolveCacheTiersNested — resolution runs against the whole tree, and the // default recurses: the last tier of the last tier. func TestResolveCacheTiersNested(t *testing.T) { - c, err := tegolaCache.For("multi", dict.Dict{ + c, err := shigolaCache.For("multi", dict.Dict{ "layers": []map[string]interface{}{ {"type": "clihot", "name": "hot"}, {"type": "multi", "name": "nested", "layers": []map[string]interface{}{ @@ -191,14 +191,14 @@ func TestWorkerContextCarriesEveryIntent(t *testing.T) { // These two are unconditional. Without synchronous writes the seed // loses writes at process exit; without promotion suppression its // own reads flood the hot tier. - if !tegolaCache.SynchronousWrites(got) { + if !shigolaCache.SynchronousWrites(got) { t.Error("the seed context does not carry WithSynchronousWrites") } - if !tegolaCache.PromotionDisabled(got) { + if !shigolaCache.PromotionDisabled(got) { t.Error("the seed context does not carry WithoutPromotion") } - names, restricted := tegolaCache.WriteTiers(got) + names, restricted := shigolaCache.WriteTiers(got) if restricted != tc.expectedRestricted { t.Errorf("write tiers restricted: got %v, expected %v", restricted, tc.expectedRestricted) } @@ -206,9 +206,9 @@ func TestWorkerContextCarriesEveryIntent(t *testing.T) { t.Errorf("write tiers: got %v, expected %v", names, tc.expectedTiers) } - if tegolaCache.InvalidateUnwritten(got) != tc.expectedInvalidate { + if shigolaCache.InvalidateUnwritten(got) != tc.expectedInvalidate { t.Errorf("invalidate unwritten: got %v, expected %v", - tegolaCache.InvalidateUnwritten(got), tc.expectedInvalidate) + shigolaCache.InvalidateUnwritten(got), tc.expectedInvalidate) } } } @@ -243,7 +243,7 @@ func TestSeedSemanticsEndToEnd(t *testing.T) { hot := faketier.NewWithRecorder("hot", rec) durable := faketier.NewWithRecorder("durable", rec) - chain, err := multi.NewChain([]tegolaCache.NamedTier{ + chain, err := multi.NewChain([]shigolaCache.NamedTier{ {Name: "hot", Cache: hot}, {Name: "durable", Cache: durable}, }, true, nil) diff --git a/cmd/shigola/cmd/cache/seed_purge.go b/cmd/shigola/cmd/cache/seed_purge.go index 5b1f66a7..ce3d49d3 100644 --- a/cmd/shigola/cmd/cache/seed_purge.go +++ b/cmd/shigola/cmd/cache/seed_purge.go @@ -222,8 +222,8 @@ func validateTileInGrid(tile slippy.Tile, grid *tms.TileMatrixSet) error { // writes them under. // // --tile-matrix-set wins. Without it, a run scoped to one map takes the first -// scheme that map lists, and a run over every map takes WebMercatorQuad — what -// tegola seeded before the grid was configurable. +// scheme that map lists, and a run over every map takes WebMercatorQuad — the only +// grid Tegola could seed. // // That first entry is this command's convention, not a property of the map: the // server reads no default off the list (see atlas.Map.TileMatrixSets), so there @@ -253,7 +253,7 @@ func resolveSeedPurgeGrid() (*tms.TileMatrixSet, error) { } // Every other run — over all maps, or over a map that lists none — takes - // WebMercatorQuad, what tegola seeded before the grid was configurable. + // WebMercatorQuad, the only grid Tegola could seed. if id == "" { id = tms.WebMercatorQuad chosenBy = "the default for a run not scoped to one map with --map" diff --git a/cmd/shigola/cmd/cache/worker.go b/cmd/shigola/cmd/cache/worker.go index 0dc2f1c4..9575ce00 100644 --- a/cmd/shigola/cmd/cache/worker.go +++ b/cmd/shigola/cmd/cache/worker.go @@ -35,7 +35,7 @@ func (s seedPurgeWorkerTileError) Error() string { // path a cache write is handed to a detached pool and the handler returns; here // there is no response to protect, and the process exits as soon as the last // tile is generated — so a detached write would be dropped or abandoned at exit -// and `tegola cache seed` would exit 0 having populated an unknown fraction of +// and `shigola cache seed` would exit 0 having populated an unknown fraction of // what it reported. It also restores the error path strict Set exists for: // written inline, a joined tier error reaches the worker, which marks the tile // failed. diff --git a/cmd/shigola/cmd/server.go b/cmd/shigola/cmd/server.go index fd5b97bb..ea27d392 100644 --- a/cmd/shigola/cmd/server.go +++ b/cmd/shigola/cmd/server.go @@ -30,7 +30,7 @@ var serverCmd = &cobra.Command{ Use: "serve", Short: "Use shigola as a tile server", Aliases: []string{"server"}, - Long: `Use tegola as a vector tile server. Maps tiles will be served at /maps/:map_name/:z/:x/:y`, + Long: `Use shigola as a vector tile server. Tiles are served as OGC API - Tiles, with the landing page at /`, Run: func(cmd *cobra.Command, args []string) { gdcmd.New() gdcmd.OnComplete(provider.Cleanup) diff --git a/cmd/shigola/cmd/version.go b/cmd/shigola/cmd/version.go index d4d294f7..227ac187 100644 --- a/cmd/shigola/cmd/version.go +++ b/cmd/shigola/cmd/version.go @@ -10,7 +10,7 @@ import ( var versionCmd = &cobra.Command{ Use: "version", Short: "Print the version number of shigola", - Long: `All software has versions, so in order for tegola to be considered software...`, + Long: `All software has versions, so in order for shigola to be considered software...`, Run: func(cmd *cobra.Command, args []string) { fmt.Printf(" version: %s\n", build.Version) fmt.Printf(" git: %s @ %v\n", build.GitBranch, build.GitRevision) diff --git a/cmd/shigola/pprof.go b/cmd/shigola/pprof.go index eec1f1e2..a5a9ee7b 100644 --- a/cmd/shigola/pprof.go +++ b/cmd/shigola/pprof.go @@ -4,9 +4,9 @@ package main // The point of this file is to load the Go profiler. -// You need to compile Tegola with `go build -tags 'pprof'` and you need to -// enabled it by setting the TEGOLA_HTTP_PPROF_BIND environment to a -// hostname:port combination (e.g. TEGOLA_HTTP_PPROF_BIND=localhost:6060). +// You need to compile Shigola with `go build -tags 'pprof'` and you need to +// enabled it by setting the SHIGOLA_HTTP_PPROF_BIND environment to a +// hostname:port combination (e.g. SHIGOLA_HTTP_PPROF_BIND=localhost:6060). // To show 30s CPU profile: // % go tool pprof -web http://localhost:6060/debug/pprof/profile diff --git a/cmd/shigola_lambda/main.go b/cmd/shigola_lambda/main.go index 515de5a7..94d10d67 100644 --- a/cmd/shigola_lambda/main.go +++ b/cmd/shigola_lambda/main.go @@ -48,7 +48,7 @@ func init() { confLocation := DefaultConfLocation - // check if the env TEGOLA_CONFIG is set + // check if the env SHIGOLA_CONFIG is set if env.Getenv("CONFIG") != "" { confLocation = env.Getenv("CONFIG") } diff --git a/config/config.go b/config/config.go index 166b619d..7a17e65b 100644 --- a/config/config.go +++ b/config/config.go @@ -1,4 +1,4 @@ -// Package config loads and understands the tegola config format. +// Package config loads and understands the shigola config format. package config import ( @@ -83,7 +83,7 @@ var ReservedTokens = map[string]struct{}{ var blacklistHeaders = []string{"content-encoding", "content-length", "content-type"} -// Config represents a tegola config file. +// Config represents a shigola config file. type Config struct { // the tile buffer to use TileBuffer *env.Int `toml:"tile_buffer"` @@ -108,7 +108,7 @@ type Config struct { Maps []provider.Map `toml:"maps"` } -// Webserver represents the config options for the webserver part of Tegola +// Webserver represents the config options for the webserver part of Shigola type Webserver struct { HostName env.URL `toml:"hostname"` Port env.String `toml:"port"` @@ -412,7 +412,7 @@ func (c *Config) ConfigureTileBuffers() { } } -// Parse will parse the Tegola config file provided by the io.Reader. +// Parse will parse the Shigola config file provided by the io.Reader. func Parse(reader io.Reader, location string) (conf Config, err error) { // Read whole, so a failed decode can be told apart from a syntax error. data, err := io.ReadAll(reader) diff --git a/config/config_cache_layers_test.go b/config/config_cache_layers_test.go index 27375943..2e19f416 100644 --- a/config/config_cache_layers_test.go +++ b/config/config_cache_layers_test.go @@ -38,7 +38,7 @@ type = "multi" [[cache.layers.layers]] type = "file" - basepath = "/tmp/tegola" + basepath = "/tmp/shigola" ` t.Setenv("TEST_REDIS_PASSWORD", "hunter2") @@ -89,7 +89,7 @@ type = "multi" // time, so it still fires two levels of array-of-table down. assertString(t, nested[0], "bucket", "tiles-from-the-environment") assertString(t, nested[1], "type", "file") - assertString(t, nested[1], "basepath", "/tmp/tegola") + assertString(t, nested[1], "basepath", "/tmp/shigola") } // TestCacheLayersSiblingsAreNotNesting pins the trap next to the feature: an diff --git a/config/config_test.go b/config/config_test.go index 2823705f..0cac1eaf 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -25,8 +25,8 @@ const ( ENV_TEST_CENTER_Y = 39.153492567373 ENV_TEST_CENTER_Z = 8.0 ENV_TEST_HOST_1 = "cdn" - ENV_TEST_HOST_2 = "tegola" - ENV_TEST_HOST_3 = "io" + ENV_TEST_HOST_2 = "example" + ENV_TEST_HOST_3 = "com" ENV_TEST_HOST_CONCAT = ENV_TEST_HOST_1 + "." + ENV_TEST_HOST_2 + "." + ENV_TEST_HOST_3 ENV_TEST_WEBSERVER_HEADER_STRING = "s-maxage=10" ENV_TEST_WEBSERVER_PORT = "1234" @@ -118,7 +118,7 @@ func TestParse(t *testing.T) { Webserver: config.Webserver{ HostName: env.URL{ Scheme: "https", - Host: "cdn.tegola.io", + Host: "cdn.example.com", }, Port: ":8080", ProxyProtocol: "https", @@ -129,7 +129,7 @@ func TestParse(t *testing.T) { }, Cache: env.Dict{ "type": "file", - "basepath": "/tmp/tegola-cache", + "basepath": "/tmp/shigola-cache", }, Providers: []env.Dict{ { diff --git a/config/testdata/happy_path.toml b/config/testdata/happy_path.toml index 91cdcef3..23e64c1d 100644 --- a/config/testdata/happy_path.toml +++ b/config/testdata/happy_path.toml @@ -1,9 +1,9 @@ tile_buffer = 12 [webserver] -hostname = "https://cdn.tegola.io" +hostname = "https://cdn.example.com" port = ":8080" -cors_allowed_origin = "tegola.io" +cors_allowed_origin = "example.com" proxy_protocol = "https" [webserver.headers] @@ -12,7 +12,7 @@ proxy_protocol = "https" [cache] type = "file" -basepath = "/tmp/tegola-cache" +basepath = "/tmp/shigola-cache" [[providers]] name = "provider1" diff --git a/docker-compose.yml b/docker-compose.yml index 9d1d7ef4..b54e25b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,7 +42,7 @@ services: # image: dpage/pgadmin4 # container_name: pgadmin # environment: - # PGADMIN_DEFAULT_EMAIL: "admin@tegola.io" + # PGADMIN_DEFAULT_EMAIL: "admin@example.com" # PGADMIN_DEFAULT_PASSWORD: "admin" # ports: # - "5555:80" diff --git a/internal/env/parse_test.go b/internal/env/parse_test.go index cc21dcaa..ed6ca06a 100644 --- a/internal/env/parse_test.go +++ b/internal/env/parse_test.go @@ -46,15 +46,15 @@ func TestParseURL(t *testing.T) { tests := map[string]tcase{ "happy path": { - in: "https://go-spatial.org/tegola", + in: "https://example.com/shigola", expected: &url.URL{ Scheme: "https", - Host: "go-spatial.org", - Path: "/tegola", + Host: "example.com", + Path: "/shigola", }, }, "invalid url escape": { - in: "https://go-spatial.org/tegola/_20_%+off_60000_", + in: "https://example.com/shigola/_20_%+off_60000_", expectedErr: url.EscapeError(""), }, "nil": { diff --git a/internal/env/types_test.go b/internal/env/types_test.go index 66e1082c..ba30d1a3 100644 --- a/internal/env/types_test.go +++ b/internal/env/types_test.go @@ -46,15 +46,15 @@ func TestURLUnmarshalTOML(t *testing.T) { tests := map[string]tcase{ "happy path": { - in: "https://go-spatial.org/tegola", + in: "https://example.com/shigola", expected: env.URL{ Scheme: "https", - Host: "go-spatial.org", - Path: "/tegola", + Host: "example.com", + Path: "/shigola", }, }, "invalid url escape": { - in: "https://go-spatial.org/tegola/_20_%+off_60000_", + in: "https://example.com/shigola/_20_%+off_60000_", expectedErr: url.EscapeError(""), }, "nil": { diff --git a/internal/log/README.md b/internal/log/README.md index f728200f..671e817e 100644 --- a/internal/log/README.md +++ b/internal/log/README.md @@ -58,7 +58,7 @@ slog.SetDefault(log.New(os.Stderr, lvl, build.Version, build.GitRevision)) ## Logging Anything that can use slog directly should. The package-level helpers exist for -the call sites inherited from tegola, and log through `slog.Default()`: +the call sites inherited from Tegola, and log through `slog.Default()`: | Helpers | Message | |:---|:---| diff --git a/mapbox/tilejson/tilejson.go b/mapbox/tilejson/tilejson.go index cf6e78bb..9bfe9366 100644 --- a/mapbox/tilejson/tilejson.go +++ b/mapbox/tilejson/tilejson.go @@ -141,6 +141,6 @@ type VectorLayer struct { // OPTIONAL. Default: 22. >= 0, <= 22. // A positive integer specifying the maximum zoom level. MUST be >= minzoom. MaxZoom uint `json:"maxzoom"` - // Tegola supports individual layer tiles. + // Shigola supports individual layer tiles. Tiles []string `json:"tiles"` } diff --git a/observability/grafana/README.md b/observability/grafana/README.md index 4c0b5cf1..90f82cec 100644 --- a/observability/grafana/README.md +++ b/observability/grafana/README.md @@ -38,11 +38,3 @@ default of each type on import; change them in the dashboard's variable row. - **Layers are keyed `:`**, matching the OGC collection id, because `layer_name` alone is ambiguous once more than one map is served. A whole-map tile carries no layer and renders as the bare ``. - -## `$provider_prefix` - -The PostGIS provider collectors are still registered under the `tegola_` prefix — -`atlas.SetObservability` passes a hardcoded `"tegola"` to `Map.Collectors`, so -`postgres_*` and `*_provider_sql_query_seconds` did not get renamed with the rest. -The Providers row queries `${provider_prefix}_...`; the variable defaults to -`tegola`. Set it to `shigola` once that is fixed. diff --git a/observability/grafana/shigola-metrics.json b/observability/grafana/shigola-metrics.json index 39858297..caa2365d 100644 --- a/observability/grafana/shigola-metrics.json +++ b/observability/grafana/shigola-metrics.json @@ -99,19 +99,6 @@ "hide": 0, "sort": 1, "options": [] - }, - { - "type": "constant", - "name": "provider_prefix", - "label": "Provider metric prefix", - "query": "tegola", - "current": { - "text": "tegola", - "value": "tegola" - }, - "hide": 0, - "skipUrlSync": false, - "description": "Provider/postgres metrics are still emitted as tegola_* — atlas.go:406 hardcodes the prefix. Set to shigola once fixed." } ] }, @@ -3501,7 +3488,6 @@ "type": "row", "title": "Providers & Postgres", "collapsed": false, - "description": "NOTE: these still carry the tegola_ prefix — atlas.go passes a hardcoded \"tegola\" as the provider collector prefix. Change $provider_prefix once that is fixed.", "gridPos": { "h": 1, "w": 24, @@ -3595,7 +3581,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "histogram_quantile(0.5, sum by (le) (rate(${provider_prefix}_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", + "expr": "histogram_quantile(0.5, sum by (le) (rate(shigola_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", "legendFormat": "p50", "range": true, "refId": "A" @@ -3606,7 +3592,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "histogram_quantile(0.95, sum by (le) (rate(${provider_prefix}_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", + "expr": "histogram_quantile(0.95, sum by (le) (rate(shigola_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", "legendFormat": "p95", "range": true, "refId": "B" @@ -3617,7 +3603,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "histogram_quantile(0.99, sum by (le) (rate(${provider_prefix}_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", + "expr": "histogram_quantile(0.99, sum by (le) (rate(shigola_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", "legendFormat": "p99", "range": true, "refId": "C" @@ -3709,7 +3695,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "sum by (provider_name) (rate(${provider_prefix}_mvt_provider_sql_query_seconds_count{map_name=~\"$map\"}[$__rate_interval]))", + "expr": "sum by (provider_name) (rate(shigola_mvt_provider_sql_query_seconds_count{map_name=~\"$map\"}[$__rate_interval]))", "legendFormat": "mvt {{provider_name}}", "range": true, "refId": "A" @@ -3720,7 +3706,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "sum by (provider_name) (rate(${provider_prefix}_provider_sql_query_seconds_count{map_name=~\"$map\"}[$__rate_interval]))", + "expr": "sum by (provider_name) (rate(shigola_provider_sql_query_seconds_count{map_name=~\"$map\"}[$__rate_interval]))", "legendFormat": "std {{provider_name}}", "range": true, "refId": "B" @@ -3812,7 +3798,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "histogram_quantile(0.99, sum by (le, z) (rate(${provider_prefix}_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", + "expr": "histogram_quantile(0.99, sum by (le, z) (rate(shigola_mvt_provider_sql_query_seconds_bucket{map_name=~\"$map\"}[$__rate_interval])))", "legendFormat": "z{{z}}", "range": true, "refId": "A" @@ -3904,7 +3890,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "sum by (provider_name) (${provider_prefix}_postgres_current_connections)", + "expr": "sum by (provider_name) (shigola_postgres_current_connections)", "legendFormat": "current {{provider_name}}", "range": true, "refId": "A" @@ -3915,7 +3901,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "sum by (provider_name) (${provider_prefix}_postgres_available_connections)", + "expr": "sum by (provider_name) (shigola_postgres_available_connections)", "legendFormat": "available {{provider_name}}", "range": true, "refId": "B" @@ -3926,7 +3912,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "sum by (provider_name) (${provider_prefix}_postgres_max_connections)", + "expr": "sum by (provider_name) (shigola_postgres_max_connections)", "legendFormat": "max {{provider_name}}", "range": true, "refId": "C" @@ -4020,7 +4006,7 @@ "uid": "${ds_prom}" }, "editorMode": "code", - "expr": "sum(${provider_prefix}_postgres_current_connections) / clamp_min(sum(${provider_prefix}_postgres_max_connections), 1)", + "expr": "sum(shigola_postgres_current_connections) / clamp_min(sum(shigola_postgres_max_connections), 1)", "legendFormat": "pool usage", "range": true, "refId": "A" diff --git a/observability/observability.go b/observability/observability.go index 86ecd51b..233a5c82 100644 --- a/observability/observability.go +++ b/observability/observability.go @@ -6,7 +6,7 @@ import ( "github.com/prometheus/client_golang/prometheus" - tegolaCache "github.com/MapColonies/shigola/cache" + shigolaCache "github.com/MapColonies/shigola/cache" "github.com/MapColonies/shigola/dict" "github.com/MapColonies/shigola/internal/log" @@ -73,7 +73,7 @@ type APIObserver interface { } type CacheObserver interface { - InstrumentedCache(cacheObject tegolaCache.Interface) tegolaCache.Interface + InstrumentedCache(cacheObject shigolaCache.Interface) shigolaCache.Interface } // TieredCacheObserver instruments one tier of a composite cache, labelled by @@ -90,12 +90,12 @@ type CacheObserver interface { // and registering the same metric name once with a tier label and once without // is a label-dimension mismatch, which prometheus turns into a startup panic. type TieredCacheObserver interface { - InstrumentedTierCache(tier string, cacheObject tegolaCache.Interface) tegolaCache.Interface + InstrumentedTierCache(tier string, cacheObject shigolaCache.Interface) shigolaCache.Interface } type Cache interface { - tegolaCache.Interface - tegolaCache.Wrapped + shigolaCache.Interface + shigolaCache.Wrapped IsObserver() bool } diff --git a/observability/prometheus/build_info.go b/observability/prometheus/build_info.go index e86b2177..87e5f329 100644 --- a/observability/prometheus/build_info.go +++ b/observability/prometheus/build_info.go @@ -21,7 +21,7 @@ func NewBuildInfo(registry prometheus.Registerer) { Help: "Build information", }, []string{ - // command is the command line; e.g. tegola serve + // command is the command line; e.g. shigola serve "command", // version is the version string "version", diff --git a/observability/prometheus/cache.go b/observability/prometheus/cache.go index a3a1aab2..5d1bbdb1 100644 --- a/observability/prometheus/cache.go +++ b/observability/prometheus/cache.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - tegolaCache "github.com/MapColonies/shigola/cache" + shigolaCache "github.com/MapColonies/shigola/cache" "github.com/MapColonies/shigola/observability" "github.com/prometheus/client_golang/prometheus" ) @@ -49,7 +49,7 @@ var ( type cache struct { observeVars []string - cache tegolaCache.Interface + cache shigolaCache.Interface hitsCounter *prometheus.CounterVec missesCounter *prometheus.CounterVec inFlightGauge prometheus.Gauge @@ -83,7 +83,7 @@ func registerOrReuse[T prometheus.Collector](registry prometheus.Registerer, c T panic(err) } -func newCache(registry prometheus.Registerer, prefix string, observeVars []string, subCache tegolaCache.Interface) *cache { +func newCache(registry prometheus.Registerer, prefix string, observeVars []string, subCache shigolaCache.Interface) *cache { var c = cache{ observeVars: observeVars, cache: subCache, @@ -172,7 +172,7 @@ func (co *cache) labelNames() (names []string) { } // labels returns prometheus.Labels based on the configured observeVars -func (co *cache) labels(cmd string, key *tegolaCache.Key) (lbs prometheus.Labels) { +func (co *cache) labels(cmd string, key *shigolaCache.Key) (lbs prometheus.Labels) { lbs = make(prometheus.Labels) for _, keyName := range co.observeVars { switch keyName { @@ -193,7 +193,7 @@ func (co *cache) labels(cmd string, key *tegolaCache.Key) (lbs prometheus.Labels } // Get will record metrics around the getting the tile from the sub cache -func (co *cache) Get(ctx context.Context, key *tegolaCache.Key) ([]byte, bool, error) { +func (co *cache) Get(ctx context.Context, key *shigolaCache.Key) ([]byte, bool, error) { co.inFlightGauge.Inc() lbs := co.labels("get", key) now := time.Now() @@ -230,7 +230,7 @@ func (co *cache) Get(ctx context.Context, key *tegolaCache.Key) ([]byte, bool, e // Only a deadline the cache derived itself is a cache fault, and it says so by // returning the typed error. func (co *cache) countReadError(ctx context.Context, lbs prometheus.Labels, err error) { - var tierTimeout tegolaCache.ErrTierTimeout + var tierTimeout shigolaCache.ErrTierTimeout if errors.As(err, &tierTimeout) { co.errors.With(lbs).Add(1) co.readTimeouts.With(lbs).Add(1) @@ -245,7 +245,7 @@ func (co *cache) countReadError(ctx context.Context, lbs prometheus.Labels, err } // Set will observe metrics around setting the tile via the sub cache. -func (co *cache) Set(ctx context.Context, key *tegolaCache.Key, body []byte) error { +func (co *cache) Set(ctx context.Context, key *shigolaCache.Key, body []byte) error { co.inFlightGauge.Inc() lbs := co.labels("set", key) now := time.Now() @@ -262,7 +262,7 @@ func (co *cache) Set(ctx context.Context, key *tegolaCache.Key, body []byte) err } // Purge will record the metrics around purging the tile from the sub cache. -func (co *cache) Purge(ctx context.Context, key *tegolaCache.Key) error { +func (co *cache) Purge(ctx context.Context, key *shigolaCache.Key) error { co.inFlightGauge.Inc() lbs := co.labels("purge", key) now := time.Now() @@ -280,10 +280,10 @@ func (co *cache) Purge(ctx context.Context, key *tegolaCache.Key) error { // instrumented cache instead of instrumenting it a second time. The method was // named Wrapped() until 2026-08-10, which no interface required and nothing // called, so the assertion below is the whole point of the rename. -func (co cache) Original() tegolaCache.Interface { return co.cache } -func (co cache) IsObserver() bool { return true } +func (co cache) Original() shigolaCache.Interface { return co.cache } +func (co cache) IsObserver() bool { return true } var ( - _ observability.Cache = (*cache)(nil) - _ tegolaCache.Wrapped = (*cache)(nil) + _ observability.Cache = (*cache)(nil) + _ shigolaCache.Wrapped = (*cache)(nil) ) diff --git a/observability/prometheus/prometheus.go b/observability/prometheus/prometheus.go index 78fd155b..ecba629f 100644 --- a/observability/prometheus/prometheus.go +++ b/observability/prometheus/prometheus.go @@ -13,7 +13,7 @@ import ( "github.com/MapColonies/shigola/internal/p" - tegolaCache "github.com/MapColonies/shigola/cache" + shigolaCache "github.com/MapColonies/shigola/cache" "github.com/MapColonies/shigola/dict" "github.com/MapColonies/shigola/internal/log" "github.com/MapColonies/shigola/observability" @@ -245,7 +245,7 @@ func (obs *observer) InstrumentedAPIHttpHandler(method, route string, next http. return handler.InstrumentedHttpHandler(method, route, next) } -func (obs *observer) InstrumentedCache(cacheObject tegolaCache.Interface) tegolaCache.Interface { +func (obs *observer) InstrumentedCache(cacheObject shigolaCache.Interface) shigolaCache.Interface { if obs == nil { // if we are nil assume no metrics recording is going to happen return cacheObject @@ -262,15 +262,15 @@ func (obs *observer) InstrumentedCache(cacheObject tegolaCache.Interface) tegola // const label *names* feed dimHash, and the registry rejects a second // descriptor with the same fully-qualified name and a different dimHash — // through MustRegister, which panics rather than returning. Registering -// tegola_cache_hits_total once without a tier label and once with one would +// shigola_cache_hits_total once without a tier label and once with one would // therefore fail at startup on the first chain deployment with an observer // configured. // // And they count different things. A whole-cache hit is one tile served from // somewhere in the chain; tier hits are per-tier lookups, several per request. -// sum(tegola_cache_tier_hits_total) is *not* the chain hit count, and separate +// sum(shigola_cache_tier_hits_total) is *not* the chain hit count, and separate // names make that impossible to get wrong by accident. -func (obs *observer) InstrumentedTierCache(tier string, cacheObject tegolaCache.Interface) tegolaCache.Interface { +func (obs *observer) InstrumentedTierCache(tier string, cacheObject shigolaCache.Interface) shigolaCache.Interface { if obs == nil { return cacheObject } diff --git a/provider/map.go b/provider/map.go index 98bfeb1f..743f8e37 100644 --- a/provider/map.go +++ b/provider/map.go @@ -2,7 +2,7 @@ package provider import "github.com/MapColonies/shigola/internal/env" -// A Map represents a map in the Tegola Config file. +// A Map represents a map in the Shigola Config file. type Map struct { Name env.String `toml:"name"` Attribution env.String `toml:"attribution"` diff --git a/provider/postgis/README.md b/provider/postgis/README.md index fe6a6077..247c4a53 100644 --- a/provider/postgis/README.md +++ b/provider/postgis/README.md @@ -251,9 +251,7 @@ stop connecting; set only `RUN_POSTGIS_TESTS=yes` there. The compose stack's `migration` service restores `testdata/postgis/shigola.dump` into a database called **`shigola`** and creates the `shigola_no_access` role the -permission-error tests log in as. It also drops the pre-rename `tegola` database -and role, so a volume that predates the rename does not keep a stale copy around -for `PGURI` to find. +permission-error tests log in as. The fixture holds two groups of tables: diff --git a/provider/postgis/debug.go b/provider/postgis/debug.go index ee494c9f..65acd2b5 100644 --- a/provider/postgis/debug.go +++ b/provider/postgis/debug.go @@ -1,8 +1,9 @@ package postgis import ( - "os" "strings" + + "github.com/MapColonies/shigola/internal/env" ) // debug determines weather extra debugging output is enabled. @@ -11,7 +12,7 @@ import ( const debug = false const ( - EnvSQLDebugName = "TEGOLA_SQL_DEBUG" + EnvSQLDebugName = env.Prefix + "SQL_DEBUG" EnvSQLDebugLayer = "LAYER_SQL" EnvSQLDebugExecute = "EXECUTE_SQL" ) @@ -22,6 +23,13 @@ var ( ) func init() { - debugLayerSQL = strings.Contains(os.Getenv(EnvSQLDebugName), EnvSQLDebugLayer) - debugExecuteSQL = strings.Contains(os.Getenv(EnvSQLDebugName), EnvSQLDebugExecute) + debugLayerSQL, debugExecuteSQL = sqlDebugFlags() +} + +// sqlDebugFlags reads EnvSQLDebugName through the env shim, so the pre-rename +// TEGOLA_SQL_DEBUG keeps working and says it is deprecated. It read the legacy +// name directly until MAPCO-11504, which left the documented name inert. +func sqlDebugFlags() (layer, execute bool) { + v := env.Getenv("SQL_DEBUG") + return strings.Contains(v, EnvSQLDebugLayer), strings.Contains(v, EnvSQLDebugExecute) } diff --git a/provider/postgis/debug_internal_test.go b/provider/postgis/debug_internal_test.go new file mode 100644 index 00000000..f8262fa4 --- /dev/null +++ b/provider/postgis/debug_internal_test.go @@ -0,0 +1,58 @@ +package postgis + +import "testing" + +// TestSQLDebugFlags pins SQL debugging to the environment-variable shim: the +// documented SHIGOLA_SQL_DEBUG name has to work, and the TEGOLA_SQL_DEBUG name +// a deployment may still set has to keep working rather than go quiet. +func TestSQLDebugFlags(t *testing.T) { + type tcase struct { + env map[string]string + wantLayer bool + wantExecute bool + } + + fn := func(tc tcase) func(*testing.T) { + return func(t *testing.T) { + t.Setenv("SHIGOLA_SQL_DEBUG", "") + t.Setenv("TEGOLA_SQL_DEBUG", "") + for k, v := range tc.env { + t.Setenv(k, v) + } + + layer, execute := sqlDebugFlags() + if layer != tc.wantLayer || execute != tc.wantExecute { + t.Errorf("got (layer %v, execute %v), expected (layer %v, execute %v)", + layer, execute, tc.wantLayer, tc.wantExecute) + } + } + } + + tests := map[string]tcase{ + "unset": {}, + "current name": { + env: map[string]string{"SHIGOLA_SQL_DEBUG": "LAYER_SQL"}, + wantLayer: true, + }, + "legacy name": { + env: map[string]string{"TEGOLA_SQL_DEBUG": "EXECUTE_SQL"}, + wantExecute: true, + }, + "both values": { + env: map[string]string{"SHIGOLA_SQL_DEBUG": "LAYER_SQL:EXECUTE_SQL"}, + wantLayer: true, + wantExecute: true, + }, + "current name wins": { + env: map[string]string{ + "SHIGOLA_SQL_DEBUG": "LAYER_SQL", + "TEGOLA_SQL_DEBUG": "EXECUTE_SQL", + }, + wantLayer: true, + }, + } + + for name, tc := range tests { + t.Run(name, fn(tc)) + } +} diff --git a/provider/postgis/postgis_test.go b/provider/postgis/postgis_test.go index 0cd0cdbe..91f33283 100644 --- a/provider/postgis/postgis_test.go +++ b/provider/postgis/postgis_test.go @@ -40,10 +40,10 @@ func TestDBConfig(t *testing.T) { "1": { opts: &postgis.DBConfigOptions{ Uri: uri, - ApplicationName: "tegola", + ApplicationName: "shigola", DefaultTransactionReadOnly: "TRUE", }, - expApplicationName: "tegola", + expApplicationName: "shigola", expDefaultTransactionReadOnly: "TRUE", }, "2": { @@ -58,10 +58,10 @@ func TestDBConfig(t *testing.T) { "3": { opts: &postgis.DBConfigOptions{ Uri: uri, - ApplicationName: "tegola", + ApplicationName: "shigola", DefaultTransactionReadOnly: "FALSE", }, - expApplicationName: "tegola", + expApplicationName: "shigola", expDefaultTransactionReadOnly: "FALSE", }, } @@ -78,7 +78,7 @@ func TestTLSConfig(t *testing.T) { &postgis.DBConfigOptions{ Uri: uri, DefaultTransactionReadOnly: "TRUE", - ApplicationName: "tegola", + ApplicationName: "shigola", }) if err != nil { t.Fatalf("unable to build db config: %v", err) diff --git a/provider/provider.go b/provider/provider.go index a329221b..e4f040d8 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -13,8 +13,8 @@ import ( "github.com/go-spatial/geom/slippy" ) -// defaultGridForSRID maps a bare tile SRID onto the TileMatrixSet tegola has -// historically meant by it. +// defaultGridForSRID maps a bare tile SRID onto the TileMatrixSet Tegola meant +// by it. // // It exists only for callers that still describe a tile by its SRID — a // description that is genuinely ambiguous, since WorldCRS84Quad and WGS1984Quad @@ -46,8 +46,8 @@ type tile_t struct { srid uint64 } -// NewTile creates a new slippy tile with a Buffer, in the grid tegola -// historically associates with srid (see defaultGridForSRID). Prefer +// NewTile creates a new slippy tile with a Buffer, in the grid Tegola +// associated with srid (see defaultGridForSRID). Prefer // NewTileForGrid, which names the grid outright. func NewTile(z slippy.Zoom, x uint, y uint, buf, srid uint) Tile { if srid == 0 { diff --git a/server/middleware_gzip_internal_test.go b/server/middleware_gzip_internal_test.go index 024c2568..f822c8ba 100644 --- a/server/middleware_gzip_internal_test.go +++ b/server/middleware_gzip_internal_test.go @@ -77,11 +77,11 @@ func TestGzipDecompressResponseWriter(t *testing.T) { tests := map[string]tcase{ "decompress": { responseCode: http.StatusOK, - data: []byte("tegola"), + data: []byte("shigola"), }, "internal server error": { responseCode: http.StatusInternalServerError, - data: []byte("tegola"), + data: []byte("shigola"), }, "no data": { responseCode: http.StatusOK, diff --git a/server/middleware_headers_test.go b/server/middleware_headers_test.go index 480f7d30..870d078b 100644 --- a/server/middleware_headers_test.go +++ b/server/middleware_headers_test.go @@ -70,23 +70,23 @@ func TestMiddlewareHeaders(t *testing.T) { uri: "/collections/test-map/tiles/WebMercatorQuad/10/3/2", httpMethod: http.MethodGet, customHeaders: map[string]string{ - "Test-Header": "tegola", + "Test-Header": "shigola", }, expectedResponseHeaders: map[string]string{ "Access-Control-Allow-Origin": DefaultCORSAllowedOrigin, "Access-Control-Allow-Methods": DefaultCORSAllowedMethods, - "Test-Header": "tegola", + "Test-Header": "shigola", }, }, "user defined cors override GET": { uri: "/collections/test-map/tiles/WebMercatorQuad/10/3/2", httpMethod: http.MethodGet, customHeaders: map[string]string{ - "Access-Control-Allow-Origin": "tegola.io", + "Access-Control-Allow-Origin": "example.com", "Access-Control-Allow-Methods": "GET, POST", }, expectedResponseHeaders: map[string]string{ - "Access-Control-Allow-Origin": "tegola.io", + "Access-Control-Allow-Origin": "example.com", "Access-Control-Allow-Methods": "GET, POST", }, }, @@ -103,23 +103,23 @@ func TestMiddlewareHeaders(t *testing.T) { uri: "/collections/test-map/tiles/WebMercatorQuad/10/3/2", httpMethod: http.MethodOptions, customHeaders: map[string]string{ - "Test-Header": "tegola", + "Test-Header": "shigola", }, expectedResponseHeaders: map[string]string{ "Access-Control-Allow-Origin": DefaultCORSAllowedOrigin, "Access-Control-Allow-Methods": DefaultCORSAllowedMethods, - "Test-Header": "tegola", + "Test-Header": "shigola", }, }, "user defined cors override OPTIONS": { uri: "/collections/test-map/tiles/WebMercatorQuad/10/3/2", httpMethod: http.MethodOptions, customHeaders: map[string]string{ - "Access-Control-Allow-Origin": "tegola.io", + "Access-Control-Allow-Origin": "example.com", "Access-Control-Allow-Methods": "GET, POST", }, expectedResponseHeaders: map[string]string{ - "Access-Control-Allow-Origin": "tegola.io", + "Access-Control-Allow-Origin": "example.com", "Access-Control-Allow-Methods": "GET, POST", }, }, diff --git a/server/ogc/api_test.go b/server/ogc/api_test.go index a0b3b9e1..c637f19d 100644 --- a/server/ogc/api_test.go +++ b/server/ogc/api_test.go @@ -81,8 +81,8 @@ func TestAPIServerURL(t *testing.T) { // No trailing slash: OpenAPI appends each path, and every path in the // document begins with one, so a trailing slash here yields "//conformance". - if doc.Servers[0].URL != "http://tegola.io" { - t.Errorf("servers[0].url = %q, want %q", doc.Servers[0].URL, "http://tegola.io") + if doc.Servers[0].URL != "http://example.com" { + t.Errorf("servers[0].url = %q, want %q", doc.Servers[0].URL, "http://example.com") } } diff --git a/server/ogc/collection.go b/server/ogc/collection.go index 094276e5..2c2df15c 100644 --- a/server/ogc/collection.go +++ b/server/ogc/collection.go @@ -10,14 +10,14 @@ import ( // LayerSeparator divides a Layer-collection's id into its map and layer parts. // // ':' rather than '/', '.' or '_': a slash would make the id look like two path -// segments, and a dot or underscore can occur in a tegola map or layer name, +// segments, and a dot or underscore can occur in a shigola map or layer name, // which would make the split ambiguous (ADR-0002). const LayerSeparator = ":" -// Collection is one tileset's worth of geodata: a tegola map, or a single layer +// Collection is one tileset's worth of geodata: a shigola map, or a single layer // of one (ADR-0002). // -// The two tiers exist because tegola serves both — a map's tiles carry every +// The two tiers exist because shigola serves both — a map's tiles carry every // layer, and a layer's tiles carry one — and OGC clients that can only consume a // single-layer tileset would otherwise be unable to use a multi-layer map. type Collection struct { diff --git a/server/ogc/collection_test.go b/server/ogc/collection_test.go index af91bc80..593417a7 100644 --- a/server/ogc/collection_test.go +++ b/server/ogc/collection_test.go @@ -86,7 +86,7 @@ func newRouterFor(t *testing.T, a *atlas.Atlas) *httptreemux.TreeMux { svc := ogc.New(ogc.Config{ Atlas: a, - URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "tegola.io"} }, + URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "example.com"} }, URIPrefix: "/", }) @@ -132,7 +132,7 @@ func TestCollections(t *testing.T) { if link.Rel == "http://www.opengis.net/def/rel/ogc/1.0/tilesets-vector" { hasTilesets = true - if want := "http://tegola.io/collections/" + c.ID + "/tiles"; link.Href != want { + if want := "http://example.com/collections/" + c.ID + "/tiles"; link.Href != want { t.Errorf("%v tilesets link = %q, want %q", c.ID, link.Href, want) } } @@ -319,7 +319,7 @@ func TestTileSetMetadata(t *testing.T) { t.Error("item link is not marked templated") } - want := "http://tegola.io/collections/osm/tiles/WorldCRS84Quad/{tileMatrix}/{tileRow}/{tileCol}?f=mvt" + want := "http://example.com/collections/osm/tiles/WorldCRS84Quad/{tileMatrix}/{tileRow}/{tileCol}?f=mvt" if item.Href != want { t.Errorf("item href = %q, want %q", item.Href, want) } @@ -381,7 +381,7 @@ func TestTile(t *testing.T) { } }) - // "pbf" is what tegola's native routes and our own TileJSON call a Mapbox + // "pbf" is what the removed native routes and our own TileJSON call a Mapbox // Vector Tile, so a client that read either would otherwise be rejected for // naming the same thing we do. t.Run("f=pbf is accepted as a spelling of mvt", func(t *testing.T) { @@ -557,7 +557,7 @@ func TestTileSetTileJSON(t *testing.T) { // The template must keep the OGC path order, or a client substituting its // own z/x/y fetches transposed tiles. - want := "http://tegola.io/collections/osm/tiles/WorldCRS84Quad/{z}/{y}/{x}?f=mvt" + want := "http://example.com/collections/osm/tiles/WorldCRS84Quad/{z}/{y}/{x}?f=mvt" if tiles[0] != want { t.Errorf("tiles[0] = %v, want %v", tiles[0], want) } @@ -622,7 +622,7 @@ func TestTileSetItemHasTemplatedTileLink(t *testing.T) { t.Errorf("tileset %v item link is not marked templated", ts.TileMatrixSetID) } - want := "http://tegola.io/collections/osm/tiles/" + ts.TileMatrixSetID + "/{tileMatrix}/{tileRow}/{tileCol}?f=mvt" + want := "http://example.com/collections/osm/tiles/" + ts.TileMatrixSetID + "/{tileMatrix}/{tileRow}/{tileCol}?f=mvt" if item.Href != want { t.Errorf("tileset %v item href = %q, want %q", ts.TileMatrixSetID, item.Href, want) } @@ -709,12 +709,12 @@ func TestTileSetsListSatisfiesRequirement10(t *testing.T) { rels[l.Rel] = l.Href } - if want := "http://tegola.io/collections/osm/tiles/" + ts.TileMatrixSetID; rels["self"] != want { + if want := "http://example.com/collections/osm/tiles/" + ts.TileMatrixSetID; rels["self"] != want { t.Errorf("self link = %q, want %q", rels["self"], want) } const tilingScheme = "http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme" - if want := "http://tegola.io/tileMatrixSets/" + ts.TileMatrixSetID; rels[tilingScheme] != want { + if want := "http://example.com/tileMatrixSets/" + ts.TileMatrixSetID; rels[tilingScheme] != want { t.Errorf("tiling-scheme link = %q, want %q", rels[tilingScheme], want) } }) @@ -760,7 +760,7 @@ func TestTileCaching(t *testing.T) { }) // A parameter this surface does not own may select a different rendering — - // tegola maps can declare query parameters that change what a tile contains. + // shigola maps can declare query parameters that change what a tile contains. // The key cannot express that, so such a request must not be answered from, // or written to, the cache. t.Run("a request carrying other parameters is not cached", func(t *testing.T) { diff --git a/server/ogc/conformance_walk_test.go b/server/ogc/conformance_walk_test.go index 56b5936e..86a03092 100644 --- a/server/ogc/conformance_walk_test.go +++ b/server/ogc/conformance_walk_test.go @@ -29,7 +29,7 @@ func TestAPIIsWalkable(t *testing.T) { a := newAtlas(t, tms.WebMercatorQuad, tms.WorldCRS84Quad) r := newRouterFor(t, a) - const root = "http://tegola.io" + const root = "http://example.com" // Visited URLs, so a self link or a cycle does not walk forever. seen := map[string]bool{} @@ -129,7 +129,7 @@ func TestTileTemplateResolves(t *testing.T) { "{tileCol}", "3", ).Replace(template) - path, ok := strings.CutPrefix(filled, "http://tegola.io") + path, ok := strings.CutPrefix(filled, "http://example.com") if !ok { t.Fatalf("template %q does not point at this service", template) } @@ -154,7 +154,7 @@ func TestTileTemplateResolves(t *testing.T) { "{tileCol}", "0", ).Replace(template) - path, _ = strings.CutPrefix(transposed, "http://tegola.io") + path, _ = strings.CutPrefix(transposed, "http://example.com") req = httptest.NewRequest(http.MethodGet, path, nil) w = httptest.NewRecorder() r.ServeHTTP(w, req) @@ -211,7 +211,7 @@ func newRouterAt(t *testing.T, prefix string) *httptreemux.TreeMux { svc := ogc.New(ogc.Config{ Atlas: newAtlas(t, tms.WebMercatorQuad), - URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "tegola.io"} }, + URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "example.com"} }, URIPrefix: prefix, }) @@ -228,9 +228,9 @@ func newRouterAt(t *testing.T, prefix string) *httptreemux.TreeMux { // reverse-proxy prefix, where a link that forgot the prefix resolves off the // service entirely. func TestAPIIsWalkableBehindPrefix(t *testing.T) { - r := newRouterAt(t, "/tegola") + r := newRouterAt(t, "/shigola") - const root = "http://tegola.io/tegola" + const root = "http://example.com/shigola" seen := map[string]bool{} @@ -241,13 +241,13 @@ func TestAPIIsWalkableBehindPrefix(t *testing.T) { } seen[href] = true - path, ok := strings.CutPrefix(href, "http://tegola.io") + path, ok := strings.CutPrefix(href, "http://example.com") if !ok { t.Errorf("link %q does not point at this service", href) return } - if !strings.HasPrefix(path, "/tegola") { + if !strings.HasPrefix(path, "/shigola") { t.Errorf("link %q drops the mount prefix", href) return } diff --git a/server/ogc/handle_collections.go b/server/ogc/handle_collections.go index f05088ce..42e07c3a 100644 --- a/server/ogc/handle_collections.go +++ b/server/ogc/handle_collections.go @@ -219,7 +219,7 @@ func (s *Service) tileTemplateLink(r *http.Request, c Collection, grid *tms.Tile return Link{ // OGC orders a tile path {tileMatrix}/{tileRow}/{tileCol} — z/y/x, - // transposed from tegola's native z/x/y. + // transposed from the XYZ convention's z/x/y. Rel: relItem, Href: s.hrefTemplate(r, base, "{tileMatrix}", "{tileRow}", "{tileCol}") + "?f=mvt", Type: MediaTypeMVT, diff --git a/server/ogc/handle_tile.go b/server/ogc/handle_tile.go index 0bb1572e..b1433b9a 100644 --- a/server/ogc/handle_tile.go +++ b/server/ogc/handle_tile.go @@ -21,8 +21,8 @@ import ( // HandleTile serves one vector tile of one collection in one tiling scheme. // -// The path is {tileMatrix}/{tileRow}/{tileCol} — z/y/x, transposed from tegola's -// native z/x/y. Reading the segments in the wrong order silently serves the +// The path is {tileMatrix}/{tileRow}/{tileCol} — z/y/x, transposed from the +// XYZ convention's z/x/y. Reading the segments in the wrong order silently serves the // wrong tile, so they are named for what they are throughout. func (s *Service) HandleTile(w http.ResponseWriter, r *http.Request) { if _, err := negotiate(r, FormatMVT); err != nil { diff --git a/server/ogc/negotiate.go b/server/ogc/negotiate.go index e78d9bd6..a2a8bc4d 100644 --- a/server/ogc/negotiate.go +++ b/server/ogc/negotiate.go @@ -34,9 +34,9 @@ const ( // formatAliases are spellings of a format that this service accepts but never // emits. // -// "pbf" is what tegola's native routes call a Mapbox Vector Tile — the tile -// extension, and the `format` member of the TileJSON this service serves. -// Without this, a client that read that and asked for ?f=pbf would be refused +// "pbf" is what the removed native routes called a Mapbox Vector Tile — their +// tile extension — and is still the `format` member of the TileJSON this +// service serves. Without this, a client that read that and asked for ?f=pbf would be refused // for naming the format the way we named it to them. // // An alias is resolved before the resource's own formats are consulted, so it diff --git a/server/ogc/ogc.go b/server/ogc/ogc.go index f748b2b6..1dd600f2 100644 --- a/server/ogc/ogc.go +++ b/server/ogc/ogc.go @@ -2,13 +2,13 @@ // conformance declaration, collections, tilesets, tiles, and the tiling schemes // they are cut in. // -// It began as an addition to tegola's native routes and is now the whole tile +// It began as an addition to the native routes and is now the whole tile // surface: the /maps/... routes it served alongside have been removed, so a // tile has exactly one URL. "/" is the landing page's required location; // ADR-0003 recorded taking it as a trade, because it displaced the embedded // viewer to /viewer, and neither the viewer nor that trade remains. // -// The package deliberately does not import tegola/server: the server mounts this +// The package deliberately does not import the `server` package: the server mounts this // surface, so the dependency runs one way. Everything this package needs from // its host — where the service is reachable, what it is mounted under, which // atlas to read — arrives in Config. @@ -32,7 +32,7 @@ type Config struct { // configured hostname — and because deployments such as lambda override it. // Required. URLRoot func(*http.Request) *url.URL - // URIPrefix is the path the service is mounted under, e.g. "/tegola" behind + // URIPrefix is the path the service is mounted under, e.g. "/shigola" behind // a reverse proxy. Empty means "/". URIPrefix string // Version is the build this service is running, reported on the landing page @@ -77,7 +77,7 @@ func (s *Service) href(r *http.Request, elem ...string) string { // group's own root. Without the slash a client following the landing page's self // link is answered with a redirect to the same page — harmless for a client that // follows redirects, and a failure for one that does not. At the default mount -// this is already "/"; behind a prefix it would otherwise be "/tegola". +// this is already "/"; behind a prefix it would otherwise be "/shigola". func (s *Service) hrefRoot(r *http.Request) string { root := s.href(r) if strings.HasSuffix(root, "/") { diff --git a/server/ogc/ogc_test.go b/server/ogc/ogc_test.go index d4eb7c86..f231d44a 100644 --- a/server/ogc/ogc_test.go +++ b/server/ogc/ogc_test.go @@ -22,7 +22,7 @@ func newRouter(t *testing.T, uriPrefix string) *httptreemux.TreeMux { svc := ogc.New(ogc.Config{ Atlas: &atlas.Atlas{}, - URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "tegola.io"} }, + URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "example.com"} }, URIPrefix: uriPrefix, }) @@ -66,11 +66,11 @@ func TestLandingPage(t *testing.T) { // Every relation a client needs to bootstrap from the landing page alone. want := map[string]string{ - "self": "http://tegola.io/", - "service-desc": "http://tegola.io/api", - "conformance": "http://tegola.io/conformance", - "data": "http://tegola.io/collections", - "http://www.opengis.net/def/rel/ogc/1.0/tiling-schemes": "http://tegola.io/tileMatrixSets", + "self": "http://example.com/", + "service-desc": "http://example.com/api", + "conformance": "http://example.com/conformance", + "data": "http://example.com/collections", + "http://www.opengis.net/def/rel/ogc/1.0/tiling-schemes": "http://example.com/tileMatrixSets", } got := map[string]string{} @@ -89,7 +89,7 @@ func TestLandingPage(t *testing.T) { // must carry the prefix, or a client follows them straight off the service. func TestLandingPageURIPrefix(t *testing.T) { var doc ogc.LandingPage - w := get(t, newRouter(t, "/tegola"), "/tegola/", &doc) + w := get(t, newRouter(t, "/shigola"), "/shigola/", &doc) if w.Code != http.StatusOK { t.Fatalf("status = %d, want 200", w.Code) @@ -100,7 +100,7 @@ func TestLandingPageURIPrefix(t *testing.T) { continue } - if want := "http://tegola.io/tegola/"; len(link.Href) < len(want) || link.Href[:len(want)] != want { + if want := "http://example.com/shigola/"; len(link.Href) < len(want) || link.Href[:len(want)] != want { t.Errorf("link %q = %q, want it under %q", link.Rel, link.Href, want) } } @@ -165,7 +165,7 @@ func TestTileMatrixSets(t *testing.T) { t.Errorf("%v has no links", item.ID) continue } - if want := "http://tegola.io/tileMatrixSets/" + item.ID; item.Links[0].Href != want { + if want := "http://example.com/tileMatrixSets/" + item.ID; item.Links[0].Href != want { t.Errorf("%v self link = %q, want %q", item.ID, item.Links[0].Href, want) } } diff --git a/server/ogc/routes.go b/server/ogc/routes.go index 46378b91..5ab4a673 100644 --- a/server/ogc/routes.go +++ b/server/ogc/routes.go @@ -32,7 +32,7 @@ func (s *Service) Routes() []Route { {Method: http.MethodGet, Path: "/collections/:collection_id", Handler: s.HandleCollection}, {Method: http.MethodGet, Path: "/collections/:collection_id/tiles", Handler: s.HandleTileSets}, {Method: http.MethodGet, Path: "/collections/:collection_id/tiles/:tile_matrix_set_id", Handler: s.HandleTileSet}, - // z/y/x, not tegola's native z/x/y + // z/y/x, not the XYZ convention's z/x/y { Method: http.MethodGet, Path: "/collections/:collection_id/tiles/:tile_matrix_set_id/:tile_matrix/:tile_row/:tile_col", diff --git a/server/ogc/types.go b/server/ogc/types.go index 418799e6..1d1961ad 100644 --- a/server/ogc/types.go +++ b/server/ogc/types.go @@ -110,7 +110,7 @@ type CollectionDesc struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Extent *Extent `json:"extent,omitempty"` - // DataType is "vector" for every collection this service publishes: tegola + // DataType is "vector" for every collection this service publishes: shigola // produces MVT and nothing else (ADR-0001). DataType string `json:"dataType,omitempty"` CRS []string `json:"crs,omitempty"` @@ -194,7 +194,7 @@ type BoundingBox struct { CRS string `json:"crs,omitempty"` } -// Data types. tegola serves vector tiles only (ADR-0001). +// Data types. Shigola serves vector tiles only (ADR-0001). const ( dataTypeVector = "vector" ) diff --git a/server/ogc/version_test.go b/server/ogc/version_test.go index 53b0a7fc..081d490b 100644 --- a/server/ogc/version_test.go +++ b/server/ogc/version_test.go @@ -18,7 +18,7 @@ func newRouterWithVersion(t *testing.T, version string) *httptreemux.TreeMux { svc := ogc.New(ogc.Config{ Atlas: &atlas.Atlas{}, - URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "tegola.io"} }, + URLRoot: func(*http.Request) *url.URL { return &url.URL{Scheme: "http", Host: "example.com"} }, Version: version, }) diff --git a/server/ogc_mount_test.go b/server/ogc_mount_test.go index b901ddfb..b633f7d5 100644 --- a/server/ogc_mount_test.go +++ b/server/ogc_mount_test.go @@ -73,12 +73,12 @@ func TestOGCMount(t *testing.T) { // TestOGCMountURIPrefix covers the surface behind a reverse proxy prefix. func TestOGCMountURIPrefix(t *testing.T) { server.HostName = &url.URL{Host: serverHostName} - server.URIPrefix = "/tegola" + server.URIPrefix = "/shigola" defer func() { server.URIPrefix = "/" }() a := newTestMapWithLayers(testLayer1) - req := httptest.NewRequest(http.MethodGet, "/tegola/conformance", nil) + req := httptest.NewRequest(http.MethodGet, "/shigola/conformance", nil) w := httptest.NewRecorder() server.NewRouter(a).ServeHTTP(w, req) diff --git a/server/server.go b/server/server.go index 003bd3ac..541b4210 100644 --- a/server/server.go +++ b/server/server.go @@ -24,11 +24,11 @@ const ( var ( // HostName is the name of the host to use for construction of URLS. - // configurable via the tegola config.toml file (set in main.go) + // configurable via the shigola config.toml file (set in main.go) HostName *url.URL // Port is the port the server is listening on, used for construction of URLS. - // configurable via the tegola config.toml file (set in main.go) + // configurable via the shigola config.toml file (set in main.go) Port string // SSLCert is a filepath to an SSL cert, this will be used to enable https @@ -38,11 +38,11 @@ var ( SSLKey string // Headers is the map of user defined response headers. - // configurable via the tegola config.toml file (set in main.go) + // configurable via the shigola config.toml file (set in main.go) Headers = map[string]string{} // URIPrefix sets a prefix on all server endpoints. This is often used - // when the server sits behind a reverse proxy with a prefix (i.e. /tegola) + // when the server sits behind a reverse proxy with a prefix (i.e. /shigola) URIPrefix = "/" // ProxyProtocol is a custom protocol that will be used to generate the URLs @@ -166,7 +166,7 @@ func hostName(r *http.Request) *url.URL { return HostName } - // favor the r.URL.Host attribute in case tegola is behind a proxy + // favor the r.URL.Host attribute in case shigola is behind a proxy // https://stackoverflow.com/questions/42921567/what-is-the-difference-between-host-and-url-host-for-golang-http-request if r.URL != nil && r.URL.Host != "" { return r.URL diff --git a/server/server_internal_test.go b/server/server_internal_test.go index 48938a66..5c26157b 100644 --- a/server/server_internal_test.go +++ b/server/server_internal_test.go @@ -55,29 +55,29 @@ func TestHostName(t *testing.T) { expected: "localhost:8080", }, "hostname set": { - // With hostname set and port set to "none" in config, expect "cdn.tegola.io" + // With hostname set and port set to "none" in config, expect "cdn.example.com" url: "http://localhost:8080/collections", - hostName: "cdn.tegola.io", + hostName: "cdn.example.com", port: "none", - expected: "cdn.tegola.io", + expected: "cdn.example.com", }, "hostname set port set": { - // With hostname set and port set to "none" in config, expect "cdn.tegola.io" + // With hostname set and port set to "none" in config, expect "cdn.example.com" url: "http://localhost:8080/collections", - hostName: "cdn.tegola.io", + hostName: "cdn.example.com", port: ":9090", - expected: "cdn.tegola.io", + expected: "cdn.example.com", }, "hostname set port in request": { // Hostname set, no port in config, but port in url. Expect url: "http://localhost:8080/collections", - hostName: "cdn.tegola.io", - expected: "cdn.tegola.io", + hostName: "cdn.example.com", + expected: "cdn.example.com", }, "hostname set no port in config or url": { url: "http://localhost/collections", - hostName: "cdn.tegola.io", - expected: "cdn.tegola.io", + hostName: "cdn.example.com", + expected: "cdn.example.com", }, "hostname unset no port in config or url": { url: "http://localhost/collections", diff --git a/server/server_test.go b/server/server_test.go index 2a54f08f..1f6159c4 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -24,7 +24,7 @@ import ( // test server config const ( httpPort = ":8080" - serverHostName = "tegola.io" + serverHostName = "example.com" serverCert = "testcert/cert.pem" serverKey = "testcert/key.pem" ) diff --git a/testdata/postgis/generate-dump.sh b/testdata/postgis/generate-dump.sh index ff0b7281..0f0338d0 100755 --- a/testdata/postgis/generate-dump.sh +++ b/testdata/postgis/generate-dump.sh @@ -5,9 +5,9 @@ # Why this script has to exist at all: a pg_dump custom-format archive records # the name of the database it was dumped from in its header, and `pg_restore -C` # creates *that* name. The fixture database name is therefore data inside the -# archive, not a reference to it -- which is why renaming every mention of -# "tegola" in the tree never renamed the database, and why regenerating the -# archive from a database that is genuinely called "shigola" is the only fix. +# archive, not a reference to it -- which is why renaming the project in the +# tree never renamed the database, and why regenerating the archive from a +# database that is genuinely called "shigola" is the only fix. # # The same rebuild is the moment the Athens OSM extract can be added, so the # PostGIS fixture carries the layers the OGC CITE suite exercises (see diff --git a/testdata/postgis/migration.sh b/testdata/postgis/migration.sh index 29dfd43a..33952a7a 100755 --- a/testdata/postgis/migration.sh +++ b/testdata/postgis/migration.sh @@ -24,16 +24,6 @@ export PGDATABASE="postgres" DB="shigola" NO_ACCESS_ROLE="shigola_no_access" -# The pre-rename names. Dropped rather than ignored: a developer whose volume -# predates the rename would otherwise keep a stale, Athens-less "tegola" -# database alongside the real one, and PGURI pointing at either would connect. -LEGACY_DB="tegola" -LEGACY_NO_ACCESS_ROLE="tegola_no_access" - -echo "Dropping pre-rename '$LEGACY_DB' database and '$LEGACY_NO_ACCESS_ROLE' role (if any)..." -run psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" -c "DROP DATABASE IF EXISTS $LEGACY_DB;" -run psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" -c "DROP ROLE IF EXISTS $LEGACY_NO_ACCESS_ROLE;" - echo "Dropping existing '$DB' database (if any)..." run psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" -c "DROP DATABASE IF EXISTS $DB;" diff --git a/tms/commons.go b/tms/commons.go index 3eab48f0..a558700d 100644 --- a/tms/commons.go +++ b/tms/commons.go @@ -10,8 +10,8 @@ import "fmt" // identifier of the TileMatrix within the TileMatrixSet. // // Note that OGC API - Tiles orders tile paths as {tileMatrix}/{tileRow}/{tileCol}, -// i.e. z/y/x, whereas this struct — like morecantile and tegola's native -// routes — is written x, y, z. Construct tiles by field name at request +// i.e. z/y/x, whereas this struct — like morecantile and the XYZ +// convention — is written x, y, z. Construct tiles by field name at request // boundaries to avoid transposing rows and columns. type Tile struct { X int64 diff --git a/tms/doc.go b/tms/doc.go index 2d9b1dad..e88539a6 100644 --- a/tms/doc.go +++ b/tms/doc.go @@ -1,5 +1,5 @@ // Package tms implements OGC Two Dimensional Tile Matrix Set (OGC 17-083r4) -// tiling schemes, and is the single source of truth for which grids tegola can +// tiling schemes, and is the single source of truth for which grids shigola can // produce and describe. // // The package is a faithful Go port of developmentseed/morecantile 7.0.3 diff --git a/tms/errors.go b/tms/errors.go index 14dd3c0d..da6728d3 100644 --- a/tms/errors.go +++ b/tms/errors.go @@ -124,7 +124,7 @@ func (e ErrPointOutsideBounds) Error() string { // ErrVariableWidthUnsupported reports a grid whose tile matrices coalesce // columns. The document model and tile arithmetic handle these grids, but -// tegola's tile pipeline assumes a tile's column index maps to one column of +// shigola's tile pipeline assumes a tile's column index maps to one column of // the matrix, so they are not activated. var ErrVariableWidthUnsupported = errors.New("tms: variable-width tile matrices are not supported by the tile pipeline") diff --git a/tms/mercantile_conform_test.go b/tms/mercantile_conform_test.go index 390f4c43..3f3235b7 100644 --- a/tms/mercantile_conform_test.go +++ b/tms/mercantile_conform_test.go @@ -2,7 +2,7 @@ package tms // Ported from morecantile/tests/test_mercantile_conform.py (MIT, Development // Seed), which pins WebMercatorQuad against mapbox/mercantile — the de facto -// reference for the XYZ scheme every existing tegola client uses. +// reference for the XYZ scheme every existing slippy-map client uses. // // mercantile is a Python library, so instead of calling it, the formulas below // reimplement it directly from its source. That keeps the check independent: the diff --git a/tms/registry.go b/tms/registry.go index 7537b817..34dce882 100644 --- a/tms/registry.go +++ b/tms/registry.go @@ -209,7 +209,7 @@ func (r *Registry) Available(id string) bool { // The order is part of the contract, not a detail. A map that names no schemes // is registered with all of them, and `cache seed --map` then takes the first // as the run's scheme — so this order decides what a seed run of an -// unconfigured map covers, and tegola's grid has always been WebMercatorQuad. +// unconfigured map covers, and Tegola's only grid was WebMercatorQuad. // Sorting alone would put WGS1984Quad there, since 'G' sorts before 'e'. func (r *Registry) AvailableIDs() []string { var out []string @@ -319,7 +319,7 @@ func bundledFactory(id, entry string) Factory { // The three reasons are genuinely different, and each must name itself honestly. // Most gated grids are projected and have no arithmetic Transformer. The // variable-width grids are geographic — a transform does exist — and are held -// back because coalesced columns do not fit tegola's tile pipeline. The last case +// back because coalesced columns do not fit shigola's tile pipeline. The last case // is a grid this build could serve but has not been asked to. func gatingReason(grid *TileMatrixSet) error { switch { diff --git a/tms/registry_test.go b/tms/registry_test.go index f37fc454..ba3b9009 100644 --- a/tms/registry_test.go +++ b/tms/registry_test.go @@ -328,7 +328,7 @@ func containsString(haystack []string, needle string) bool { // TestAvailableIDsOrder pins the ordering contract: a caller that defaults to // "every available grid" — a map's tiling schemes, for one — takes the first -// entry as the default, and tegola's default has always been WebMercatorQuad. +// entry as the default, and Tegola's only grid was WebMercatorQuad. // Plain sorting would put WGS1984Quad first, since 'G' sorts before 'e'. func TestAvailableIDsOrder(t *testing.T) { ids := AvailableIDs() diff --git a/tms/tilematrixset.go b/tms/tilematrixset.go index fb57ceac..958e0379 100644 --- a/tms/tilematrixset.go +++ b/tms/tilematrixset.go @@ -161,7 +161,7 @@ func (t *TileMatrixSet) OrderedAxes() []string { return append([]string(nil), t.def.OrderedAxes...) } -// NativeSRID returns the SRID tegola's pipeline works in when producing tiles +// NativeSRID returns the SRID shigola's pipeline works in when producing tiles // for this grid. // // This is the grid CRS's EPSG code where it has one, and 4326 for a CRS84 grid @@ -346,7 +346,7 @@ func (t *TileMatrixSet) matrixOrigin(m TileMatrix) Coords { // // For a square grid such as WebMercatorQuad this is (2^z, 2^z); for the 2:1 // WorldCRS84Quad it is (2*2^z, 2^z). Per-axis validation of a requested tile -// must use both values — assuming a square pyramid is what ties tegola's +// must use both values — assuming a square pyramid is what ties shigola's // current handlers to WebMercator. func (t *TileMatrixSet) MatrixSize(zoom int) (cols, rows int64, err error) { m, err := t.Matrix(zoom) @@ -580,7 +580,7 @@ func (t *TileMatrixSet) tileFrame(tile Tile) (TileMatrix, int64, Coords, error) // XYBounds returns a tile's bounding box in the grid's CRS. // -// This is the extent tegola queries, clips and encodes against, and it needs no +// This is the extent shigola queries, clips and encodes against, and it needs no // coordinate transform for any grid. // // Ported from morecantile.models.TileMatrixSet.xy_bounds. @@ -757,10 +757,10 @@ func (t *TileMatrixSet) IntersectsXY(bbox BoundingBox) (bool, error) { bbox.Bottom < tmsBounds.Top, nil } -/* ------------------------------------------------------- tegola-facing view */ +/* ------------------------------------------------------- shigola-facing view */ // TileExtent returns a tile's extent in the grid's CRS as a geom.Extent, the -// form tegola's provider and encode paths work with. +// form shigola's provider and encode paths work with. func (t *TileMatrixSet) TileExtent(tile Tile) (geom.Extent, error) { b, err := t.XYBounds(tile) if err != nil { diff --git a/tms/tilematrixset_test.go b/tms/tilematrixset_test.go index 23303c4d..ee2901d2 100644 --- a/tms/tilematrixset_test.go +++ b/tms/tilematrixset_test.go @@ -71,7 +71,7 @@ func TestTMSProperties(t *testing.T) { } } -// TestNativeSRID covers the SRID every active grid reports to tegola's tile +// TestNativeSRID covers the SRID every active grid reports to shigola's tile // pipeline. WorldCRS84Quad is the case worth pinning: its CRS is OGC:CRS84, // whose EPSG code is genuinely 0, but tiles in it must reproject as EPSG:4326 — // a 0 here silently produces tiles with no coordinate system. @@ -306,7 +306,7 @@ func TestLngLatXYRoundtrip(t *testing.T) { } // TestWebMercatorBBox pins the grid's full extent. The latitude limit is where -// clamping bugs surface: tegola's maths/webmercator.LatToY clamps at +/-89.5, so +// clamping bugs surface: shigola's maths/webmercator.LatToY clamps at +/-89.5, so // a transform routed through it would not produce this value. func TestWebMercatorBBox(t *testing.T) { grid := mustGrid(t, "WebMercatorQuad") @@ -982,7 +982,7 @@ func TestMatrixSynthesisRejectsShallowZoom(t *testing.T) { } } -// TestTileExtentGeomForm checks the tegola-facing accessors line up with the +// TestTileExtentGeomForm checks the shigola-facing accessors line up with the // ported bounds, in geom.Extent's (minx, miny, maxx, maxy) order. func TestTileExtentGeomForm(t *testing.T) { grid := mustGrid(t, "WebMercatorQuad") diff --git a/tms/transform.go b/tms/transform.go index 86b99c93..9dd50d0a 100644 --- a/tms/transform.go +++ b/tms/transform.go @@ -60,7 +60,7 @@ func (identityTransformer) FromGeographic(lon, lat float64) (float64, float64, e // webMercatorTransformer implements EPSG:3857 (WGS 84 / Pseudo-Mercator), the // spherical Mercator projection of the WGS 84 datum, in closed form. // -// Latitude is deliberately *not* clamped. tegola's maths/webmercator.LatToY +// Latitude is deliberately *not* clamped. shigola's maths/webmercator.LatToY // clamps to +/-89.5 degrees, which is fine for a grid that only ever reaches // +/-85.05, but clamping here would silently corrupt the grid bounds this // package reports. Latitudes beyond the projection's domain produce infinities, diff --git a/tms/variable_width_test.go b/tms/variable_width_test.go index 860abc7f..bb879703 100644 --- a/tms/variable_width_test.go +++ b/tms/variable_width_test.go @@ -5,7 +5,7 @@ package tms // // GNOSISGlobalGrid and CDB1GlobalGrid coalesce columns towards the poles, so // several column indices alias to one tile. This build does not activate them -// (their coalesced columns do not fit tegola's tile pipeline), but their +// (their coalesced columns do not fit shigola's tile pipeline), but their // arithmetic is CRS-transform-free and the model must carry variable widths for // the projected grids to be activatable later — so the upstream golden values // are exercised here through LoadGrid.