Skip to content

Commit

Permalink
feature/file-flinger (#17)
Browse files Browse the repository at this point in the history
* feat(file-flinger): ✨ add new module file-flinger to the repository

* docs(general): 📝 update documentation

* docs(core): 📝 update docs for new modules

* docs(general): 📝 update docs and dependencies

* test(general): 🧪 fix test

* ci(ci): 💚 fix ci process

* refactor(general): ♻️ refactor code

* docs(general): 📝 update docs for complete repo

* docs(general): 📝 update general docs

* docs(general): 📝 update docs

* docs(general): 📝 update docs

* chore(service-config): ⬆️ upgrade dependencies and add modify default dependencies

* chore(s3): ⬆️ update s3 dependencies

* fix(http-client-provider): 🐛 fix schema check in provider

* fix(polling): remove redundant max timeout check in RetryManager

* chore(general): ⬆️ update dependencies

* ci(ci): 💚 fix ci

* test(redis-provider): ✅ update test on redis

* ci(general):

* test(openc2): ✅ update test in openc2

* chore(general): ⬆️ update dependencies

* chore(file-flinger): update file-flinger

* test(file-flinger): ✅ add more test for coverage

---------

Co-authored-by: Victor <vfernandez@mytra.es>
  • Loading branch information
cjimenezsaiz and vfernandez-mytra authored Dec 19, 2024
1 parent 8f24663 commit 2b7588a
Show file tree
Hide file tree
Showing 1,136 changed files with 38,180 additions and 28,028 deletions.
4 changes: 2 additions & 2 deletions .config/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ variables:
value: 'mdf-js-api'
## Node version
- name: nodeVersion
value: '20'
value: '22'
## Releases Wiki page
- name: artifactWikiFileName
value: '@mdf.js%2Djs-%2D-API'
## GitFlow variables for branch maching
## GitFlow variables for branch matching
- template: mdf-pipelines-variables.yml
stages:
- stage: 'APP'
Expand Down
54 changes: 31 additions & 23 deletions .config/envDoc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ const envVarRegex = /process\.env\[['"](?<varName>[^'"]+)['"]\]/;
const defaultValueRegex = /(default:|@defaultValue) (?<defaultValue>[^,]+)/;

const srcFiles = glob.sync(SOURCE_FILES, {
nodir: true, ignore: {
nodir: true,
ignore: {
ignored: p => /\.test.ts$/.test(p.name),
}
},
});
const variables = [];

Expand Down Expand Up @@ -102,7 +103,7 @@ function findAllEnvironmentVariablesInFile(fileContent, path) {
comment = comment.replace(defaultValueRegex, '').trim();
}
variables.push({ name: matches.groups['varName'], comment, path, defaultValue });
} catch (error) {
} catch (error) {
console.log(`ERROR: Error while processing file ${path}: ${error.message}`);
}
}
Expand Down Expand Up @@ -159,7 +160,9 @@ function findUpperCommentInFile(lines, index) {
} else {
const firstLine = lines[startOfComment].replace('/**', '');
const lastLine = lines[endOfComment].replace('*/', '');
const middleLines = lines.slice(startOfComment + 1, endOfComment).map(line => line.replace('*', ''));
const middleLines = lines
.slice(startOfComment + 1, endOfComment)
.map(line => line.replace('*', ''));
comment = [firstLine, ...middleLines, lastLine].join(' ');
}
// Clean spaces if there are more than one space between words or at the beginning or end of the comment
Expand Down Expand Up @@ -191,7 +194,7 @@ function isConstantDeclaration(line) {
}
/**
* Finds and removes the section containing environment variables from a given Markdown document.
*
*
* @param {object} readMeMD - The Markdown document object.
*/
function findAndRemoveEnvironmentVariablesSection(readMeMD) {
Expand Down Expand Up @@ -220,7 +223,7 @@ function findAndRemoveEnvironmentVariablesSection(readMeMD) {
}
/**
* Finds, removes, and returns the license section from the given readMeMD object.
*
*
* @param {Object} readMeMD - The readMeMD object.
* @returns {Array} - An array of nodes representing the license section.
*/
Expand Down Expand Up @@ -268,7 +271,7 @@ function deletePositionPropertyRecursively(nodes) {
}
/**
* Generates a table of environment variables.
*
*
* @param {Array<Object>} envVariables - An array of environment variables.
* @returns {Array<Object>} - An array representing the table of environment variables.
*/
Expand Down Expand Up @@ -306,7 +309,7 @@ function generateTableOfEnvironmentVariables(envVariables) {
}
/**
* Generates a list of environment variables.
*
*
* @param {Array<Object>} envVariables - The array of environment variables.
* @returns {Array<Object>} - The list of environment variables in a specific format.
*/
Expand All @@ -324,33 +327,38 @@ function generateListOfEnvironmentVariables(envVariables) {
};
for (const envVariable of envVariables) {
if (!envVariable.comment) {
console.log(`WARNING: No comment found for environment variable ${envVariable.name} in file ${envVariable.path}`);
};
console.log(
`WARNING: No comment found for environment variable ${envVariable.name} in file ${envVariable.path}`
);
}
let defaultValue = [];
if (envVariable.defaultValue) {
defaultValue = [
{ type: 'text', value: ' (default: ', },
{ type: 'text', value: ' (default: ' },
{ type: 'inlineCode', value: envVariable.defaultValue },
{ type: 'text', value: `): ${envVariable.comment}` }];
{ type: 'text', value: `): ${envVariable.comment}` },
];
} else {
defaultValue = [{ type: 'text', value: `: ${envVariable.comment}` }];
}
envVariablesList.children.push({
type: 'listItem',
spread: false,
checked: null,
children: [{
type: 'paragraph',
children: [
{
type: 'strong', children: [
{ type: 'text', value: envVariable.name },
]
},
...defaultValue,
],
}],
children: [
{
type: 'paragraph',
children: [
{
type: 'strong',
children: [{ type: 'text', value: envVariable.name }],
},
...defaultValue,
],
},
],
});
}
return [envVariablesTitle, envVariablesList];
}

2 changes: 1 addition & 1 deletion .config/mdf-publish-artifacts-lerna.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:

- task: Yarn@3
displayName: Publish package to internal feed as alfa version
condition: and(succeeded(), eq(variables.isDevelop, true))
condition: and(succeeded(), or(eq(variables.isDevelop, true), eq(variables.isFeature, true)))
inputs:
projectDirectory: '.'
arguments: 'lerna publish $(Build.BuildNumber) --amend --dist-tag alpha --loglevel silly -m "chore(release): publish %v" --yes'
Expand Down
8 changes: 4 additions & 4 deletions .config/mdf-test-sonarqube-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
steps:
- task: SonarQubePrepare@6
- task: SonarQubePrepare@7
displayName: 'Setting Sonarqube analysis'
inputs:
SonarQube: 'NetinSystems-SonarQube Endpoint-MytraManagementSystem'
scannerMode: 'CLI'
cliVersion: '6.1.0.4477'
cliVersion: '6.2.1.4610'
configMode: 'file'
configFile: './.config/sonar-project.properties'
projectVersion: $(Build.BuildNumber)
extraProperties:
sonar.projectVersion=$(Build.BuildNumber)

- task: SonarQubeAnalyze@6
- task: SonarQubeAnalyze@7
displayName: 'Run Code Analysis'
inputs:
jdkversion: 'JAVA_HOME_17_X64'

- task: SonarQubePublish@6
- task: SonarQubePublish@7
displayName: 'Publish Quality Gate Result'
inputs:
pollingTimeoutSec: '300'
Expand Down
Loading

0 comments on commit 2b7588a

Please sign in to comment.