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

fix: add nocreate to logrotate config #392

Merged
merged 2 commits into from
Oct 18, 2024
Merged

fix: add nocreate to logrotate config #392

merged 2 commits into from
Oct 18, 2024

Conversation

cbartz
Copy link
Collaborator

@cbartz cbartz commented Oct 18, 2024

Applicable spec: n/a

Overview

Add nocreate (if create=False) to the logrotate configuration.

Rationale

Logrotate currently creates an empty file instead of removing (because create is set in /etc/logrotate.conf in the unit)

ubuntu@juju-d7b4aa-stg-github-runner-ps6-260:~$ ll /var/log/reactive_runner/
total 5480
drwxr-xr-x  2 runner-manager runner-manager    4096 Oct 18 08:27 ./
drwxrwxr-x 10 root           syslog            4096 Oct 18 00:00 ../
-rw-r--r--  1 runner-manager runner-manager       0 Oct 18 09:02 366484.log
-rw-r--r--  1 runner-manager runner-manager       0 Oct 18 09:02 368958.log
-rw-r--r--  1 runner-manager runner-manager       0 Oct 18 09:02 372527.log
-rw-r--r--  1 runner-manager runner-manager       0 Oct 18 09:02 508214.log
-rw-r--r--  1 runner-manager runner-manager 5598848 Oct 18 09:30 550857.log
ubuntu@juju-d7b4aa-stg-github-runner-ps6-260:~$ 

Checklist

  • The charm style guide was applied.
  • The contributing guide was applied.
  • The changes are compliant with ISD054 - Managing Charm Complexity
  • The documentation is generated using src-docs.
  • The documentation for charmhub is updated.
  • The PR is tagged with appropriate label (urgent, trivial, complex).
  • The changelog is updated with changes that affects the users of the charm.
  • The changes do not introduce any regression in code or tests related to LXD runner mode.

@cbartz cbartz added bug Something isn't working trivial labels Oct 18, 2024
@cbartz cbartz requested a review from a team as a code owner October 18, 2024 11:54
Copy link
Contributor

Test coverage for 946f24b

Name                         Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------
src/charm.py                   630    166    140     27    70%   247-249, 315-334, 352-354, 355->359, 385-389, 463-465, 474, 481-483, 504-509, 526-532, 553, 565-571, 586-587, 606-607, 616, 621, 651-652, 654->663, 658->663, 668-674, 708, 712-717, 768-773, 782->785, 808-820, 824-825, 853-880, 893-898, 917-927, 942-944, 991-992, 994-995, 997-998, 1077->1079, 1144-1145, 1183-1185, 1193-1199, 1277-1310, 1324-1329, 1344-1387, 1395-1396, 1418
src/charm_state.py             450     17     82      3    95%   274-286, 505-509, 631-632, 687-688, 1123->1126, 1130-1131, 1178
src/errors.py                   25      0      0      0   100%
src/event_timer.py              52      6      0      0    88%   105-106, 143-144, 160-161
src/firewall.py                 51     18     10      0    67%   42-43, 66-69, 111-185
src/github_client.py            23      2      4      0    93%   71-72
src/logrotate.py                43      0      2      0   100%
src/lxd_type.py                 35      0      0      0   100%
src/runner_manager_type.py      39      0      0      0   100%
src/runner_type.py              38      0      0      0   100%
src/shared_fs.py                98     17     10      1    83%   60-61, 132-133, 162-163, 171-172, 178-179, 210, 213-214, 226-227, 270-271
src/utilities.py                32      4      6      2    79%   66-69, 111
------------------------------------------------------------------------
TOTAL                         1516    230    254     33    83%

Static code analysis report

Run started:2024-10-18 11:56:01.226209

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 5045
  Total lines skipped (#nosec): 2
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 6

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@cbartz cbartz merged commit 9680409 into main Oct 18, 2024
41 checks passed
@cbartz cbartz deleted the fix/logrotate branch October 18, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants