Skip to content
Merged
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
4 changes: 4 additions & 0 deletions docs/schema/yaml/1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ services:
# @param services.github.deployment.node_affinity
node_affinity:

# @param services.github.envLens
envLens: false
# @param services.docker
docker:
# @param services.docker.dockerImage (required)
Expand Down Expand Up @@ -667,6 +669,8 @@ services:
# @param services.docker.deployment.node_affinity
node_affinity:

# @param services.docker.envLens
envLens: false
# @param services.externalHttp
externalHttp:
# @param services.externalHttp.defaultInternalHostname (required)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/webhooks/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {

const isBot = sender?.includes('[bot]') === true;
if (event === 'issue_comment' && isBot) {
tracer.scope().active()?.setTag('manual.drop', true);
tracer.scope?.()?.active?.()?.setTag('manual.drop', true);
res.status(200).end();
return;
}
Expand Down
29 changes: 29 additions & 0 deletions src/server/db/migrations/007_add_envlens_to_deployables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright 2025 GoodRx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Knex } from 'knex';

export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('deployables', (table) => {
table.boolean('envLens').nullable().defaultTo(false);
});
}

export async function down(knex: Knex): Promise<void> {
await knex.schema.alterTable('deployables', (table) => {
table.dropColumn('envLens');
});
}
118 changes: 94 additions & 24 deletions src/server/lib/jsonschema/schemas/1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"type": "number"
}
},
"required": ["name"]
"required": [
"name"
]
}
},
"optionalServices": {
Expand All @@ -67,7 +69,9 @@
"type": "number"
}
},
"required": ["name"]
"required": [
"name"
]
}
},
"webhooks": {
Expand Down Expand Up @@ -120,7 +124,9 @@
"type": "number"
}
},
"required": ["image"]
"required": [
"image"
]
},
"command": {
"type": "object",
Expand All @@ -136,13 +142,20 @@
"type": "number"
}
},
"required": ["image", "script"]
"required": [
"image",
"script"
]
},
"env": {
"type": "object"
}
},
"required": ["state", "type", "env"]
"required": [
"state",
"type",
"env"
]
}
}
}
Expand Down Expand Up @@ -174,7 +187,9 @@
"type": "string"
}
},
"required": ["name"]
"required": [
"name"
]
}
},
"deploymentDependsOn": {
Expand Down Expand Up @@ -292,7 +307,9 @@
}
}
},
"required": ["name"]
"required": [
"name"
]
},
"envLens": {
"type": "boolean"
Expand Down Expand Up @@ -364,7 +381,9 @@
"minItems": 1
}
},
"required": ["dockerfilePath"]
"required": [
"dockerfilePath"
]
},
"init": {
"type": "object",
Expand All @@ -383,10 +402,15 @@
"type": "object"
}
},
"required": ["dockerfilePath"]
"required": [
"dockerfilePath"
]
}
},
"required": ["defaultTag", "app"]
"required": [
"defaultTag",
"app"
]
}
}
},
Expand Down Expand Up @@ -630,7 +654,11 @@
"type": "string"
}
},
"required": ["name", "mountPath", "storageSize"]
"required": [
"name",
"mountPath",
"storageSize"
]
}
},
"node_selector": {
Expand All @@ -646,7 +674,10 @@
}
}
},
"required": ["repository", "branchName"]
"required": [
"repository",
"branchName"
]
},
"github": {
"type": "object",
Expand Down Expand Up @@ -716,7 +747,9 @@
"minItems": 1
}
},
"required": ["dockerfilePath"]
"required": [
"dockerfilePath"
]
},
"init": {
"type": "object",
Expand All @@ -735,10 +768,15 @@
"type": "object"
}
},
"required": ["dockerfilePath"]
"required": [
"dockerfilePath"
]
}
},
"required": ["defaultTag", "app"]
"required": [
"defaultTag",
"app"
]
},
"deployment": {
"type": "object",
Expand Down Expand Up @@ -943,7 +981,11 @@
"type": "string"
}
},
"required": ["name", "mountPath", "storageSize"]
"required": [
"name",
"mountPath",
"storageSize"
]
}
},
"node_selector": {
Expand All @@ -957,9 +999,16 @@
"description": "Full Kubernetes nodeAffinity object for advanced node selection"
}
}
},
"envLens": {
"type": "boolean"
}
},
"required": ["repository", "branchName", "docker"]
"required": [
"repository",
"branchName",
"docker"
]
},
"docker": {
"type": "object",
Expand Down Expand Up @@ -1186,7 +1235,11 @@
"type": "string"
}
},
"required": ["name", "mountPath", "storageSize"]
"required": [
"name",
"mountPath",
"storageSize"
]
}
},
"node_selector": {
Expand All @@ -1200,9 +1253,15 @@
"description": "Full Kubernetes nodeAffinity object for advanced node selection"
}
}
},
"envLens": {
"type": "boolean"
}
},
"required": ["dockerImage", "defaultTag"]
"required": [
"dockerImage",
"defaultTag"
]
},
"externalHttp": {
"type": "object",
Expand All @@ -1215,7 +1274,10 @@
"type": "string"
}
},
"required": ["defaultInternalHostname", "defaultPublicUrl"]
"required": [
"defaultInternalHostname",
"defaultPublicUrl"
]
},
"auroraRestore": {
"type": "object",
Expand All @@ -1228,7 +1290,10 @@
"type": "string"
}
},
"required": ["command", "arguments"]
"required": [
"command",
"arguments"
]
},
"configuration": {
"type": "object",
Expand All @@ -1241,11 +1306,16 @@
"type": "string"
}
},
"required": ["defaultTag", "branchName"]
"required": [
"defaultTag",
"branchName"
]
}
},
"required": ["name"]
"required": [
"name"
]
}
}
}
}
}
2 changes: 2 additions & 0 deletions src/server/lib/yamlSchemas/schema_1_0_0/schema_1_0_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ const schema_1_0_0 = {
branchName: { type: 'string' },
docker,
deployment,
envLens: { type: 'boolean' },
},
required: ['repository', 'branchName', 'docker'],
},
Expand All @@ -175,6 +176,7 @@ const schema_1_0_0 = {
env: { type: 'object' },
ports: { type: 'array' },
deployment,
envLens: { type: 'boolean' },
},
required: ['dockerImage', 'defaultTag'],
},
Expand Down
1 change: 1 addition & 0 deletions src/server/models/Deployable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default class Deployable extends Service {
deploymentDependsOn: string[];
kedaScaleToZero: KedaScaleToZero;
builder: Builder;
envLens?: boolean;

static relationMappings = {
environment: {
Expand Down
15 changes: 15 additions & 0 deletions src/server/models/yaml/YamlService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export interface GithubService extends Service {
readonly init?: InitDockerConfig;
};
readonly deployment?: DeploymentConfig;
readonly envLens?: boolean;
};
}

Expand Down Expand Up @@ -119,6 +120,7 @@ export interface DockerServiceConfig {
readonly env?: Record<string, string>;
readonly ports?: number[];
readonly deployment?: DeploymentConfig;
readonly envLens?: boolean;
}

export interface CodefreshService extends Service {
Expand Down Expand Up @@ -911,6 +913,19 @@ export function getBuilder(service: Service): Builder {
return {};
}

export function getEnvLens(service: Service): boolean {
switch (getDeployType(service)) {
case DeployTypes.GITHUB:
return (service as GithubService)?.github?.envLens ?? false;
case DeployTypes.DOCKER:
return (service as DockerService)?.docker?.envLens ?? false;
case DeployTypes.HELM:
return (service as unknown as HelmService)?.helm?.envLens ?? false;
default:
return false;
}
}

export async function getEcr(service: Service): Promise<string> {
const svc = service as unknown as HelmService;
const ecr = svc?.helm?.docker?.ecr;
Expand Down
2 changes: 2 additions & 0 deletions src/server/services/__tests__/deployable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ describe('Deployable Service', () => {
SOURCE: 'yaml',
TOKEN1: 'abcdefghijk',
},
envLens: false,
port: '8080,8089,8888',
initArguments:
'-c%%SPLIT%%local%%SPLIT%%-i%%SPLIT%%./sysops/ansible/spinnaker_inventory.py%%SPLIT%%./sysops/ansible/playbooks/lifecycle.yaml',
Expand Down Expand Up @@ -323,6 +324,7 @@ describe('Deployable Service', () => {
SOURCE: 'yaml',
TOKEN1: 'abcdefghijk',
},
envLens: false,
port: '8080,8089,8888',
initArguments:
'-c%%SPLIT%%local%%SPLIT%%-i%%SPLIT%%./sysops/ansible/spinnaker_inventory.py%%SPLIT%%./sysops/ansible/playbooks/lifecycle.yaml',
Expand Down
Loading