Skip to content

Commit

Permalink
Merge pull request #80 from RegestaItalia/fixes
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
simonegaffurini authored Dec 4, 2024
2 parents 8df9fc9 + 29f0488 commit b6372ec
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trm-core",
"version": "6.1.14",
"version": "6.1.15",
"description": "TRM (Transport Request Manager) Core",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
17 changes: 9 additions & 8 deletions src/actions/install/importTadirTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { InstallWorkflowContext } from ".";
import { Logger } from "../../logger";
import { SystemConnector } from "../../systemConnector";
import { Transport } from "../../transport";
import _ from 'lodash';

/**
* Import TADIR Transport.
Expand Down Expand Up @@ -34,23 +35,23 @@ export const importTadirTransport: Step<InstallWorkflowContext> = {
Logger.loading(`Importing ${context.runtime.packageTransports.tadir.binaries.trkorr}`, true);
await context.runtime.packageTransports.tadir.instance.import(importTimeout);
Logger.success(`Transport ${context.runtime.packageTransports.tadir.binaries.trkorr} imported`, true);

Logger.loading(`Finalizing import...`);

//3- run tadir interface (package replacement)
if (!context.rawInput.installData.installDevclass.keepOriginal) {
for (const tadir of context.runtime.packageTransportsData.tadir) {
for (const tadir of context.runtime.packageTransportsData.tadir) {
var object = _.cloneDeep(tadir);
if (!context.rawInput.installData.installDevclass.keepOriginal) {
const replacementDevclass = context.rawInput.installData.installDevclass.replacements.find(o => o.originalDevclass === tadir.devclass);
if (replacementDevclass && replacementDevclass.installDevclass) {
var object = tadir;
object.devclass = replacementDevclass.installDevclass;
object.srcsystem = 'TRM';
Logger.log(`Running TADIR interface for object ${object.pgmid} ${object.object} ${object.objName}, devclass ${tadir.devclass} -> ${object.devclass}, src system ${tadir.srcsystem} -> ${object.srcsystem}`, true);
await SystemConnector.tadirInterface(object);
object.devclass = replacementDevclass.installDevclass;;
} else {
Logger.error(`Replacement ABAP package not found for ${tadir.devclass}!`, true);
}
}
object.srcsystem = 'TRM';
Logger.log(`Running TADIR interface for object ${object.pgmid} ${object.object} ${object.objName}, devclass ${tadir.devclass} -> ${object.devclass}, src system ${tadir.srcsystem} -> ${object.srcsystem}`, true);
await SystemConnector.tadirInterface(object);
}
},
revert: async (context: InstallWorkflowContext): Promise<void> => {
Expand Down
20 changes: 12 additions & 8 deletions src/actions/publish/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,18 @@ export const init: Step<PublishWorkflowContext> = {
Logger.info(`First time publishing "${context.rawInput.packageData.name}". Congratulations!`);
}else{
context.runtime.trmPackage.latestReleaseManifest = (await context.runtime.trmPackage.package.fetchRemoteManifest('latest')).get();
const validateVisibility = validatePackageVisibility(
context.rawInput.packageData.registry.getRegistryType(),
context.rawInput.packageData.name,
!!(context.runtime.trmPackage.manifest.private),
context.runtime.trmPackage.latestReleaseManifest ? context.runtime.trmPackage.latestReleaseManifest.private : undefined
);
if(validateVisibility !== true){
throw new Error(validateVisibility);
if(context.runtime.trmPackage.manifest.private === undefined){
context.runtime.trmPackage.manifest.private = context.runtime.trmPackage.latestReleaseManifest.private;
}else{
const validateVisibility = validatePackageVisibility(
context.rawInput.packageData.registry.getRegistryType(),
context.rawInput.packageData.name,
context.runtime.trmPackage.manifest.private,
context.runtime.trmPackage.latestReleaseManifest ? context.runtime.trmPackage.latestReleaseManifest.private : undefined
);
if(validateVisibility !== true){
throw new Error(validateVisibility);
}
}
}
},
Expand Down

0 comments on commit b6372ec

Please sign in to comment.