Skip to content

Commit

Permalink
chore: rename to raystack
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Jul 13, 2023
1 parent 254183a commit 23a8ed4
Show file tree
Hide file tree
Showing 128 changed files with 1,380 additions and 1,315 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-js-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
scope: "@odpf"
scope: "@raystack"
- run: npm install
working-directory: clients/js
- run: npm publish --access public
Expand Down
22 changes: 11 additions & 11 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ builds:
flags:
- -a
ldflags:
- -X github.com/odpf/stencil/config.Version={{.Tag}}
- -X github.com/odpf/stencil/config.BuildCommit={{.FullCommit}}
- -X github.com/odpf/stencil/config.BuildDate={{.Date}}
- -X github.com/raystack/stencil/config.Version={{.Tag}}
- -X github.com/raystack/stencil/config.BuildCommit={{.FullCommit}}
- -X github.com/raystack/stencil/config.BuildDate={{.Date}}
goos: [darwin, linux, windows]
goarch: [amd64, 386, arm, arm64]
env:
Expand Down Expand Up @@ -48,13 +48,13 @@ dockers:
- stencil
dockerfile: Dockerfile
image_templates:
- "docker.io/odpf/{{.ProjectName}}:latest"
- "docker.io/odpf/{{.ProjectName}}:{{ .Version }}"
- "docker.io/odpf/{{.ProjectName}}:{{ .Tag }}-amd64"
- "docker.io/raystack/{{.ProjectName}}:latest"
- "docker.io/raystack/{{.ProjectName}}:{{ .Version }}"
- "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}-amd64"
nfpms:
- maintainer: ODPF
description: Schema registry
homepage: https://github.com/odpf/stencil
homepage: https://github.com/raystack/stencil
license: Apache 2.0
formats:
- deb
Expand All @@ -63,17 +63,17 @@ nfpms:
darwin: macOS
scoop:
bucket:
owner: odpf
owner: raystack
name: scoop-bucket
homepage: "https://github.com/odpf/stencil"
homepage: "https://github.com/raystack/stencil"
description: "Schema registry"
license: Apache 2.0
brews:
- name: stencil
homepage: "https://github.com/odpf/stencil"
homepage: "https://github.com/raystack/stencil"
description: "Schema registry"
tap:
owner: odpf
owner: raystack
name: homebrew-tap
license: "Apache 2.0"
folder: Formula
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME="github.com/odpf/stencil"
NAME="github.com/raystack/stencil"
VERSION=$(shell git describe --always --tags 2>/dev/null)
PROTON_COMMIT := "a6c7056fa80128145d00d5ee72f216c28578ec43"

Expand All @@ -22,9 +22,9 @@ lint: ## Run golang-ci lint
golangci-lint run

proto: ## Generate the protobuf files
@echo " > generating protobuf from odpf/proton"
@echo " > generating protobuf from raystack/proton"
@echo " > [info] make sure correct version of dependencies are installed using 'make install'"
@buf generate https://github.com/odpf/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path odpf/stencil
@buf generate https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path raystack/stencil
@echo " > protobuf compilation finished"

clean: ## Clean the build artifacts
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/
`stencil` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/raystack/stencil/releases/latest) page:

```sh
brew install odpf/tap/stencil
brew install raystack/tap/stencil
```

To upgrade to the latest version:
Expand Down Expand Up @@ -75,13 +75,13 @@ scoop update stencil
We provide ready to use Docker container images. To pull the latest image:

```sh
docker pull odpf/stencil:latest
docker pull raystack/stencil:latest
```

To pull a specific version:

```sh
docker pull odpf/stencil:v0.3.3
docker pull raystack/stencil:v0.3.3
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- name: go-grpc
out: ./proto
opt: paths=source_relative
- remote: buf.build/odpf/plugins/validate
- remote: buf.build/raystack/plugins/validate
out: "proto"
opt: "paths=source_relative,lang=go"
- name: grpc-gateway
Expand Down
16 changes: 8 additions & 8 deletions clients/clojure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A Clojure library designed to easily encode and decode protobuf messages by usin
Add the below dependency to your `project.clj` file:

```clj
[io.odpf/stencil-clj "0.3.3"]
[org.raystack/stencil-clj "0.3.3"]
```

## Usage
Expand All @@ -20,7 +20,7 @@ syntax = "proto3";
package example;
option java_multiple_files = true;
option java_package = "io.odpf.CljTest";
option java_package = "org.raystack.CljTest";
message Address {
string city = 1;
Expand Down Expand Up @@ -60,7 +60,7 @@ message Person {
(:require [stencil.core :refer [serialize]])

(def serialized-data
(serialize client "io.odpf.CljTest" {:name "Foo"
(serialize client "org.raystack.CljTest" {:name "Foo"
:address {:street "bar"}
:email-list ["a@example.com" "b@b.com"]
:gender :NON-BINARY
Expand All @@ -72,7 +72,7 @@ message Person {
```clojure
(:require [stencil.core :refer [deserialize]])

(deserialize client "io.odpf.CljTest" serialized-data)
(deserialize client "org.raystack.CljTest" serialized-data)
;; prints
;; {:name "Foo"
;; :address {:street "bar"}
Expand All @@ -88,7 +88,7 @@ message Person {
| field names | keywords in kebab case | `name` -> `:name`, `field_name` -> `:field-name` |
| scalar fields | Values follow [protobuf-java scalar value mappings](https://developers.google.com/protocol-buffers/docs/proto3#scalar) | |
| enums | Values converted as keywords of enum's original value | `UNKNOWN` -> `:UNKNOWN` |
| messages | clojure map | `message Hello {string name = 1;}` -> {:name "odpf"} |
| messages | clojure map | `message Hello {string name = 1;}` -> {:name "raystack"} |
| repeated fields | clojure vector | |
| one-of fields | treated as regular fields | if two fields are set that are part of one-of, last seen value is considered while serializing data |
| map | map values follow it's [wire representation](https://developers.google.com/protocol-buffers/docs/proto3#backwards_compatibility) | for `map<string, string>` type, example value will be `[{:key "key" :value "value"}]` |
Expand Down Expand Up @@ -155,7 +155,7 @@ Serialize will throw error in following cases

```clojure
(let [client (create-client sample-client-config)
proto-package "io.odpf.stencil_clj_test"
proto-package "org.raystack.stencil_clj_test"
proto-class-name "Scalar"
fully-qualified-proto-name (str proto-package "." proto-class-name)]
(get-descriptor client fully-qualified-proto-name))
Expand Down Expand Up @@ -183,7 +183,7 @@ Serialize will throw error in following cases

```clojure
(let [client (create-client sample-client-config)
proto-package "io.odpf.stencil_clj_test"
proto-package "org.raystack.stencil_clj_test"
proto-class-name "Scalar"
fully-qualified-proto-name (str proto-package "." proto-class-name)
proto-desc (get-descriptor client fully-qualified-proto-name)
Expand Down Expand Up @@ -213,7 +213,7 @@ Serialize will throw error in following cases

```clojure
(let [client (create-client sample-client-config)
proto-package "io.odpf.stencil_clj_test"
proto-package "org.raystack.stencil_clj_test"
proto-class-name "Scalar"
fully-qualified-proto-name (str proto-package "." proto-class-name)
proto-desc (get-descriptor client fully-qualified-proto-name)]
Expand Down
6 changes: 3 additions & 3 deletions clients/clojure/project.clj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(defproject io.odpf/stencil-clj "0.3.3"
(defproject org.raystack/stencil-clj "0.3.3"
:description "Stencil client for clojure"
:url "https://github.com/odpf/stencil"
:url "https://github.com/raystack/stencil"
:license {:name "Apache 2.0"
:url "https://www.apache.org/licenses/LICENSE-2.0"}
:dependencies [[org.clojure/clojure "1.10.3"]
[io.odpf/stencil "0.2.1"]]
[org.raystack/stencil "0.2.1"]]
:plugins [[lein-cljfmt "0.7.0"]]
:global-vars {*warn-on-reflection* true}
:source-paths ["src"]
Expand Down
10 changes: 5 additions & 5 deletions clients/clojure/src/stencil/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
(:require [stencil.encode :refer [map->bytes]]
[stencil.decode :refer [bytes->map]])
(:import
(io.odpf.stencil.client StencilClient)
(io.odpf.stencil StencilClientFactory)
(io.odpf.stencil.cache SchemaRefreshStrategy)
(io.odpf.stencil.exception StencilRuntimeException)
(io.odpf.stencil.config StencilConfig)
(org.raystack.stencil.client StencilClient)
(org.raystack.stencil StencilClientFactory)
(org.raystack.stencil.cache SchemaRefreshStrategy)
(org.raystack.stencil.exception StencilRuntimeException)
(org.raystack.stencil.config StencilConfig)
(org.apache.http.message BasicHeader) (java.util ArrayList)))

(defn create-client
Expand Down
4 changes: 2 additions & 2 deletions clients/clojure/test/stencil/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
(:require [clojure.test :refer :all]
[stencil.core :refer :all])
(:import
(io.odpf.stencil.client StencilClient)))
(org.raystack.stencil.client StencilClient)))

(deftest test-create-client
(testing "should create client"
(let [config {:url "http://localhost:8000/v1beta1/namespaces/odpf/schemas/proton"
(let [config {:url "http://localhost:8000/v1beta1/namespaces/raystack/schemas/proton"
:refresh-ttl 100
:request-timeout 10000
:request-backoff-time 100
Expand Down
24 changes: 12 additions & 12 deletions clients/clojure/test/stencil/serde_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[stencil.encode :refer [map->bytes]]
[stencil.decode :refer [bytes->map]])
(:import
(io.odpf.stencil DescriptorMapBuilder)
(org.raystack.stencil DescriptorMapBuilder)
(java.io File FileInputStream)))

(defn file-desc-map [^String path]
Expand Down Expand Up @@ -81,52 +81,52 @@

(deftest serialization-deserialization-test
(testing "should handle scalar types"
(let [proto-name "io.odpf.stencil_clj_test.Scalar"
(let [proto-name "org.raystack.stencil_clj_test.Scalar"
descriptor (local-get-descriptor proto-name)
serialized-data (map->bytes descriptor scalar-data)
deserialized-data (bytes->map descriptor serialized-data)]
(is (= (dissoc deserialized-data :field-bytes) (dissoc scalar-data :field-bytes)))
(is (= (seq (:field-bytes deserialized-data)) (seq (:field-bytes scalar-data))))))

(testing "should handle enum type if enum value is by name"
(verify "io.odpf.stencil_clj_test.SimpleNested" {:field-name :VALUE-1}))
(verify "org.raystack.stencil_clj_test.SimpleNested" {:field-name :VALUE-1}))

(testing "should handle enum type if enum value is by number"
(let [proto-name "io.odpf.stencil_clj_test.SimpleNested"
(let [proto-name "org.raystack.stencil_clj_test.SimpleNested"
descriptor (local-get-descriptor proto-name)
test-data {:field-name 2}
serialized-data (map->bytes descriptor test-data)
deserialized-data (bytes->map descriptor serialized-data)]
(is (= deserialized-data {:field-name :VALUE-2}))))

(testing "should deserialize message type field"
(verify "io.odpf.stencil_clj_test.SimpleNested" simple-nested))
(verify "org.raystack.stencil_clj_test.SimpleNested" simple-nested))

(testing "should handle struct and map types"
(verify "io.odpf.stencil_clj_test.ComplexTypes" complex-types))
(verify "org.raystack.stencil_clj_test.ComplexTypes" complex-types))

(testing "should handle repeated fields"
(verify "io.odpf.stencil_clj_test.SimpleArray" simple-array))
(verify "org.raystack.stencil_clj_test.SimpleArray" simple-array))

(testing "should handle self referencing types"
(verify "io.odpf.stencil_clj_test.Recursive" recursive-data))
(verify "org.raystack.stencil_clj_test.Recursive" recursive-data))

(testing "should handle wrapper types"
(verify "io.odpf.stencil_clj_test.Wrappers" wrapper-data))
(verify "org.raystack.stencil_clj_test.Wrappers" wrapper-data))

(testing "should throw error if unknown field is present"
(try (verify "io.odpf.stencil_clj_test.Scalar" {:x "test"})
(try (verify "org.raystack.stencil_clj_test.Scalar" {:x "test"})
(catch Exception e
(is (= {:cause :unknown-field, :info {:field-name :x}} (ex-data e))))))

(testing "should throw error if enum value is invalid"
(try (verify "io.odpf.stencil_clj_test.SimpleArray" {:groups [:invalid :UNKNOWN]})
(try (verify "org.raystack.stencil_clj_test.SimpleArray" {:groups [:invalid :UNKNOWN]})
(catch Exception e
(is (= {:cause :unknown-enum-value
:info {:field-name :invalid}} (ex-data e))))))

(testing "should throw error if non array value assigned to repeated(array) field"
(try (verify "io.odpf.stencil_clj_test.SimpleArray" {:groups :UNKNOWN})
(try (verify "org.raystack.stencil_clj_test.SimpleArray" {:groups :UNKNOWN})
(catch Exception e
(is (= {:cause :not-a-collection
:info {:value :UNKNOWN}} (ex-data e)))))))
4 changes: 2 additions & 2 deletions clients/clojure/test/stencil/testdata/one.proto
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";

package io.odpf.stencil_clj_test;
package org.raystack.stencil_clj_test;

option java_multiple_files = true;
option java_package = "io.odpf.stencil_clj_test";
option java_package = "org.raystack.stencil_clj_test";

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
Expand Down
2 changes: 1 addition & 1 deletion clients/go/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [2021] [odpf]
Copyright [2021] [raystack]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 23a8ed4

Please sign in to comment.