Coder Social home page Coder Social logo

nobl9 / nobl9-go Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 1.0 1.46 MB

Nobl9 SDK for Go!

Home Page: https://www.nobl9.com/

License: Mozilla Public License 2.0

Go 98.80% Shell 0.13% Makefile 0.68% JavaScript 0.19% Awk 0.02% Smarty 0.18%
golang nobl9 reliability slo go sdk

nobl9-go's People

Contributors

altar64 avatar bdw-nobl9 avatar bsski avatar bsski-nobl9 avatar daniel-zelazny avatar danstan9 avatar davex98 avatar dawidwisn avatar dependabot[bot] avatar kskitek avatar kubaceg avatar kuklyy avatar lukasz-dobek avatar marcinlawnik avatar mkaras-nobl9 avatar natalialanga avatar nieomylnieja avatar nikodemrafalski avatar nobl9-adam-szymanski avatar nuusk avatar piotrkwarcinski avatar remilis avatar renovate[bot] avatar shubhindia avatar skrolikiewicz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

shubhindia

nobl9-go's Issues

Mocking the noble9 sdk

We are writing some internal APIs to manage nobl9 objects. Any suggestions on how I should mock the client for unit testing?
Currently mocking the methods which we are actually using.
e.g.

type N9Client interface {
	GetUser(ctx context.Context) (string, error)
	GetProjects(ctx context.Context, projectName string) ([]project.Project, error)
	CreateProject(ctx context.Context, projectName string) error
	DeleteProject(ctx context.Context, projectName string) error
}

Was wondering if we could pass the mockedClient to actual SDK and then SDK holds these mocked methods.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/checks.yml
  • actions/checkout v4
  • actions/setup-go v5
  • actions/setup-node v4
  • actions/cache v4
.github/workflows/pr-title.yml
  • Slashgear/action-check-pr-title v4.3.0
.github/workflows/release-drafter.yml
  • actions/checkout v4
  • release-drafter/release-drafter v6
.github/workflows/tests.yml
  • actions/checkout v4
  • actions/setup-go v5
.github/workflows/vulns.yml
  • actions/checkout v4
  • actions/setup-go v5
gomod
docs/mock_example/go.mod
  • go 1.22
  • github.com/nobl9/nobl9-go v0.81.0
  • github.com/stretchr/testify v1.9.0
  • go.uber.org/mock v0.4.0
go.mod
  • go 1.22
  • github.com/BurntSushi/toml v1.3.2
  • github.com/MicahParks/jwkset v0.5.17
  • github.com/MicahParks/keyfunc/v3 v3.3.2
  • github.com/aws/aws-sdk-go v1.51.18
  • github.com/bmatcuk/doublestar/v4 v4.6.1
  • github.com/goccy/go-yaml v1.11.3
  • github.com/golang-jwt/jwt/v5 v5.2.1
  • github.com/hashicorp/go-retryablehttp v0.7.5
  • github.com/pkg/errors v0.9.1
  • github.com/stretchr/testify v1.9.0
  • github.com/teambition/rrule-go v1.8.2
  • golang.org/x/text v0.14.0
  • golang.org/x/time v0.5.0
npm
package.json
  • cspell 8.6.1
  • markdownlint-cli 0.39.0
  • yaml 2.4.1
  • yarn 1.22.22
regex
Makefile
  • abice/go-enum v0.6.0
  • securego/gosec v2.19.0
  • golangci/golangci-lint v1.57.2
  • golang.org/x/vuln/cmd/govulncheck v1.0.4
  • golang.org/x/tools/cmd/goimports v0.20.0
  • github.com/vburenin/ifacemaker v1.2.1

  • Check this box to trigger a request for Renovate to run again on this repository

[BUG] Multiline, quoted strings are not handled correctly by sdk.ReadObjects

Describe the bug
Double quoted, multiline strings result in an error and are not handled properly by sdk.ReadObjects function.

To Reproduce

Minimal main.go:

package main

import (
	"context"
	"fmt"

	"github.com/nobl9/nobl9-go/manifest"
	"github.com/nobl9/nobl9-go/manifest/v1alpha/project"
	"github.com/nobl9/nobl9-go/sdk"
)

func main() {
	objects, err := sdk.ReadObjects(context.Background(), "./project.yaml")
	if err != nil {
    panic(err)
	}
	fmt.Println(manifest.FilterByKind[project.Project](objects)[0].Spec.Description)
}

project.yaml:

apiVersion: n9/v1alpha
kind: Project
metadata:
    name: test
spec:
  description: "This operation includes the following processes: <br>
- Get all orders in a particular timeframe
"

Expected behavior

The object should be parsed just fine, the YAML library parses the file just fine on its own, which might hint at quoting handling issues on our side.
Here's a minimal working exmaple:

package main

import (
	"fmt"
	"os"

	"github.com/nobl9/nobl9-go/manifest/v1alpha/project"
  "github.com/goccy/go-yaml"
)

func main() {
	data, err := os.ReadFile("./project.yaml")
	if err != nil {
		panic(err)
	}
	var project project.Project
	if err = yaml.Unmarshal(data, &project); err != nil {
		panic(err)
	}
	fmt.Println(project.Spec.Description)
}

System details (please complete the following information):

  • Fedora 37
  • 0.77.1

[BUG] Validation package does not handle empty map keys

Describe the bug
Property errors for map keys validation do not handle empty strings. Instead of a path like metadata.labels."" we get metadata.labels.

To Reproduce
Set map key to an empty string, run validation. The result is a property path without the empty string key element.

Expected behavior
The result should be a valid YAMLPath pointing at the empty key.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.