mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(core): Decouple source control telemetry from internal hooks (no-changelog) (#10095)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import Container, { Service } from 'typedi';
|
||||
import { Service } from 'typedi';
|
||||
import path from 'path';
|
||||
import {
|
||||
getTagsPath,
|
||||
@@ -30,7 +30,7 @@ import type { TagEntity } from '@db/entities/TagEntity';
|
||||
import type { Variables } from '@db/entities/Variables';
|
||||
import type { SourceControlWorkflowVersionId } from './types/sourceControlWorkflowVersionId';
|
||||
import type { ExportableCredential } from './types/exportableCredential';
|
||||
import { InternalHooks } from '@/InternalHooks';
|
||||
import { EventRelay } from '@/eventbus/event-relay.service';
|
||||
import { TagRepository } from '@db/repositories/tag.repository';
|
||||
import { Logger } from '@/Logger';
|
||||
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
@@ -52,6 +52,7 @@ export class SourceControlService {
|
||||
private sourceControlExportService: SourceControlExportService,
|
||||
private sourceControlImportService: SourceControlImportService,
|
||||
private tagRepository: TagRepository,
|
||||
private readonly eventRelay: EventRelay,
|
||||
) {
|
||||
const { gitFolder, sshFolder, sshKeyName } = sourceControlPreferencesService;
|
||||
this.gitFolder = gitFolder;
|
||||
@@ -291,7 +292,8 @@ export class SourceControlService {
|
||||
});
|
||||
|
||||
// #region Tracking Information
|
||||
void Container.get(InternalHooks).onSourceControlUserFinishedPushUI(
|
||||
this.eventRelay.emit(
|
||||
'source-control-user-finished-push-ui',
|
||||
getTrackingInformationFromPostPushResult(statusResult),
|
||||
);
|
||||
// #endregion
|
||||
@@ -368,7 +370,8 @@ export class SourceControlService {
|
||||
}
|
||||
|
||||
// #region Tracking Information
|
||||
void Container.get(InternalHooks).onSourceControlUserFinishedPullUI(
|
||||
this.eventRelay.emit(
|
||||
'source-control-user-finished-pull-ui',
|
||||
getTrackingInformationFromPullResult(statusResult),
|
||||
);
|
||||
// #endregion
|
||||
@@ -421,11 +424,13 @@ export class SourceControlService {
|
||||
|
||||
// #region Tracking Information
|
||||
if (options.direction === 'push') {
|
||||
void Container.get(InternalHooks).onSourceControlUserStartedPushUI(
|
||||
this.eventRelay.emit(
|
||||
'source-control-user-started-push-ui',
|
||||
getTrackingInformationFromPrePushResult(sourceControlledFiles),
|
||||
);
|
||||
} else if (options.direction === 'pull') {
|
||||
void Container.get(InternalHooks).onSourceControlUserStartedPullUI(
|
||||
this.eventRelay.emit(
|
||||
'source-control-user-started-pull-ui',
|
||||
getTrackingInformationFromPullResult(sourceControlledFiles),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user