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

CORE-2016: support scheduled rate and quota default changes. #63

Merged
merged 29 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a722913
CORE-2016: began implementing the database changes for subscription r…
slr71 Oct 2, 2024
f5357ab
CORE-2016: finished the initial schema migrations for shceduled subsc…
slr71 Oct 5, 2024
cacafbe
CORE-2016: add a new column to record the rate used for purchased add…
slr71 Oct 9, 2024
428efbf
CORE-2016: update some existing migrations to make the more likely to…
slr71 Oct 9, 2024
e59fc0f
CORE-2016: set up direnv to simplify local development testing
slr71 Oct 10, 2024
07c021e
CORE-2016: changed money columns to numeric columns in the database
slr71 Oct 10, 2024
7466e13
CORE-2016: added support for the effective_date field to the plans en…
slr71 Oct 10, 2024
12ea653
CORE-2016: removed the POST /v1/plans/quota-defaults endpoint
slr71 Oct 10, 2024
ba44de1
CORE-2016: added an endpoint to add quota defaults to an existing plan
slr71 Oct 11, 2024
55b6516
CORE-2016: fixed a tpyo
slr71 Oct 15, 2024
3e4e89b
CORE-2016: fixed some Swagger warnings
slr71 Oct 21, 2024
dd1172c
CORE-2016: fixed a couple of errors in the POST /v1/plans/{plan-id}/q…
slr71 Oct 21, 2024
b224beb
CORE-2016: added stubs for three new endpoints
slr71 Oct 22, 2024
1c6dfab
CORE-2016: implemented the GET /v1/plans/:plan-id/active-rate endpoint
slr71 Oct 24, 2024
f59ea57
CORE-2016: implemented the POST /v1/plans/:plan-id/rates and GET /v1/…
slr71 Oct 24, 2024
9ec70b4
CORE-2016: added a missing swagger code annotation
slr71 Oct 24, 2024
4db2914
CORE-2016: updated the subscription endpoints to support plan rates a…
slr71 Oct 29, 2024
2ea589f
CORE-2016: fixed a lint warning
slr71 Oct 29, 2024
524185a
CORE-2016: added unique indexes on plan rates and plan quota defaults
slr71 Oct 29, 2024
c69bb51
CORE-2016: removed the all_active_users endpoint
slr71 Oct 29, 2024
5d84e2c
CORE-2016: added duplicate checks for plan quota defaults and plan rates
slr71 Oct 30, 2024
99476db
CORE-2016: added request body validation to the `POST /v1/plans/:plan…
slr71 Oct 30, 2024
fb8dffa
CORE-2016: fixed a bug in the PUT /v1/resource-types/:resource-type-i…
slr71 Oct 30, 2024
6b9d053
CORE-2016: added a response to the Swagger comments
slr71 Oct 30, 2024
fa43dc9
CORE-2016: removed some unused endpoints
slr71 Oct 30, 2024
266304a
CORE-2016: slight changes to the response body for the subscriptions …
slr71 Oct 31, 2024
ecc50af
CORE-2016: reimplemented GetDefaultQuotaValue in terms of GetDefaultQ…
slr71 Nov 1, 2024
2e51283
CORE-2016: fixed a few errors in the Swager docs
slr71 Nov 20, 2024
9bdd2e1
CORE-2016: fixed the capitalization on one of the JSON fields
slr71 Nov 20, 2024
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
5 changes: 5 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
QMS_DATABASE_URI=postgres://de@localhost/qms?sslmode=disable
QMS_DATABASE_MIGRATE=false
QMS_DATABASE_REINIT=false
QMS_USERNAME_SUFFIX=iplantcollaborative.org
Comment on lines +1 to +5
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found direnv to be extremely useful for development testing, so I thought I'd set it up for this repository.

19 changes: 19 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

_PWD=$(pwd)
_APP=`echo $_PWD | grep -Eo -i '([[:alnum:]-]*)$'`
echo "Starting $_APP environment..."
export PATH="$_PWD/bin:$PATH"

export PRJ_ROOT_DIR=$(realpath "$_PWD")

[ -f ${PRJ_ROOT_DIR}/.env ] && source ${PRJ_ROOT_DIR}/.env || { echo "Missing ${PRJ_ROOT_DIR}/.env!"; exit 1; }
## Export all VARS in .env
ALL_ENV_PRJ_VARS=($(grep -E '^[[:space:]]*[A-Z_][A-Z0-9_]*[[:space:]]*=' ${PRJ_ROOT_DIR}/.env | cut -f1 -d"=" | tr '\n' ' '))
for idx in "${!ALL_ENV_PRJ_VARS[@]}"; do
# echo "idx: $idx :: ${ALL_ENV_PRJ_VARS[idx]}=${!ALL_ENV_PRJ_VARS[idx]}"
eval "export ${ALL_ENV_PRJ_VARS[idx]}='${!ALL_ENV_PRJ_VARS[idx]}'"
done

## GOPRIVATE="gitlab.com/cyverse*,github.com/cyverse*,bitbucket.org/cyverse*"
export GOPRIVATE="gitlab.com/cyverse*"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ swagger.json
jobservices.yml
jobservices.yaml
dotenv

# Ignore .env files.
.env
14 changes: 0 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,14 @@ require (
require (
github.com/cyverse-de/go-mod/cfg v0.0.2
github.com/cyverse-de/go-mod/logging v0.0.3
github.com/cyverse-de/go-mod/pbinit v0.1.12
github.com/cyverse-de/go-mod/protobufjson v0.0.4
github.com/cyverse-de/p/go/qms v0.1.13
github.com/go-playground/validator/v10 v10.22.0
github.com/golang-migrate/migrate/v4 v4.17.1
github.com/labstack/echo/v4 v4.12.0
github.com/spirosoik/echo-logrus v1.0.0
)

require (
github.com/cyverse-de/go-mod/gotelnats v0.0.12 // indirect
github.com/cyverse-de/p v0.0.0-20240820230617-9e063fe10de8 // indirect
github.com/cyverse-de/p/go/analysis v0.0.16 // indirect
github.com/cyverse-de/p/go/containers v0.0.2 // indirect
github.com/cyverse-de/p/go/header v0.0.4 // indirect
github.com/cyverse-de/p/go/monitoring v0.0.5 // indirect
github.com/cyverse-de/p/go/svcerror v0.0.8 // indirect
github.com/cyverse-de/p/go/user v0.0.11 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
github.com/go-logr/logr v1.4.2 // indirect
Expand All @@ -66,17 +56,13 @@ require (
github.com/jackc/pgx/v5 v5.6.0 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/nats-io/nats.go v1.37.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/uptrace/opentelemetry-go-extra/otelsql v0.3.1 // indirect
go.opentelemetry.io/otel v1.29.0 // indirect
Expand Down
28 changes: 0 additions & 28 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,10 @@ github.com/cyverse-de/echo-middleware/v2 v2.0.3 h1:zu7t40uic5cLBCBt6LTH+04DLj3CZ
github.com/cyverse-de/echo-middleware/v2 v2.0.3/go.mod h1:cqXIRR0GOYcVFzU6yyRfv+QhMcFjoESiktswiulOGHk=
github.com/cyverse-de/go-mod/cfg v0.0.2 h1:evHNKqLwOPWHhxxzF498/Rtac7LZb1zxnHAjZSuqiEo=
github.com/cyverse-de/go-mod/cfg v0.0.2/go.mod h1:jjn1fZJRwqKiYgiS5AcXg9Dzxp2QOiLyrWVWCcq9Dw0=
github.com/cyverse-de/go-mod/gotelnats v0.0.12 h1:oq24rRC2Tsc2z/5d0cso9QqrSRq6ce+e0vfHlk+wtPA=
github.com/cyverse-de/go-mod/gotelnats v0.0.12/go.mod h1:n9+Qw8jV5z+w476xk3RRPBQzJQbA/fehv4UiXtL+Zqk=
github.com/cyverse-de/go-mod/logging v0.0.3 h1:sbehQImEP5cYusWVN1sDvo3lqwEfaZSCZLmrhFaI8xI=
github.com/cyverse-de/go-mod/logging v0.0.3/go.mod h1:KRRtiAvsBZlnR9qxXLFYaFdvJAJZKGYAIhRnjuORpIQ=
github.com/cyverse-de/go-mod/pbinit v0.1.12 h1:HA9q0ffLAzAbcEYJkhQigZXXl06juaAhuft/baIKbOg=
github.com/cyverse-de/go-mod/pbinit v0.1.12/go.mod h1:M5zde8HkoyViaCD1sT/8PNNiYCheCfwhktfaoI6lobA=
github.com/cyverse-de/go-mod/protobufjson v0.0.4 h1:UPZCpdg6zm30tNf/c8JCI+F/SewiqeF42Uwi13X8diU=
github.com/cyverse-de/go-mod/protobufjson v0.0.4/go.mod h1:SJuTgEbjy56L3QtVKiON/kAHM298Xd8F4Uq7kyU8nFo=
github.com/cyverse-de/p v0.0.0-20240820230617-9e063fe10de8 h1:7vJEIY4rqwf1S4LRvOioCWAKIDsz5dtNjG3kumBFB5c=
github.com/cyverse-de/p v0.0.0-20240820230617-9e063fe10de8/go.mod h1:JM04cBlOajBkOVfQOEbBD6QwmWyupji9J84wfUA+LTc=
github.com/cyverse-de/p/go/analysis v0.0.16 h1:E+SE/v3RE1znwnIzk4ugXiM0knVsBnTLmuv4fcvietc=
github.com/cyverse-de/p/go/analysis v0.0.16/go.mod h1:SJi4jTyxhqOe2waLcHKbDIN6+CZdV6WAJI2JWIrpFIQ=
github.com/cyverse-de/p/go/containers v0.0.2 h1:PIpw5KHC6A85KeloHms86zG5ADVAQXjsP05n8KEWeXE=
github.com/cyverse-de/p/go/containers v0.0.2/go.mod h1:Yzjby5JYINnpPkLadB0G+zFvxAzCx6V2vqyL170E33U=
github.com/cyverse-de/p/go/header v0.0.4 h1:asY/uixi9rCqbDLq2G21CT7WJRaendBfr1z2YTuK2hk=
github.com/cyverse-de/p/go/header v0.0.4/go.mod h1:1j79PqvJyMRmXXKyW4KbZWGQNontm0B9smsaq5t5Ct8=
github.com/cyverse-de/p/go/monitoring v0.0.5 h1:n+GdL9a3R1zM7L+18SIufrtmLxXU8L/cKX6DhOJ7IhY=
github.com/cyverse-de/p/go/monitoring v0.0.5/go.mod h1:CB0aMpTRJvCFlGeL/75uX4Snj/OXj9wzKF5KQX4tASg=
github.com/cyverse-de/p/go/qms v0.1.13 h1:4pcBCETTKwCYo9L3zfbQy92TXbaH/wv/VVyc3LGMl9E=
github.com/cyverse-de/p/go/qms v0.1.13/go.mod h1:Uv07x99AFaFmFwIwa3xTrN6bRxr76J7wK6R3Fgt/UG4=
github.com/cyverse-de/p/go/svcerror v0.0.8 h1:UE06rE31kk7OcciTQlZfrJTFlC9AMTfNf6JKll41u0U=
github.com/cyverse-de/p/go/svcerror v0.0.8/go.mod h1:0h/BngUR9cTV86LYqHMkdREFcxJuMyOJV6f3u6Un4LQ=
github.com/cyverse-de/p/go/user v0.0.11 h1:VM2WGrdvcmDLwwjUJpCbrhC5te8xFY8f71ALFO2N7LI=
github.com/cyverse-de/p/go/user v0.0.11/go.mod h1:g6Gl6+Zv0PlZMoydO2cBmLFTLwQs39gYauboxp769KE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -227,8 +207,6 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs=
github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -300,12 +278,6 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nats-io/nats.go v1.37.0 h1:07rauXbVnnJvv1gfIyghFEo6lUcYRY0WXc3x7x0vUxE=
github.com/nats-io/nats.go v1.37.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8=
github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI=
github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
Expand Down
39 changes: 0 additions & 39 deletions internal/controllers/admins.go

This file was deleted.

Loading
Loading