Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(1-3247): remove explicit "in project" text from change request ev…
…ent text (#9091) We got an event for a scheduled application success today that looked a little something like this: > Successfully applied the scheduled change request #1168 in the production environment in project eg by gaston in project eg. Notice that we're stating the project twice (once with a link (removed here) and once without). This PR removes the redundancy in CR events: The project is already included in the `changeRequest` variable, which is populated in `src/lib/addons/feature-event-formatter-md.ts` by the `generateChangeRequestLink` function. The (current) definition is: ```typescript generateChangeRequestLink(event: IEvent): string | undefined { const { preData, data, project, environment } = event; const changeRequestId = data?.changeRequestId || preData?.changeRequestId; if (project && changeRequestId) { const url = `${this.unleashUrl}/projects/${project}/change-requests/${changeRequestId}`; const text = `#${changeRequestId}`; const featureLink = this.generateFeatureLink(event); const featureText = featureLink ? ` for feature flag ${this.bold(featureLink)}` : ''; const environmentText = environment ? ` in the ${this.bold(environment)} environment` : ''; const projectLink = this.generateProjectLink(event); const projectText = project ? ` in project ${this.bold(projectLink)}` : ''; if (this.linkStyle === LinkStyle.SLACK) { return `${this.bold(`<${url}|${text}>`)}${featureText}${environmentText}${projectText}`; } else { return `${this.bold(`[${text}](${url})`)}${featureText}${environmentText}${projectText}`; } } } ``` Which includes links, env, and project info already.
- Loading branch information