Skip to content

Commit 1af6e97

Browse files
committed
refactor: rename service
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent a736f47 commit 1af6e97

12 files changed

Lines changed: 27 additions & 27 deletions

File tree

scripts/builders/automatic-project-discovery-worker.env

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DOCKERFILE="./services/docker/Dockerfile.automatic_projects_discovery_worker"
2+
CONTEXT="../"
3+
REPO="sjc.ocir.io/axbydjxa5zuh/automatic-projects-discovery-worker"
4+
SERVICES="automatic-projects-discovery-worker"

scripts/services/automatic-project-discovery-worker.yaml renamed to scripts/services/automatic-projects-discovery-worker.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ version: '3.1'
33
x-env-args: &env-args
44
DOCKER_BUILDKIT: 1
55
NODE_ENV: docker
6-
SERVICE: automatic-project-discovery-worker
7-
CROWD_TEMPORAL_TASKQUEUE: automatic-project-discovery
6+
SERVICE: automatic-projects-discovery-worker
7+
CROWD_TEMPORAL_TASKQUEUE: automatic-projects-discovery
88
SHELL: /bin/sh
99

1010
services:
11-
automatic-project-discovery-worker:
11+
automatic-projects-discovery-worker:
1212
build:
1313
context: ../../
14-
dockerfile: ./scripts/services/docker/Dockerfile.automatic_project_discovery_worker
14+
dockerfile: ./scripts/services/docker/Dockerfile.automatic_projects_discovery_worker
1515
command: 'pnpm run start'
16-
working_dir: /usr/crowd/app/services/apps/automatic_project_discovery_worker
16+
working_dir: /usr/crowd/app/services/apps/automatic_projects_discovery_worker
1717
env_file:
1818
- ../../backend/.env.dist.local
1919
- ../../backend/.env.dist.composed
@@ -25,20 +25,20 @@ services:
2525
networks:
2626
- crowd-bridge
2727

28-
automatic-project-discovery-worker-dev:
28+
automatic-projects-discovery-worker-dev:
2929
build:
3030
context: ../../
31-
dockerfile: ./scripts/services/docker/Dockerfile.automatic_project_discovery_worker
31+
dockerfile: ./scripts/services/docker/Dockerfile.automatic_projects_discovery_worker
3232
command: 'pnpm run dev'
33-
working_dir: /usr/crowd/app/services/apps/automatic_project_discovery_worker
33+
working_dir: /usr/crowd/app/services/apps/automatic_projects_discovery_worker
3434
env_file:
3535
- ../../backend/.env.dist.local
3636
- ../../backend/.env.dist.composed
3737
- ../../backend/.env.override.local
3838
- ../../backend/.env.override.composed
3939
environment:
4040
<<: *env-args
41-
hostname: automatic-project-discovery-worker
41+
hostname: automatic-projects-discovery-worker
4242
networks:
4343
- crowd-bridge
4444
volumes:
@@ -57,7 +57,7 @@ services:
5757
- ../../services/libs/telemetry/src:/usr/crowd/app/services/libs/telemetry/src
5858
- ../../services/libs/temporal/src:/usr/crowd/app/services/libs/temporal/src
5959
- ../../services/libs/types/src:/usr/crowd/app/services/libs/types/src
60-
- ../../services/apps/automatic_project_discovery_worker/src:/usr/crowd/app/services/apps/automatic_project_discovery_worker/src
60+
- ../../services/apps/automatic_projects_discovery_worker/src:/usr/crowd/app/services/apps/automatic_projects_discovery_worker/src
6161

6262
networks:
6363
crowd-bridge:

scripts/services/docker/Dockerfile.automatic_project_discovery_worker renamed to scripts/services/docker/Dockerfile.automatic_projects_discovery_worker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ COPY --from=builder /usr/crowd/app/node_modules ./node_modules
2020
COPY --from=builder /usr/crowd/app/services/base.tsconfig.json ./services/base.tsconfig.json
2121
COPY --from=builder /usr/crowd/app/services/libs ./services/libs
2222
COPY --from=builder /usr/crowd/app/services/archetypes/ ./services/archetypes
23-
COPY --from=builder /usr/crowd/app/services/apps/automatic_project_discovery_worker/ ./services/apps/automatic_project_discovery_worker
23+
COPY --from=builder /usr/crowd/app/services/apps/automatic_projects_discovery_worker/ ./services/apps/automatic_projects_discovery_worker

services/apps/automatic_project_discovery_worker/package.json renamed to services/apps/automatic_projects_discovery_worker/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@crowd/automatic-project-discovery-worker",
2+
"name": "@crowd/automatic-projects-discovery-worker",
33
"scripts": {
4-
"start": "CROWD_TEMPORAL_TASKQUEUE=automatic-project-discovery SERVICE=automatic-project-discovery-worker tsx src/main.ts",
5-
"start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && CROWD_TEMPORAL_TASKQUEUE=automatic-project-discovery SERVICE=automatic-project-discovery-worker LOG_LEVEL=trace tsx --inspect=0.0.0.0:9232 src/main.ts",
6-
"start:debug": "CROWD_TEMPORAL_TASKQUEUE=automatic-project-discovery SERVICE=automatic-project-discovery-worker LOG_LEVEL=trace tsx --inspect=0.0.0.0:9232 src/main.ts",
4+
"start": "CROWD_TEMPORAL_TASKQUEUE=automatic-projects-discovery SERVICE=automatic-projects-discovery-worker tsx src/main.ts",
5+
"start:debug:local": "set -a && . ../../../backend/.env.dist.local && . ../../../backend/.env.override.local && set +a && CROWD_TEMPORAL_TASKQUEUE=automatic-projects-discovery SERVICE=automatic-projects-discovery-worker LOG_LEVEL=trace tsx --inspect=0.0.0.0:9232 src/main.ts",
6+
"start:debug": "CROWD_TEMPORAL_TASKQUEUE=automatic-projects-discovery SERVICE=automatic-projects-discovery-worker LOG_LEVEL=trace tsx --inspect=0.0.0.0:9232 src/main.ts",
77
"dev:local": "nodemon --watch src --watch ../../libs --ext ts --exec pnpm run start:debug:local",
88
"dev": "nodemon --watch src --watch ../../libs --ext ts --exec pnpm run start:debug",
99
"lint": "npx eslint --ext .ts src --max-warnings=0",

services/apps/automatic_project_discovery_worker/src/activities.ts renamed to services/apps/automatic_projects_discovery_worker/src/activities.ts

File renamed without changes.

services/apps/automatic_project_discovery_worker/src/activities/activities.ts renamed to services/apps/automatic_projects_discovery_worker/src/activities/activities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { getServiceLogger } from '@crowd/logging'
33
const log = getServiceLogger()
44

55
export async function logDiscoveryRun(): Promise<void> {
6-
log.info('Automatic project discovery workflow executed successfully.')
6+
log.info('Automatic projects discovery workflow executed successfully.')
77
}

services/apps/automatic_project_discovery_worker/src/main.ts renamed to services/apps/automatic_projects_discovery_worker/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Config } from '@crowd/archetype-standard'
22
import { Options, ServiceWorker } from '@crowd/archetype-worker'
33

4-
import { scheduleProjectDiscovery } from './schedules/scheduleProjectDiscovery'
4+
import { scheduleProjectsDiscovery } from './schedules/scheduleProjectsDiscovery'
55

66
const config: Config = {
77
envvars: [],
@@ -30,7 +30,7 @@ export const svc = new ServiceWorker(config, options)
3030
setImmediate(async () => {
3131
await svc.init()
3232

33-
await scheduleProjectDiscovery()
33+
await scheduleProjectsDiscovery()
3434

3535
await svc.start()
3636
})

services/apps/automatic_project_discovery_worker/src/schedules/scheduleProjectDiscovery.ts renamed to services/apps/automatic_projects_discovery_worker/src/schedules/scheduleProjectsDiscovery.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { discoverProjects } from '../workflows'
55

66
const DEFAULT_CRON = '0 2 * * *' // Daily at 2:00 AM
77

8-
export const scheduleProjectDiscovery = async () => {
9-
const cronExpression = process.env.CROWD_AUTOMATIC_PROJECT_DISCOVERY_CRON || DEFAULT_CRON
8+
export const scheduleProjectsDiscovery = async () => {
9+
const cronExpression = process.env.CROWD_AUTOMATIC_PROJECTS_DISCOVERY_CRON || DEFAULT_CRON
1010

11-
svc.log.info(`Scheduling project discovery with cron: ${cronExpression}`)
11+
svc.log.info(`Scheduling projects discovery with cron: ${cronExpression}`)
1212

1313
try {
1414
await svc.temporal.schedule.create({
15-
scheduleId: 'automaticProjectDiscovery',
15+
scheduleId: 'automaticProjectsDiscovery',
1616
spec: {
1717
cronExpressions: [cronExpression],
1818
},
@@ -23,7 +23,7 @@ export const scheduleProjectDiscovery = async () => {
2323
action: {
2424
type: 'startWorkflow',
2525
workflowType: discoverProjects,
26-
taskQueue: 'automatic-project-discovery',
26+
taskQueue: 'automatic-projects-discovery',
2727
retry: {
2828
initialInterval: '15 seconds',
2929
backoffCoefficient: 2,

services/apps/automatic_project_discovery_worker/src/workflows.ts renamed to services/apps/automatic_projects_discovery_worker/src/workflows.ts

File renamed without changes.

0 commit comments

Comments
 (0)