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

CLI | Change Vorpal vorpal-latest-version flag flow (AST-48376) #797

Merged
merged 10 commits into from
Jul 16, 2024

Conversation

AlvoBen
Copy link
Collaborator

@AlvoBen AlvoBen commented Jul 14, 2024

By submitting a PR to this repository, you agree to the terms within the Checkmarx Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

change vorpal-latest-version flag flow

References

https://checkmarx.atlassian.net/browse/AST-48376

Testing

Added unit tests

Checklist

  • I have added documentation for new/changed functionality in this PR (if applicable).
  • I have updated the CLI help for new/changed functionality in this PR (if applicable).
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used

@pedrompflopes pedrompflopes requested a review from a team July 14, 2024 10:04
@github-actions github-actions bot added the bug Something isn't working label Jul 14, 2024
Copy link

github-actions bot commented Jul 14, 2024

Logo
Checkmarx One – Scan Summary & Detailsb2f993d6-2a5a-450b-b43f-4385ac589637

Policy Management Violations

Policy Name Rule(s) Break Build
[SAST-ML0] Not allowed NEW Sast vulnerabilities true

No New Or Fixed Issues Found

@AlvoBen AlvoBen changed the title change vorpal-latest-version flow CLI | Change Vorpal vorpal-latest-version flag flow (AST-48376) Jul 14, 2024
if err := vorpalWrapper.HealthCheck(); err == nil {
_ = vorpalWrapper.ShutDown()
if !vorpalInstalled || vorpalParams.VorpalUpdateVersion {
if err := checkLicense(vorpalParams.IsDefaultAgent, vorpalWrappers); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think Or told us to shut down the service here

Copy link
Contributor

Choose a reason for hiding this comment

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

we need to check here for helth check before shutting down. or the shut down check that there sis engine alive bofre>?

return err
}
if newInstallation && vorpalParams.VorpalUpdateVersion {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if newInstallation && vorpalParams.VorpalUpdateVersion {
if newInstallation {

in a situation we check together that I removed the executable file- we also want to shut down the service

@@ -50,38 +50,38 @@ func downloadFile(downloadURLPath, filePath string) error {
// InstallOrUpgrade Checks the version according to the hash file,
// downloads the RealTime installation if the version is not up-to-date,
// Extracts the RealTime installation according to the operating system type
func InstallOrUpgrade(installationConfiguration *InstallationConfiguration) error {
func InstallOrUpgrade(installationConfiguration *InstallationConfiguration) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to add an alias to the bool? like - bool doesInstalltion

return err
}
if newInstallation {
_ = vorpalWrapper.ShutDown()
Copy link
Contributor

Choose a reason for hiding this comment

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

we are doing a shutdown in other flow before we are running a new one no? just need to make sure there are no bugs in this flow.
let's have tests please..we have many scenarios

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function is the only place we are shutting down. This pr did not change this logic

Copy link
Contributor

Choose a reason for hiding this comment

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

we didn't have shutdown aywehre else?

Copy link
Contributor

Choose a reason for hiding this comment

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

same here for the shutdown and healthcheck

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, this is the only function that we use shutdowns.
For healthcheck there are more places

@AlvoBen AlvoBen merged commit 71e3ec4 into main Jul 16, 2024
9 checks passed
@AlvoBen AlvoBen deleted the bug/benalvo/fix-vorpal-initialization branch July 16, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants