Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Unify ship release query
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jun 20, 2019
1 parent fc2e6cf commit bfdf40a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"upstreamContents": {
"appRelease": {
"id": "NyhODuspYvV9pTHlmMt20KAxbMAE8swq",
"sequence": 0,
"sequence": 2971,
"channelId": "iEKGvV-NI-i6uFS89JAbdJCzAXP1b7wr",
"channelName": "integration replicated.app amazon-eks-template",
"channelIcon": "",
Expand Down
2 changes: 1 addition & 1 deletion integration/init_app/basic/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"upstreamContents": {
"appRelease": {
"id": "pAb_dFxe4M4TdvkPWSdgDhgtpDbOcGAM",
"sequence": 0,
"sequence": 4603,
"channelId": "lD4lzjnjwOYzKbNsjK0JlcpzF19PswXz",
"channelName": "integration replicated.app basic",
"channelIcon": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"upstreamContents": {
"appRelease": {
"id": "jDtI-DiraCbkN5euJHmbS3kIFw4N1Iw9",
"sequence": 0,
"sequence": 9091,
"channelId": "_KVsR5SFu9Rj2IR6dxPhuBYcNIKtw6SI",
"channelName": "integration-test-docker",
"channelIcon": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"upstreamContents": {
"appRelease": {
"id": "ZibGNlJOl0RbgXiFKk358iGVL8lFOn26",
"sequence": 0,
"sequence": 9073,
"channelId": "M2JHDvnDhJbrDNRBQ1m-eEDRXbPiSLg9",
"channelName": "integration replicated.app github-template-func",
"channelIcon": "",
Expand Down
2 changes: 1 addition & 1 deletion integration/init_app/helm-github/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"upstreamContents": {
"appRelease": {
"id": "cZB0VTZLBexn0s53sMzVB0Id3VvSPcCZ",
"sequence": 0,
"sequence": 6060,
"channelId": "t_qVrkESBiqOa8ZraseeS38bXy-qgpSe",
"channelName": "integration replicated.app helm-github",
"channelIcon": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"upstreamContents": {
"appRelease": {
"id": "VFOvxrc3Bpu1doy2AtFGoypU6skZvXSZ",
"sequence": 0,
"sequence": 6680,
"channelId": "PH6juE8b84A4zOCO-SVzVNS_OHs-LEl3",
"channelName": "integration replicated.app installation-template-func",
"channelIcon": "",
Expand Down
2 changes: 1 addition & 1 deletion integration/update/app_basic/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"upstreamContents": {
"appRelease": {
"id": "pAb_dFxe4M4TdvkPWSdgDhgtpDbOcGAM",
"sequence": 0,
"sequence": 4603,
"channelId": "lD4lzjnjwOYzKbNsjK0JlcpzF19PswXz",
"channelName": "integration replicated.app basic",
"channelIcon": "",
Expand Down
66 changes: 14 additions & 52 deletions pkg/specs/replicatedapp/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,7 @@ import (
"github.com/spf13/viper"
)

const GetAppspecQuery = `
query($semver: String) {
shipRelease (semver: $semver) {
id
channelId
channelName
channelIcon
semver
releaseNotes
spec
images {
url
source
appSlug
imageKey
}
githubContents {
repo
path
ref
files {
name
path
sha
size
data
}
}
entitlements {
values {
key
value
labels {
key
value
}
}
meta {
customerID
lastUpdated
}
signature
}
created
registrySecret
}
}`

const GetSlugAppSpecQuery = `
query($appSlug: String!, $licenseID: String, $releaseID: String, $semver: String) {
shipSlugRelease (appSlug: $appSlug, licenseID: $licenseID, releaseID: $releaseID, semver: $semver) {
const ShipRelease = `
id
sequence
channelId
Expand Down Expand Up @@ -116,7 +66,19 @@ query($appSlug: String!, $licenseID: String, $releaseID: String, $semver: String
signature
}
created
registrySecret
registrySecret`

const GetAppspecQuery = `
query($semver: String) {
shipRelease (semver: $semver) {
` + ShipRelease + `
}
}`

const GetSlugAppSpecQuery = `
query($appSlug: String!, $licenseID: String, $releaseID: String, $semver: String) {
shipSlugRelease (appSlug: $appSlug, licenseID: $licenseID, releaseID: $releaseID, semver: $semver) {
` + ShipRelease + `
}
}`

Expand Down

0 comments on commit bfdf40a

Please sign in to comment.