mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-06 16:19:07 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a90238908 | ||
|
|
fd1dfdd9d8 | ||
|
|
2e88843980 | ||
|
|
1c3ee79827 | ||
|
|
d35beb1f08 |
@@ -71,11 +71,6 @@ jobs:
|
|||||||
sudo mv helmfile /usr/local/bin/
|
sudo mv helmfile /usr/local/bin/
|
||||||
helmfile --version
|
helmfile --version
|
||||||
|
|
||||||
- name: Install Helm Diff plugin
|
|
||||||
run: |
|
|
||||||
helm plugin install https://github.com/databus23/helm-diff --version v3.9.3
|
|
||||||
helm diff version
|
|
||||||
|
|
||||||
- name: Debug Helm env
|
- name: Debug Helm env
|
||||||
run: |
|
run: |
|
||||||
helm env
|
helm env
|
||||||
@@ -107,5 +102,4 @@ jobs:
|
|||||||
- name: Run Helmfile Diff
|
- name: Run Helmfile Diff
|
||||||
env:
|
env:
|
||||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
HELM_PLUGINS: /home/runner/.local/share/helm/plugins
|
|
||||||
run: helmfile -f deploy/helmfiles/${ENV}.yaml diff
|
run: helmfile -f deploy/helmfiles/${ENV}.yaml diff
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ maestro:
|
|||||||
open_customer_id: f239718a-a271-4ef9-ae7e-02a2f0f3aa6e
|
open_customer_id: f239718a-a271-4ef9-ae7e-02a2f0f3aa6e
|
||||||
open_group_id: 401573bb-334f-44b2-b30e-88d4cea31ae9
|
open_group_id: 401573bb-334f-44b2-b30e-88d4cea31ae9
|
||||||
platform_api_url: https://oz8v2zid1e.execute-api.us-east-1.amazonaws.com
|
platform_api_url: https://oz8v2zid1e.execute-api.us-east-1.amazonaws.com
|
||||||
|
connections_api_url: https://wv6fw7ayj4.execute-api.us-east-1.amazonaws.com
|
||||||
storage_explorer_api_url: "https://storage-explorer-{customer}.dadosfera.ai/api"
|
storage_explorer_api_url: "https://storage-explorer-{customer}.dadosfera.ai/api"
|
||||||
dedicated_proxy: ""
|
dedicated_proxy: ""
|
||||||
restricted_ip: ""
|
restricted_ip: ""
|
||||||
|
|||||||
+2
-93
@@ -4574,7 +4574,6 @@
|
|||||||
"get": {
|
"get": {
|
||||||
"operationId": "PlatformApiController_getPipelineRunJobs",
|
"operationId": "PlatformApiController_getPipelineRunJobs",
|
||||||
"summary": "Get pipeline run jobs",
|
"summary": "Get pipeline run jobs",
|
||||||
"description": "Proxies platform-api DB-backed job runs and returns `{ jobs: [...] }`.",
|
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "pipelineId",
|
"name": "pipelineId",
|
||||||
@@ -4595,22 +4594,11 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "DB-backed job runs for the selected pipeline run.",
|
"description": "",
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object"
|
||||||
"properties": {
|
|
||||||
"jobs": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"jobs"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5538,48 +5526,6 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/catalog/custom-properties": {
|
|
||||||
"get": {
|
|
||||||
"operationId": "CatalogController_getCustomPropertyDefinitions",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dadosfera-lang",
|
|
||||||
"in": "header",
|
|
||||||
"required": false,
|
|
||||||
"schema": {
|
|
||||||
"enum": [
|
|
||||||
"pt-br",
|
|
||||||
"en-us"
|
|
||||||
],
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"Catalog"
|
|
||||||
],
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"access-token": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"access-token": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/catalog/data-asset/{id}": {
|
"/catalog/data-asset/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "CatalogController_getDataAsset",
|
"operationId": "CatalogController_getDataAsset",
|
||||||
@@ -11087,37 +11033,6 @@
|
|||||||
"docs"
|
"docs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"CustomPropertyDto": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"key": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"text",
|
|
||||||
"number",
|
|
||||||
"date",
|
|
||||||
"boolean"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"color": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"emoji": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"key",
|
|
||||||
"value",
|
|
||||||
"type"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"IUpdateDataRequest": {
|
"IUpdateDataRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -11146,12 +11061,6 @@
|
|||||||
},
|
},
|
||||||
"docs": {
|
"docs": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
|
||||||
"custom_properties": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/CustomPropertyDto"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|||||||
Generated
+4
-4
@@ -16,7 +16,7 @@
|
|||||||
"@aws-sdk/lib-dynamodb": "^3.414.0",
|
"@aws-sdk/lib-dynamodb": "^3.414.0",
|
||||||
"@aws-sdk/signature-v4": "^3.370.0",
|
"@aws-sdk/signature-v4": "^3.370.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack-v2": "^3.40.0-beta.14",
|
"@dadosfera/protospack-v2": "^3.40.0-beta.10",
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"@grpc/proto-loader": "^0.7.9",
|
"@grpc/proto-loader": "^0.7.9",
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
@@ -1735,9 +1735,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dadosfera/protospack-v2": {
|
"node_modules/@dadosfera/protospack-v2": {
|
||||||
"version": "3.40.0-beta.14",
|
"version": "3.40.0-beta.10",
|
||||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.40.0-beta.14.tgz",
|
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.40.0-beta.10.tgz",
|
||||||
"integrity": "sha512-pv3pxq0x1XcBgf3ajD6QOFRLOduh8iEozKFA3AKlIW4gid+gT4iL0GcU2M+O7h0QFeO4JIzRZe/nEMN82nqk7A==",
|
"integrity": "sha512-F45dSEIKG+gwwDMYHayA242bFwhFTJbZm26KesQbGhf4I45ur6hYZD8dK0voNuVQInLMQhtm6+7th6/jJ8xpTQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@
|
|||||||
"@aws-sdk/lib-dynamodb": "^3.414.0",
|
"@aws-sdk/lib-dynamodb": "^3.414.0",
|
||||||
"@aws-sdk/signature-v4": "^3.370.0",
|
"@aws-sdk/signature-v4": "^3.370.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack-v2": "^3.40.0-beta.14",
|
"@dadosfera/protospack-v2": "^3.40.0-beta.10",
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"@grpc/proto-loader": "^0.7.9",
|
"@grpc/proto-loader": "^0.7.9",
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
|
|||||||
@@ -271,23 +271,6 @@ export class CatalogController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('custom-properties')
|
|
||||||
@RequireSomePermission(
|
|
||||||
PERMISSIONS_GROUPS.CATALOG.permissions.GET,
|
|
||||||
PERMISSIONS_GROUPS.CATALOG.permissions.DATA_MANAGER,
|
|
||||||
)
|
|
||||||
async getCustomPropertyDefinitions(@User() user: RequestUser) {
|
|
||||||
const { customer_id, customer_name, user_id, username } = user;
|
|
||||||
const metadata = PackTheMetadata({
|
|
||||||
customer_id,
|
|
||||||
customer_name,
|
|
||||||
user_id,
|
|
||||||
username,
|
|
||||||
});
|
|
||||||
|
|
||||||
return this.catalogService.getCustomPropertyDefinitions(metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Get('data-asset/:id')
|
@Get('data-asset/:id')
|
||||||
@RequireSomePermission(
|
@RequireSomePermission(
|
||||||
PERMISSIONS_GROUPS.CATALOG.permissions.GET,
|
PERMISSIONS_GROUPS.CATALOG.permissions.GET,
|
||||||
@@ -1019,4 +1002,4 @@ export class CatalogController {
|
|||||||
this.logger.error(error.message);
|
this.logger.error(error.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,10 +120,6 @@ class CatalogService implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCustomPropertyDefinitions(metadata: Metadata) {
|
|
||||||
return lastValueFrom(this.catalogReadService.GetCustomPropertyDefinitions({}, metadata));
|
|
||||||
}
|
|
||||||
|
|
||||||
async createDataAsset(data: Messages.CreateDataAssetRequest, metadata) {
|
async createDataAsset(data: Messages.CreateDataAssetRequest, metadata) {
|
||||||
this.logger.info('CatalogService - Manage Data assets permissions');
|
this.logger.info('CatalogService - Manage Data assets permissions');
|
||||||
if (!data.embed) data.embed = undefined;
|
if (!data.embed) data.embed = undefined;
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
import { ApiProperty, ApiPropertyOptional, PickType } from '@nestjs/swagger';
|
import { ApiProperty, ApiPropertyOptional, PickType } from '@nestjs/swagger';
|
||||||
import {
|
import { IsEnum } from 'class-validator';
|
||||||
IsEnum,
|
|
||||||
IsNotEmpty,
|
|
||||||
IsOptional,
|
|
||||||
IsString,
|
|
||||||
} from 'class-validator';
|
|
||||||
import { CreateDataAssetRequest } from '@dadosfera/protospack-v2/dist/lib/Catalog/interfaces/messages';
|
import { CreateDataAssetRequest } from '@dadosfera/protospack-v2/dist/lib/Catalog/interfaces/messages';
|
||||||
|
|
||||||
export enum DataAssetShareType {
|
export enum DataAssetShareType {
|
||||||
@@ -203,27 +198,6 @@ export class IData {
|
|||||||
day_opening: number;
|
day_opening: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export enum CustomPropertyType {
|
|
||||||
TEXT = 'text',
|
|
||||||
NUMBER = 'number',
|
|
||||||
DATE = 'date',
|
|
||||||
BOOLEAN = 'boolean',
|
|
||||||
}
|
|
||||||
|
|
||||||
export class CustomPropertyDto {
|
|
||||||
@ApiProperty()
|
|
||||||
key: string;
|
|
||||||
@ApiProperty()
|
|
||||||
value: string;
|
|
||||||
@ApiProperty({ enum: CustomPropertyType })
|
|
||||||
type: CustomPropertyType;
|
|
||||||
@ApiPropertyOptional()
|
|
||||||
color?: string;
|
|
||||||
@ApiPropertyOptional()
|
|
||||||
emoji?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class IUpdateDataRequest {
|
export class IUpdateDataRequest {
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
name: string;
|
name: string;
|
||||||
@@ -237,8 +211,6 @@ export class IUpdateDataRequest {
|
|||||||
share_type?: DataAssetShareType;
|
share_type?: DataAssetShareType;
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
docs?: string;
|
docs?: string;
|
||||||
@ApiPropertyOptional({ type: [CustomPropertyDto] })
|
|
||||||
custom_properties?: CustomPropertyDto[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class IUpdateCertificationStatusRequest {
|
export class IUpdateCertificationStatusRequest {
|
||||||
@@ -400,4 +372,4 @@ export type CreateDataDocsDTO = {
|
|||||||
docs: string;
|
docs: string;
|
||||||
asset_type: string;
|
asset_type: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { ConnectionTest } from '@dadosfera/protospack-v2';
|
import { ConnectionTest } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
|
const infactoryUrl = process.env.INFACTORY_URL ?? '';
|
||||||
const isLocalConnection =
|
const isLocalConnection =
|
||||||
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
infactoryUrl.startsWith('in-factory:') || infactoryUrl.includes('0.0.0.0');
|
||||||
process.env.INFACTORY_URL.includes('0.0.0.0');
|
|
||||||
|
|
||||||
export class ConnectionTestClientConfiguration {
|
export class ConnectionTestClientConfiguration {
|
||||||
private config: GrpcOptions = {
|
private config: GrpcOptions = {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { ConnectionManager } from '@dadosfera/protospack-v2';
|
import { ConnectionManager } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
|
const infactoryUrl = process.env.INFACTORY_URL ?? '';
|
||||||
const isLocalConnection =
|
const isLocalConnection =
|
||||||
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
infactoryUrl.startsWith('in-factory:') || infactoryUrl.includes('0.0.0.0');
|
||||||
process.env.INFACTORY_URL.includes('0.0.0.0');
|
|
||||||
|
|
||||||
export class ConnectionClientConfiguration {
|
export class ConnectionClientConfiguration {
|
||||||
public name = 'ConnectionClientConfiguration';
|
public name = 'ConnectionClientConfiguration';
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { ConnectorManager } from '@dadosfera/protospack-v2';
|
import { ConnectorManager } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
|
const infactoryUrl = process.env.INFACTORY_URL ?? '';
|
||||||
const isLocalConnection =
|
const isLocalConnection =
|
||||||
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
infactoryUrl.startsWith('in-factory:') || infactoryUrl.includes('0.0.0.0');
|
||||||
process.env.INFACTORY_URL.includes('0.0.0.0');
|
|
||||||
|
|
||||||
export class ConnectorClientConfiguration {
|
export class ConnectorClientConfiguration {
|
||||||
public name = 'ConnectorClientConfiguration';
|
public name = 'ConnectorClientConfiguration';
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
type GrpcOptions,
|
type GrpcOptions,
|
||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
|
|
||||||
|
const infactoryUrl = process.env.INFACTORY_URL ?? '';
|
||||||
const isLocalConnection =
|
const isLocalConnection =
|
||||||
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
infactoryUrl.startsWith('in-factory:') || infactoryUrl.includes('0.0.0.0');
|
||||||
process.env.INFACTORY_URL.includes('0.0.0.0');
|
|
||||||
export class InputsGrpcClient {
|
export class InputsGrpcClient {
|
||||||
public readonly name = 'InputsGrpcClient';
|
public readonly name = 'InputsGrpcClient';
|
||||||
private config: GrpcOptions = {
|
private config: GrpcOptions = {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import {
|
|||||||
} from '@dadosfera/protospack-v2/dist/lib/Input/interfaces/messages';
|
} from '@dadosfera/protospack-v2/dist/lib/Input/interfaces/messages';
|
||||||
import { Info } from '@dadosfera/protospack-v2/dist/lib/Input/interfaces/entities';
|
import { Info } from '@dadosfera/protospack-v2/dist/lib/Input/interfaces/entities';
|
||||||
import { CreateInputReq } from './dtos/input.model';
|
import { CreateInputReq } from './dtos/input.model';
|
||||||
import { Metadata } from '@grpc/grpc-js';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
||||||
@@ -74,10 +73,10 @@ export class InputsService {
|
|||||||
objectCamelToSnake(createInputResponse);
|
objectCamelToSnake(createInputResponse);
|
||||||
return createInputResponse;
|
return createInputResponse;
|
||||||
},
|
},
|
||||||
update: async (updateInputDTO: UpdateInputRequest, metadata: Metadata): Promise<InputUpdateResponse> => {
|
update: async (updateInputDTO: UpdateInputRequest): Promise<InputUpdateResponse> => {
|
||||||
this.logger.info('InputClientService - Update' + JSON.stringify(updateInputDTO));
|
this.logger.info('InputClientService - Update' + JSON.stringify(updateInputDTO));
|
||||||
const updateInputResponse = await lastValueFrom(
|
const updateInputResponse = await lastValueFrom(
|
||||||
this.inputWriteService.InputUpdate(updateInputDTO, metadata),
|
this.inputWriteService.InputUpdate(updateInputDTO),
|
||||||
);
|
);
|
||||||
|
|
||||||
return updateInputResponse;
|
return updateInputResponse;
|
||||||
@@ -207,7 +206,7 @@ export class InputsService {
|
|||||||
return findOneInputResponse;
|
return findOneInputResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
async update(id: string, data, info: Info, metadata?: Metadata) {
|
async update(id: string, data, info: Info) {
|
||||||
// this.validateCron({ ...data, info });
|
// this.validateCron({ ...data, info });
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
@@ -218,7 +217,7 @@ export class InputsService {
|
|||||||
id,
|
id,
|
||||||
...data,
|
...data,
|
||||||
info,
|
info,
|
||||||
}, metadata);
|
});
|
||||||
|
|
||||||
const updateInputResponse = this.adjustInputPayload(
|
const updateInputResponse = this.adjustInputPayload(
|
||||||
input,
|
input,
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
} from '@nestjs/microservices';
|
} from '@nestjs/microservices';
|
||||||
import { NetworkConfig } from '@dadosfera/protospack-v2';
|
import { NetworkConfig } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
|
const infactoryUrl = process.env.INFACTORY_URL ?? '';
|
||||||
const isLocalConnection =
|
const isLocalConnection =
|
||||||
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
infactoryUrl.startsWith('in-factory:') || infactoryUrl.includes('0.0.0.0');
|
||||||
process.env.INFACTORY_URL.includes('0.0.0.0');
|
|
||||||
|
|
||||||
export class NetworkConfigGrpcClient {
|
export class NetworkConfigGrpcClient {
|
||||||
public name = 'NetworkConfigGrpcClient';
|
public name = 'NetworkConfigGrpcClient';
|
||||||
|
|||||||
@@ -317,6 +317,7 @@ export class PipelinesController {
|
|||||||
) {
|
) {
|
||||||
this.logger.info('PipelinesController - update', { user });
|
this.logger.info('PipelinesController - update', { user });
|
||||||
|
|
||||||
|
const { customer_id, customer_name, user_id, username } = user;
|
||||||
const info: Info = {
|
const info: Info = {
|
||||||
user_id: user.user_id,
|
user_id: user.user_id,
|
||||||
customer: user.customer_name,
|
customer: user.customer_name,
|
||||||
@@ -324,7 +325,13 @@ export class PipelinesController {
|
|||||||
pipeline_id: pipelineId
|
pipeline_id: pipelineId
|
||||||
};
|
};
|
||||||
|
|
||||||
const metadata = PackTheMetadata(user);
|
const metadata = PackTheMetadata({
|
||||||
|
customer_id,
|
||||||
|
customer_name,
|
||||||
|
user_id,
|
||||||
|
username,
|
||||||
|
language,
|
||||||
|
});
|
||||||
|
|
||||||
const response = await this.pipelinesClientService.updatePipelineInput(
|
const response = await this.pipelinesClientService.updatePipelineInput(
|
||||||
pipelineId,
|
pipelineId,
|
||||||
|
|||||||
@@ -383,8 +383,7 @@ export class PipelinesService implements OnModuleInit {
|
|||||||
const updateInputResponse = await this.inputsService.update(
|
const updateInputResponse = await this.inputsService.update(
|
||||||
inputId,
|
inputId,
|
||||||
updateInputDTO,
|
updateInputDTO,
|
||||||
info,
|
info
|
||||||
metadata
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const inputRollback = () => {
|
const inputRollback = () => {
|
||||||
@@ -405,36 +404,34 @@ export class PipelinesService implements OnModuleInit {
|
|||||||
|
|
||||||
const nimbusUpdates = updateInputResponse?.tablesUpdate || [];
|
const nimbusUpdates = updateInputResponse?.tablesUpdate || [];
|
||||||
|
|
||||||
if (user.customer_modules.includes('catalog')) {
|
nimbusUpdates.forEach(update => {
|
||||||
nimbusUpdates.forEach(update => {
|
const nimbusRollback = () => {
|
||||||
const nimbusRollback = () => {
|
return this.nimbusService.renameTable(
|
||||||
return this.nimbusService.renameTable(
|
info.customer,
|
||||||
info.customer,
|
update.database,
|
||||||
update.database,
|
{
|
||||||
{
|
table_name: update.table_name,
|
||||||
table_name: update.table_name,
|
table_schema: update.table_schema
|
||||||
table_schema: update.table_schema
|
},
|
||||||
},
|
{
|
||||||
{
|
table_name: update.old_table_name,
|
||||||
table_name: update.old_table_name,
|
table_schema: update.old_table_schema
|
||||||
table_schema: update.old_table_schema
|
}
|
||||||
}
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
rollback.push(nimbusRollback);
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.updateNimbus(info.customer, nimbusUpdates);
|
|
||||||
} catch (error) {
|
|
||||||
this.logger.error(error);
|
|
||||||
if (error instanceof AxiosError) {
|
|
||||||
this.logger.error(JSON.stringify(error.response.data));
|
|
||||||
}
|
|
||||||
await this.executeRenameRollback(rollback);
|
|
||||||
|
|
||||||
throw new Error("Error Nimbus updating tables");
|
|
||||||
}
|
}
|
||||||
|
rollback.push(nimbusRollback);
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.updateNimbus(info.customer, nimbusUpdates);
|
||||||
|
} catch (error) {
|
||||||
|
this.logger.error(error);
|
||||||
|
if (error instanceof AxiosError) {
|
||||||
|
this.logger.error(JSON.stringify(error.response.data));
|
||||||
|
}
|
||||||
|
await this.executeRenameRollback(rollback);
|
||||||
|
|
||||||
|
throw new Error("Error Nimbus updating tables");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
NotFoundException,
|
NotFoundException,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ApiTags, ApiOperation, ApiOkResponse } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||||
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -72,10 +72,6 @@ export class PlatformApiController {
|
|||||||
return id?.replace(/-/g, '_') || '';
|
return id?.replace(/-/g, '_') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
private decodePathParam(value: string): string {
|
|
||||||
return value ? decodeURIComponent(value) : '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Denormalize ID back to UUID format (replace _ with -).
|
* Denormalize ID back to UUID format (replace _ with -).
|
||||||
* Used when we receive a normalized ID but need the original UUID.
|
* Used when we receive a normalized ID but need the original UUID.
|
||||||
@@ -836,40 +832,6 @@ export class PlatformApiController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('pipelines/:pipelineId/pipeline_run/:runId/jobs')
|
|
||||||
@ApiOperation({
|
|
||||||
summary: 'Get pipeline run jobs',
|
|
||||||
description: 'Proxies platform-api DB-backed job runs and returns `{ jobs: [...] }`.',
|
|
||||||
})
|
|
||||||
@ApiOkResponse({
|
|
||||||
description: 'DB-backed job runs for the selected pipeline run.',
|
|
||||||
schema: {
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
jobs: {
|
|
||||||
type: 'array',
|
|
||||||
items: { type: 'object' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
required: ['jobs'],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET)
|
|
||||||
async getPipelineRunJobs(
|
|
||||||
@Param('pipelineId') pipelineId: string,
|
|
||||||
@Param('runId') runId: string,
|
|
||||||
@User() user: RequestUser,
|
|
||||||
) {
|
|
||||||
const normalizedPipelineId = this.normalizePipelineId(pipelineId);
|
|
||||||
const decodedRunId = this.decodePathParam(runId);
|
|
||||||
|
|
||||||
return this.platformApiService.proxy(
|
|
||||||
'GET',
|
|
||||||
`/pipeline/${normalizedPipelineId}/pipeline_run/${decodedRunId}/jobs`,
|
|
||||||
user,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==================== JOBS - COLUMN EDITING ROUTES ====================
|
// ==================== JOBS - COLUMN EDITING ROUTES ====================
|
||||||
|
|
||||||
@Put('jobs/:jobId/input')
|
@Put('jobs/:jobId/input')
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Test, TestingModule } from '@nestjs/testing';
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
import { ReleaseNoteController } from './release_note.controller';
|
import { ReleaseNoteController } from './release_note.controller';
|
||||||
import { ReleaseNoteService } from './release_note.service';
|
import { ReleaseNoteService } from './release_note.service';
|
||||||
|
import DadosferaLogger from '@dadosfera/dadosfera-logs';
|
||||||
|
|
||||||
describe('ReleaseNoteController', () => {
|
describe('ReleaseNoteController', () => {
|
||||||
let controller: ReleaseNoteController;
|
let controller: ReleaseNoteController;
|
||||||
@@ -8,7 +9,7 @@ describe('ReleaseNoteController', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
const module: TestingModule = await Test.createTestingModule({
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
controllers: [ReleaseNoteController],
|
controllers: [ReleaseNoteController],
|
||||||
providers: [ReleaseNoteService],
|
providers: [ReleaseNoteService, DadosferaLogger],
|
||||||
}).compile();
|
}).compile();
|
||||||
|
|
||||||
controller = module.get<ReleaseNoteController>(ReleaseNoteController);
|
controller = module.get<ReleaseNoteController>(ReleaseNoteController);
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { Test, TestingModule } from '@nestjs/testing';
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
import { ReleaseNoteService } from './release_note.service';
|
import { ReleaseNoteService } from './release_note.service';
|
||||||
|
import DadosferaLogger from '@dadosfera/dadosfera-logs';
|
||||||
|
|
||||||
describe('ReleaseNoteService', () => {
|
describe('ReleaseNoteService', () => {
|
||||||
let service: ReleaseNoteService;
|
let service: ReleaseNoteService;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
const module: TestingModule = await Test.createTestingModule({
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
providers: [ReleaseNoteService],
|
providers: [ReleaseNoteService, DadosferaLogger],
|
||||||
}).compile();
|
}).compile();
|
||||||
|
|
||||||
service = module.get<ReleaseNoteService>(ReleaseNoteService);
|
service = module.get<ReleaseNoteService>(ReleaseNoteService);
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
import { credentials } from '@grpc/grpc-js';
|
import { credentials } from '@grpc/grpc-js';
|
||||||
import { Transformation } from '@dadosfera/protospack-v2';
|
import { Transformation } from '@dadosfera/protospack-v2';
|
||||||
|
|
||||||
|
const infactoryUrl = process.env.INFACTORY_URL ?? '';
|
||||||
const isLocalConnection =
|
const isLocalConnection =
|
||||||
process.env.INFACTORY_URL.startsWith('in-factory:') ||
|
infactoryUrl.startsWith('in-factory:') || infactoryUrl.includes('0.0.0.0');
|
||||||
process.env.INFACTORY_URL.includes('0.0.0.0');
|
|
||||||
|
|
||||||
export class TransformationsClientConfiguration {
|
export class TransformationsClientConfiguration {
|
||||||
public name = 'TransformationsClientConfiguration';
|
public name = 'TransformationsClientConfiguration';
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ interface IMetadata {
|
|||||||
details?: string;
|
details?: string;
|
||||||
sensitive?: string;
|
sensitive?: string;
|
||||||
roles?: string[];
|
roles?: string[];
|
||||||
customer_modules?: string[];
|
|
||||||
is_data_manager?: boolean;
|
is_data_manager?: boolean;
|
||||||
access_token?: string;
|
access_token?: string;
|
||||||
host?: string;
|
host?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user