Skip to content

Commit

Permalink
Merge branch 'main' into tf-svc-workflow-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherjturner authored Aug 29, 2024
2 parents 5b84bb3 + e1eb932 commit b8dbbc1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/api/create-repository/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const createRepositoryController = {
request,
config.get('workflows.createRepository'),
repositoryName,
team,
team.github,
['cdp', 'repository'],
{ repositoryVisibility: visibility }
)
Expand Down
2 changes: 1 addition & 1 deletion src/api/create-test-suite/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const createTestSuiteController = {
request,
config.get('workflows.createJourneyTest'),
repositoryName,
team,
team.github,
['cdp', 'repository', 'test-suite', 'journey']
)

Expand Down
6 changes: 1 addition & 5 deletions src/api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { sqsClient } from '~/src/plugins/sqs-client'
import { pulse } from '~/src/plugins/pulse'

const enableSecureContext = config.get('enableSecureContext')
const enablePulse = config.get('enablePulse')

async function createServer() {
setupWreckAgents(proxyAgent())
Expand Down Expand Up @@ -55,11 +54,8 @@ async function createServer() {
await server.register(secureContext)
}

if (enablePulse) {
await server.register(pulse)
}

await server.register([
pulse,
azureOidc,
sqsClient,
mongoDb,
Expand Down
6 changes: 0 additions & 6 deletions src/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,6 @@ const config = convict({
default: [],
env: 'DEPLOY_FROM_FILE_ENVIRONMENTS'
},
enablePulse: {
doc: 'Enable Pulse',
format: Boolean,
default: isProduction,
env: 'ENABLE_PULSE'
},
enableSecureContext: {
doc: 'Enable Secure Context',
format: Boolean,
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/create/create-microservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function createMicroservice(
request,
config.get('workflows.createMicroService'),
repositoryName,
team,
team.github,
topics,
{
serviceTypeTemplate
Expand All @@ -96,7 +96,7 @@ async function createMicroservice(
redis_enabled: zone === 'public' ? 'true' : 'false',
service_code: team.serviceCodes?.at(0) ?? ''
}),
createAppConfig(request, repositoryName),
createAppConfig(request, repositoryName, team.github),
createNginxUpstreams(request, repositoryName, zone),
createSquidConfig(request, repositoryName),
createDashboard(request, repositoryName, zone)
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/create/create-microservice.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ describe('#create-test-runner-suite', () => {
config.get('github.repos.cdpAppConfig'),
config.get('workflows.createAppConfig'),
{
service
service,
team: 'test'
}
)

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/create/create-test-runner-suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function createTestRunnerSuite(
request,
templateWorkflow,
repositoryName,
team,
team.github,
topics
),
createSquidConfig(request, repositoryName),
Expand Down
6 changes: 4 additions & 2 deletions src/helpers/create/workflows/create-app-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ import { createResourceFromWorkflow } from '~/src/helpers/create/workflows/creat
*
* @param {{ db: import('mongodb').Db, logger: import('pino').Logger}} request
* @param {string} service
* @param {{string}} team
* @returns {Promise<void>}
*/
const createAppConfig = async (request, service) => {
const createAppConfig = async (request, service, team) => {
const org = config.get('github.org')
const repo = config.get('github.repos.cdpAppConfig')
const workflow = config.get('workflows.createAppConfig')

await createResourceFromWorkflow(request, service, org, repo, workflow, {
service
service,
team
})
}

Expand Down
12 changes: 6 additions & 6 deletions src/helpers/create/workflows/create-templated-repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { createResourceFromWorkflow } from '~/src/helpers/create/workflows/creat
* Creates a new GitHub repository from a template
*
* @param {{ db: import('mongodb').Db, logger: import('pino').Logger}} request
* @param {string} workflow - name of the workflow in cdpCreateWorkflows to use
* @param {string} repositoryName - name of the GitHub repo to be created
* @param {{github: string}} team - team that will own the repo
* @param {string[]} githubTopics - list of topics to add to the repo
* @param {Object} extraInputs - extra fields to pass to the job
* @param {string} workflow - name of the workflow in cdpCreateWorkflows to use
* @param {string} repositoryName - name of the GitHub repo to be created
* @param {string} team - team that will own the repo
* @param {string[]} githubTopics - list of topics to add to the repo
* @param {Object} extraInputs - extra fields to pass to the job
* @returns {Promise<void>}
*/
async function createTemplatedRepo(
Expand All @@ -32,7 +32,7 @@ async function createTemplatedRepo(
{
...extraInputs,
repositoryName,
team: team.github,
team,
additionalGitHubTopics: githubTopics.toString()
}
)
Expand Down

0 comments on commit b8dbbc1

Please sign in to comment.