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(#8551): removes python from cht-deploy and some bug fixes #9074

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

henokgetachew
Copy link
Contributor

Description

Handles the following tickets:

#8551 Remove python - establishing feature parity. No major refactoring.
#8604 Catch Missing Values
#8605 Show URL when done execution
#8608 Add a get-all-logs troubleshooting command

Code review checklist

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
Copy link
Contributor

@mrjones-plip mrjones-plip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work here! Nice to see a migration to node for user/developer facing scripts. As well, I saw you closed some other issues with this PR like #8604, #8605 and #8608 - sweet!

I found two errors - one I'm requesting a change for and the other is in master, but persists in this branch. Let's make the change per my request and then wait til the other issue fixed and we'll dive back into this PR!

scripts/deploy/cht-deploy Show resolved Hide resolved
scripts/deploy/src/install.js Outdated Show resolved Hide resolved
Copy link
Contributor

@nydr nydr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great initiative! I'm happy to see significant progress in replacing the old script.

I would love to see a test, even if it's just trying to import the module or testing the easiest to test function as it can catch some syntax errors and make it easier to add more tests later. Since the old script didn't have any tests I don't consider this a blocker, even in the current state I consider it an significant improvement.

I think some jsdoc style comments on most functions would be great

scripts/deploy/package.json Outdated Show resolved Hide resolved
scripts/deploy/src/install.js Outdated Show resolved Hide resolved
scripts/deploy/src/install.js Outdated Show resolved Hide resolved
scripts/deploy/src/install.js Outdated Show resolved Hide resolved
scripts/deploy/src/install.js Outdated Show resolved Hide resolved
scripts/deploy/src/install.js Outdated Show resolved Hide resolved
scripts/deploy/package.json Show resolved Hide resolved
scripts/deploy/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@mrjones-plip mrjones-plip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking better - thanks for iterating!

Confirmed that #9076 is fixed with the latest changes. As well, sad path and happy paths are well covered!

Requesting some security and changes to new save all logs script.

scripts/deploy/troubleshooting/get-all-logs Outdated Show resolved Hide resolved
scripts/deploy/troubleshooting/get-all-logs Outdated Show resolved Hide resolved
@@ -0,0 +1,46 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay! this worked exactly as promised - thanks for adding!

scripts/deploy/troubleshooting/get-all-logs Outdated Show resolved Hide resolved
scripts/deploy/troubleshooting/get-all-logs Outdated Show resolved Hide resolved
scripts/deploy/troubleshooting/get-all-logs Outdated Show resolved Hide resolved
scripts/deploy/troubleshooting/get-all-logs Outdated Show resolved Hide resolved
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
scripts/deploy/src/install.js Dismissed Show dismissed Hide dismissed
scripts/deploy/src/install.js Fixed Show fixed Hide fixed
@jonathanvq jonathanvq added this to Awaiting Triage in Site Reliability Support Dashboard via automation May 21, 2024
@jonathanvq jonathanvq moved this from Awaiting Triage to This Week's Priorities in Site Reliability Support Dashboard May 21, 2024
scripts/deploy/src/install.js Dismissed Show dismissed Hide dismissed
scripts/deploy/src/install.js Dismissed Show dismissed Hide dismissed
scripts/deploy/src/install.js Dismissed Show dismissed Hide dismissed
const releaseExists = child_process.execSync(`helm list -n ${namespace}`).toString(); //NoSONAR
if (releaseExists.includes(project_name)) { //NoSONAR
console.log("Release exists. Performing upgrade.");
child_process.execSync(`helm upgrade --install ${project_name} ${CHT_CHART_NAME} --version ${chart_version} --namespace ${namespace} --values ${valuesFile} --set cht_image_tag=${image_tag}`, { stdio: 'inherit' }); //NoSONAR

Check warning

Code scanning / CodeQL

Unsafe shell command constructed from library input Medium

This string concatenation which depends on
library input
is later used in a
shell command
.
This string concatenation which depends on
library input
is later used in a
shell command
.
This string concatenation which depends on
library input
is later used in a
shell command
.
This string concatenation which depends on
library input
is later used in a
shell command
.
This string concatenation which depends on
library input
is later used in a
shell command
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants