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

Add logs to script and command execution #6874

Merged
merged 1 commit into from Oct 31, 2023

Conversation

stephankruggg
Copy link
Contributor

Description

This PR adds and improves existing logs when executing scripts and commands, since current information is not sufficient to enable troubleshooting.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

I applied the changes in a local lab and checked if the updated logs were successfully logged.

@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Merging #6874 (809be7b) into main (1ee58ec) will increase coverage by 16.75%.
Report is 760 commits behind head on main.
The diff coverage is 53.33%.

@@              Coverage Diff              @@
##               main    #6874       +/-   ##
=============================================
+ Coverage     10.85%   27.61%   +16.75%     
- Complexity     7106    28818    +21712     
=============================================
  Files          2485     5121     +2636     
  Lines        245417   411899   +166482     
  Branches      38326    73699    +35373     
=============================================
+ Hits          26631   113726    +87095     
- Misses       215516   282737    +67221     
- Partials       3270    15436    +12166     
Flag Coverage Δ
simulator-marvin-tests 25.42% <53.33%> (?)
uitests 5.56% <ø> (?)
unit-tests 14.50% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...s/src/main/java/com/cloud/utils/script/Script.java 29.09% <53.33%> (ø)

... and 4014 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sonarcloud
Copy link

sonarcloud bot commented Nov 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

52.5% 52.5% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@BryanMLima BryanMLima left a comment

Choose a reason for hiding this comment

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

LGTM

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. LL-JID 222

@stephankruggg
Copy link
Contributor Author

stephankruggg commented Nov 8, 2022

@DaanHoogland, the isEnabled check is detrimental in terms of code legibility. In my opinion, this check's barely noticeable performance gain is not sufficient to counter this negative impact, so it should not be used in this scenario.

@DaanHoogland
Copy link
Contributor

@DaanHoogland, the isEnabled check is detrimental in terms of code legibility. In my opinion, this check's barely noticeable performance gain is not sufficient to counter this negative impact, so it should not be used in this scenario.

I don´t agree. we could change the log library to add variable parameters to the trace/debug/info messages to make the log line look cleaner. I´m very extrmely for legibility but not at cost of neat following of best practices.

@stephankruggg
Copy link
Contributor Author

stephankruggg commented Nov 14, 2022

@DaanHoogland, the isEnabled check is detrimental in terms of code legibility. In my opinion, this check's barely noticeable performance gain is not sufficient to counter this negative impact, so it should not be used in this scenario.

I don´t agree. we could change the log library to add variable parameters to the trace/debug/info messages to make the log line look cleaner. I´m very extrmely for legibility but not at cost of neat following of best practices.

I understand; however, it is not consensus that the isEnabled check should be used, and the scenarios here do not require so much processing in order to make it necessary to validate the log level before creating the string, so I'd rather not add them.

@DaanHoogland DaanHoogland added this to the 4.19.0.0 milestone Jun 22, 2023
Copy link
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

CLGTM

@GaOrtiga
Copy link
Contributor

As mentioned in comment #6947 (comment), I will be helping out @stephankruggg with some of his opened PRs.

@DaanHoogland given that the patch for upgrading Log4j is already ready, is guarding these logs still necessary? Could we move on with this PR?

@DaanHoogland
Copy link
Contributor

DaanHoogland commented Sep 21, 2023

As mentioned in comment #6947 (comment), I will be helping out @stephankruggg with some of his opened PRs.

@DaanHoogland given that the patch for upgrading Log4j is already ready, is guarding these logs still necessary? Could we move on with this PR?

@GaOrtiga , let me put it like this; I will not involve myself in these discussions anymore, nor have I changed my opinion. I will not (freudian error) stand in the way of it either.

@shwstppr shwstppr closed this Oct 3, 2023
@shwstppr shwstppr reopened this Oct 3, 2023
@shwstppr
Copy link
Contributor

shwstppr commented Oct 3, 2023

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7205

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-7825)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 48594 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6874-t7825-kvm-centos7.zip
Smoke tests completed. 111 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 665.97 test_kubernetes_clusters.py
test_05_vmschedule_test_e2e Failure 270.97 test_vm_schedule.py

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Code LGTM

@shwstppr shwstppr closed this Oct 19, 2023
@shwstppr shwstppr reopened this Oct 19, 2023
@DaanHoogland
Copy link
Contributor

I am not +1, more like -0, but too many do not agree with my stance on the logging issue, so I'll merge this anyway.

@DaanHoogland DaanHoogland merged commit 288f066 into apache:main Oct 31, 2023
41 of 48 checks passed
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.

None yet

7 participants