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

Retry install event on certain errors #229

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from
Draft

Conversation

yhaliaw
Copy link
Collaborator

@yhaliaw yhaliaw commented Feb 24, 2024

Applicable spec:

Overview

If install event encounters errors, the charm does not retry the install event.

On certain errors, such as, dependency install, etc. the charm will enter error state and juju will re-fire the install event for retry.

The upgrade event has the same issue and is handled in a similar way.

Rationale

Without this change if a charm is deployed with wrong configuration, the install event would not retried and continue to start event. This will result in the charm not running part of the install hook such as installing some deps.

Juju Events Changes

The install event is changed.

Module Changes

Library Changes

Checklist

WIP need to merge another PR first.

Copy link
Contributor

github-actions bot commented Mar 1, 2024

Test coverage for 922c7f7

Name                         Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------
src/charm.py                   442     91     95     17    77%   98, 102-103, 105-106, 111-112, 180-182, 227-246, 261-263, 264->268, 291-295, 385-390, 423, 435-441, 455-456, 469-493, 523->528, 570, 574-579, 624->627, 641-642, 674-687, 716-721, 784-785, 787-788, 790-791, 863->865, 930-931, 964-966, 983
src/charm_state.py             283     31     58     10    87%   99, 212, 238, 242-243, 263-265, 296-297, 334-335, 341-342, 369, 374, 376, 380, 451, 463-470, 630-631, 636-637, 643-648
src/errors.py                   41      0      0      0   100%
src/event_timer.py              55      7      2      1    86%   103-104, 127, 144-145, 161-162
src/firewall.py                 52     18     20      0    61%   42-43, 66-69, 110-184
src/github_client.py            89     14     38      4    80%   38-45, 146, 169, 182-189, 207->242, 236
src/github_metrics.py           14      0      0      0   100%
src/github_type.py              50      0      0      0   100%
src/lxd_type.py                 37      0      2      0   100%
src/metrics.py                  73      2     10      1    96%   61->64, 170-171
src/metrics_type.py              6      0      0      0   100%
src/openstack_manager.py        40      0      4      0   100%
src/runner.py                  324     71     96     24    73%   46->48, 175->189, 229-230, 256-257, 298-307, 331-336, 341, 361, 365-375, 424->427, 430-432, 439, 453, 463, 467, 469, 484, 518-523, 539-552, 563-602, 607, 649, 702-704, 708, 726, 761, 787, 792-804, 818, 823->825, 828-830
src/runner_logs.py              35      2      6      1    93%   62->61, 66-67
src/runner_manager.py          314     62    112     15    79%   78, 80, 114, 159-161, 174-175, 187-189, 195-200, 204-205, 235, 278-279, 323-325, 396-402, 409, 434, 445-449, 474, 526-529, 561-579, 592-597, 621-623, 641-642, 740
src/runner_manager_type.py      39      0      6      0   100%
src/runner_metrics.py          123      8     20      2    93%   147-148, 160, 191-192, 307-311
src/runner_type.py              31      0      8      0   100%
src/shared_fs.py               116     16     20      0    88%   108-109, 133-134, 217-218, 241-242, 254-255, 260-261, 267-268, 292-293
src/utilities.py                68      7     20      7    82%   74->76, 78->84, 91, 121, 135, 174-177, 228
------------------------------------------------------------------------
TOTAL                         2232    329    517     82    83%

Static code analysis report

Run started:2024-03-01 08:06:31.579385

Test results:
  No issues identified.

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

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):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant