Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dev): development of v0.2.0 of schema #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VALIDATE_JSON=
62 changes: 34 additions & 28 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,44 @@ name: Lint Code Base
# Start the job on all push #
#############################
on:
push:
branches-ignore: ["*"]
# Remove the line above to run when pushing to master
pull_request:
branches: ["*"]
push:
branches-ignore: ["*"]
# Remove the line above to run when pushing to master
pull_request:
branches: ["*"]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v3
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v3
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
################################
# Run Series CI KPI Script #
################################
- name: Exec Series-CI
run: |
sh ./.series-ci.sh
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
.tar.gz
*.tar.gz
*.zip
*.tgz
*.tar.lz
*.tar
.DS_Store
build/
dist/
node_modules
22 changes: 22 additions & 0 deletions .series-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/usr/env bash
curl \
--header "Authorization: Token c8ba7ebc-950c-49a5-ad5f-d69aa31a2c60" \
--header "Content-Type: application/json" \
--data "{
\"values\":[
{
\"line\":\"a\",
\"value\":\"1 %\"
},
{
\"line\":\"b\",
\"value\":\"2 %\"
},
{
\"line\":\"c\",
\"value\":\"3 %\"
}
],
\"sha\":\"${GITHUB_SHA}\"
}" \
https://seriesci.com/api/sambacha/yearn-vault-schema/:series/many
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### v0.1.0

> 4 September 2020

- feat(v0.1.0): v0.1.0 release [`9e0e8b1`](https://github.com/sambacha/yearn-vault-schema/commit/9e0e8b15ef07acce1d9103aa3fd1e8debd3657bf)
- feat(github): github release [`bc4adcf`](https://github.com/sambacha/yearn-vault-schema/commit/bc4adcf2c4baef96195ae0464ed212fba7bceb90)
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The JSON schema represents the technical specification for yfi vaults - which ca

use `camelCase`

## JSON Schema $id
## JSON Schema \$id

The JSON schema ID is [schema.yfi.json](schema.yfi.json))

Expand All @@ -28,15 +28,13 @@ The Vault Lists include a `version` field, which follows [semantic versioning](h

List versions must follow the rules:

- Increment major version when vaults are removed/migrated
- Increment minor version when vaults are added
- Increment patch version when vaults already on the list have minor details changed (name, symbol, logo URL, decimals)
- Increment major version when vaults are removed/migrated
- Increment minor version when vaults are added
- Increment patch version when vaults already on the list have minor details changed (name, symbol, logo URL, decimals)

Changing a token address or chain ID is considered both a remove and an add, and should be a major version update.

Note that list versioning is used to improve the user experience, but not for security, i.e. list versions are not meant
to provide protection against malicious updates to a token list; i.e. the list semver is used as a lossy compression
of the diff of list updates. List updates may still be diffed in the client dApp.
Note that list versioning is used to improve the user experience, but not for security, i.e. list versions are not meant to provide protection against malicious updates to a token list; i.e. the list semver is used as a lossy compression of the diff of list updates. List updates may still be diffed in the client dApp.

## Contributors

Expand Down
61 changes: 61 additions & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Development Specification

This document is intended to detail the `+dev` version of the schema. It is used to document changes between versions along with record design decisions, etc.

## TODO

* create: array of function hashes associated with vault
where hex string e.g: `0xa68027f2`

## +dev Changes

> `+dev` refers to the `semver` option after the patch identifier so that there is not changes in the `0.0.x` portion of versioning

### \$id

ADD: Versioning in `$id` reference at top, i.e.: `"$id": "https://yearn.finance/v0.1.0+dev/vault.schema.json",`

### Properties

ADD: `properties` field

## Vault Strategy

```json
"vaultStrategy": {
"type": "object",
"description": "a strategy associated with this specific vault",
"items": {
"$ref": "#/definitions/yEarnVault"
},
"maxLength": 18,
"examples": ["vault", "aave"]
}
```

### Keywords

TODO: create a list of `keywords` for vaults && strategies

### Tags

TODO: create a list of `tags` for vaults && strategies

### yipId

```json
"yipId": {
"type": "string",
"description": "The associated YIP for this vault and/or strategy",
"minLength": 5,
"maxLength": 8,
"pattern": "/^[a-zA-Z-][a-zA-Z0-9-]*$",
"examples": ["YIP-40"]
}
```

## Notes

- il8n - translations
- additional parameters useful for UIs
- additional parameters or structuring to make usability easier
25 changes: 25 additions & 0 deletions VERSIONING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Versioning

> Matches SemVer (Semantic Versioning) strings.

The string MAY start with a "v" but it is not matched.

## Versioning Regex

```pearl
/(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/
```

## Validation

[rgxdb/semver](https://rgxdb.com/r/40OZ1HN5)

`1.2.3-pre+build`

```js
major = 1
minor = 2
patch = 3
prerelease = pre
build = dev
```
Loading