Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat playbooks git sync #50

Merged
merged 13 commits into from
Jul 1, 2024
Merged

Conversation

SquirrelDeveloper
Copy link
Collaborator

No description provided.

manu and others added 3 commits June 30, 2024 13:54
Refactored playbook management and execution functionalities in the system. Essential changes include renaming "ansible" routes to "playbook" routes, relocating several playbook related files, and modifying ansible related Python scripts. Added functionality to filter results by file extensions in directory tree listing and created a REST service for managing playbook repositories.
Refactored playbook management and execution functionalities in the system. Essential changes include renaming "ansible" routes to "playbook" routes, relocating several playbook related files, and modifying ansible related Python scripts. Added functionality to filter results by file extensions in directory tree listing and created a REST service for managing playbook repositories.
manu added 2 commits June 30, 2024 14:02
The documentation files previously suggested using the 'playbooks-repository clone' command to copy the repositories. These instructions have been updated to use the more standard 'git clone' command instead, providing more general compatibility.
@SquirrelDeveloper SquirrelDeveloper linked an issue Jun 30, 2024 that may be closed by this pull request
manu added 6 commits June 30, 2024 16:54
The server integrations and use-cases have been updated for improved efficiency and clarity. The `syncToRepository` method was removed from multiple components for redundancy. The handling of asynchronous calls and data manipulation methods was modified as well. New test files were added to verify tree-utils functionality and the `PlaybookRepositoryComponent`.
The term 'playbooks' has been replaced with 'ansible' in multiple locations across the codebase - both in commands and in actual code. This clarifies the usage and the relevance of Ansible in areas such as the AnsibleGalaxyCommand, in shell commands, and in cache interactions. Even in the technical documentation and guide, references have been updated to reflect this change.
The documentation has been updated to replace incorrect references of 'playbooks-repository' with the correct 'git' command. Additionally, an icon source in the main site page was replaced to better reflect the compatibility with Ansible. These changes ensure that users are provided with accurate instructions and consistent visual cues.
The documentation has been updated to replace incorrect references of 'playbooks-repository' with the correct 'git' command. Additionally, an icon source in the main site page was replaced to better reflect the compatibility with Ansible. These changes ensure that users are provided with accurate instructions and consistent visual cues.
The contribute guide has been updated to include an explicit step for creating a new branch for changes. This clarification ensures contributors understand the importance of not making changes directly on the main branch.
Codebase has been refactored to break down shell operations pertaining to playbooks, files, and repositories. Export structure has been improved and segment separation helps identify which components are responsible for each task. While enhancing code readability, this also facilitates future code maintenance and improvements.
async function saveSshKey(key: string, uuid: string) {
try {
logger.info('[SHELL] - vaultSshKey Starting...');
if (shell.exec(`echo '${key}' > /tmp/${uuid}.key`).code !== 0) {

Check failure

Code scanning / CodeQL

Uncontrolled command line Critical

This command line depends on a
user-provided value
.
This command line depends on a
user-provided value
.
This command line depends on a
user-provided value
.
async function newPlaybook(fullFilePath: string) {
try {
logger.info('[SHELL] - newPlaybook - Starting...');
shell.touch(fullFilePath);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
if (fileExist) {
throw new Error('Directory or file already exists');
}
return shell.mkdir('-p', fullPath);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
throw new Error('Attempt to delete a file or directory outside the root directory');
}
}
shell.rm('-rf', directory);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
manu added 2 commits July 1, 2024 13:46
This commit introduces substantial updates across several different files. Changes include aligning directory paths with updated UUIDs, integrating migration instructions with Scheme version tracking, improving Shell methods imports, standardising tree building across several components, ensuring unique name for Playbook model, and modifying Git commit messages to reflect updates through SSM. The updates aim to improve functionality, increase efficiency, and fix previous issues.
Adjusted the function call to install an Ansible Galaxy Collection in the galaxy.ts file. The updated version adds a necessary layer to the function call (`AnsibleShell`) ensuring the correct execution of the installAnsibleGalaxyCollection method.
async function installAnsibleGalaxyCollection(name: string, namespace: string) {
try {
logger.info('[SHELL] - installAnsibleGalaxyCollection Starting...');
const result = shell.exec(AnsibleGalaxyCmd.getInstallCollectionCmd(name, namespace));

Check failure

Code scanning / CodeQL

Uncontrolled command line Critical

This command line depends on a
user-provided value
.
@SquirrelDeveloper SquirrelDeveloper merged commit 03b8a45 into master Jul 1, 2024
7 of 8 checks passed
@SquirrelDeveloper SquirrelDeveloper deleted the feat-playbooks-git-sync branch July 1, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Playbooks - Support directories & Git sync
1 participant