Skip to content

Commit

Permalink
Add release-registry deploy failure notifications to #feed-sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Jan 23, 2025
1 parent d1815b7 commit fcfb7a8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GOCD_TOKEN="fake-token"
FEED_DEPLOY_CHANNEL_ID="9101112"
FEED_DEV_INFRA_CHANNEL_ID="13141516"
FEED_ENGINEERING_CHANNEL_ID="33333333"
FEED_SDKS_CHANNEL_ID="42424242"
DISABLE_GITHUB_METRICS="false"
FORCE_GET_USER_BY_SLACK_ID=
TEAM_OSPO_CHANNEL_ID=
Expand Down
25 changes: 24 additions & 1 deletion src/brain/gocd/gocdSlackFeeds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
FEED_INGEST_CHANNEL_ID,
FEED_SNS_SAAS_CHANNEL_ID,
FEED_SNS_ST_CHANNEL_ID,
FEED_SDKS_CHANNEL_ID,
GOCD_SENTRYIO_BE_PIPELINE_NAME,
} from '@/config';
import { SlackMessage } from '@/config/slackMessage';
Expand Down Expand Up @@ -46,7 +47,14 @@ const BACKEND_PIPELINE_FILTER = [

const GOCD_CUSTOM_JOB_PIPELINE_NAME = 'run-custom-job';

const INGEST_PIPELINE_FILTER = ['deploy-relay-processing', 'deploy-relay-pop'];
const INGEST_PIPELINE_FILTER = [

Check failure on line 50 in src/brain/gocd/gocdSlackFeeds/index.ts

View workflow job for this annotation

GitHub Actions / test

Replace `⏎··'deploy-relay-processing',⏎··'deploy-relay-pop'⏎` with `'deploy-relay-processing',·'deploy-relay-pop'`
'deploy-relay-processing',
'deploy-relay-pop'
];

const SDKS_PIPELINE_FILTER = [

Check failure on line 55 in src/brain/gocd/gocdSlackFeeds/index.ts

View workflow job for this annotation

GitHub Actions / test

Replace `⏎··'deploy-release-registry',⏎` with `'deploy-release-registry'`
'deploy-release-registry',
];

const SNS_SAAS_PIPELINE_FILTER = [
'deploy-snuba',
Expand Down Expand Up @@ -284,6 +292,20 @@ const ingestFeed = new DeployFeed({
},
});

// Post certain pipelines to #feed-sdks
const sdksFeed = new DeployFeed({
feedName: 'sdksSlackFeed',
channelID: FEED_SDKS_CHANNEL_ID,
msgType: SlackMessage.FEED_SDKS_DEPLOY,
pipelineFilter: (pipeline) => {
if (!SDKS_PIPELINE_FILTER.includes(pipeline.name)) {
return false;
}

return pipeline.stage.result.toLowerCase() === 'failed';

Check warning on line 305 in src/brain/gocd/gocdSlackFeeds/index.ts

View check run for this annotation

Codecov / codecov/patch

src/brain/gocd/gocdSlackFeeds/index.ts#L305

Added line #L305 was not covered by tests
},
});

// Post certain pipelines to #discuss-backend
const discussBackendFeed = new DeployFeed({
feedName: 'discussBackendSlackFeed',
Expand Down Expand Up @@ -411,6 +433,7 @@ export async function handler(body: GoCDResponse) {
discussSnSFeed.handle(body),
goCDCustomJobRunnerFeed.handle(body),
ingestFeed.handle(body),
sdksFeed.handle(body),
snsS4SK8sFeed.handle(body),
snsSaaSFeed.handle(body),
snsSaaSK8sFeed.handle(body),
Expand Down
2 changes: 2 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export const FEED_SNS_ST_CHANNEL_ID = // #feed-sns-st
process.env.FEED_SNS_ST_CHANNEL_ID || 'C0596EHDD9N';
export const FEED_INGEST_CHANNEL_ID = // #discuss-ingest
process.env.FEED_INGEST_CHANNEL_ID || 'C019637C760';
export const FEED_SDKS_CHANNEL_ID = // #feed-sdks
process.env.FEED_SDKS_CHANNEL_ID || 'C05KQ0EMAT1';
export const FEED_GOCD_JOB_RUNNER_CHANNEL_ID = // #feed-gocd-job-runner
process.env.FEED_GOCD_JOB_RUNNER_CHANNEL_ID || 'C07E8TG7VJP';
export const KAFKA_CONTROL_PLANE_CHANNEL_ID = // #feed-topicctl
Expand Down
1 change: 1 addition & 0 deletions src/config/slackMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum SlackMessage {
FEED_SNS_SAAS_DEPLOY = 'feed-sns-saas-deploy',
FEED_SNS_ST_DEPLOY = 'feed-sns-st-deploy',
FEED_INGEST_DEPLOY = 'feed-ingest-deploy',
FEED_SDKS_DEPLOY = 'feed-sdk-deploy',
FEED_SNS_SAAS_K8S = 'feed-sns-saas-k8s',
FEED_SNS_S4S_K8S = 'feed-sns-st-k8s',
DISCUSS_BACKEND_DEPLOY = 'discuss-backend-deploy',
Expand Down

0 comments on commit fcfb7a8

Please sign in to comment.