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

Initial app #2

Merged
merged 19 commits into from
Sep 9, 2024
Merged

Initial app #2

merged 19 commits into from
Sep 9, 2024

Conversation

cbartz
Copy link
Collaborator

@cbartz cbartz commented Sep 4, 2024

Applicable spec: n/a

Overview

Checkin code (with the latest version from canonical/github-runner-operator#351). Adjustments had to be made to remove the charm_state dependencies (these dependencies have been moved to the types_ package). There is also some code duplication with the code in https://github.com/canonical/github-runner-operator (github_client, repo_policy_compliance_client, errors, utilities). One reason for this is that the LXDRunnerManager requires this functionality, but is not currently intended to be outsourced.

Rationale

The primary reason for the externalisation is mainly to remove the charm_state dependencies, as the WIP reactive code will spawn runners in a different process using a script, and serialising the charm state and passing as parameter to a script has been identified as a bad smell. The deeper cause is that the github runner manager can be seen as a separate application, and https://github.com/canonical/github-runner-operator has too much responsibility.

Checklist

  • The contributing guide was applied
  • The documentation is generated using src-docs
  • The PR is tagged with appropriate label (urgent, trivial, complex)

@cbartz cbartz added the complex label Sep 4, 2024
requirements.txt Outdated Show resolved Hide resolved
src/github_runner_manager/errors.py Outdated Show resolved Hide resolved
src/github_runner_manager/errors.py Outdated Show resolved Hide resolved
src/github_runner_manager/errors.py Outdated Show resolved Hide resolved
src/github_runner_manager/reactive/runner_manager.py Outdated Show resolved Hide resolved
src/github_runner_manager/types_/general.py Outdated Show resolved Hide resolved
jdkandersson
jdkandersson previously approved these changes Sep 6, 2024
jdkandersson
jdkandersson previously approved these changes Sep 9, 2024
yanksyoon
yanksyoon previously approved these changes Sep 9, 2024
.github/pull_request_template.yaml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
requirements.txt Show resolved Hide resolved
@yanksyoon
Copy link
Contributor

Just some comments for myself, thank you for the PR!

Copy link

github-actions bot commented Sep 9, 2024

Test coverage for b38781d

Name                                                         Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------------------------------------
src/github_runner_manager/__init__.py                            0      0      0      0   100%
src/github_runner_manager/errors.py                             22      0      0      0   100%
src/github_runner_manager/github_client.py                      83     36     34      2    47%   63-72, 100-135, 148-157, 171-180, 191-198, 220->260, 254
src/github_runner_manager/manager/__init__.py                    0      0      0      0   100%
src/github_runner_manager/manager/cloud_runner_manager.py       54      0      6      0   100%
src/github_runner_manager/manager/github_runner_manager.py      17      0      6      0   100%
src/github_runner_manager/manager/runner_manager.py            134     34     48      5    70%   175, 187, 191, 207-212, 230-231, 268-284, 298-305, 325-329, 338
src/github_runner_manager/manager/runner_scaler.py              95      8     32      3    90%   123-124, 135-136, 140, 147, 210-211
src/github_runner_manager/metrics/__init__.py                    0      0      0      0   100%
src/github_runner_manager/metrics/events.py                     55      0      8      1    98%   56->59
src/github_runner_manager/metrics/github.py                     16      0      0      0   100%
src/github_runner_manager/metrics/runner.py                    144     10     32      3    91%   164, 190-203, 239, 276, 458-459
src/github_runner_manager/metrics/runner_logs.py                24      5      4      1    79%   30-33, 47->46, 51-52
src/github_runner_manager/metrics/storage.py                    70      8     12      0    90%   89-90, 117-118, 182-183, 189-190
src/github_runner_manager/metrics/type.py                        5      0      0      0   100%
src/github_runner_manager/openstack_cloud/__init__.py           26      0      2      0   100%
src/github_runner_manager/reactive/__init__.py                   0      0      0      0   100%
src/github_runner_manager/reactive/consumer.py                  40      2      6      0    96%   98-101
src/github_runner_manager/reactive/runner.py                    18     18      6      0     0%   6-50
src/github_runner_manager/reactive/runner_manager.py            53      0     14      1    99%   103->exit
src/github_runner_manager/types_/__init__.py                    33      8      4      1    70%   39-52, 72, 80
src/github_runner_manager/types_/github.py                      72      9     10      0    82%   186, 207, 228-235
src/github_runner_manager/utilities.py                          46     33     14      0    22%   47-104, 127-145, 157-158
--------------------------------------------------------------------------------------------------------
TOTAL                                                         1007    171    238     17    79%

Static code analysis report

Run started:2024-09-09 07:04:18.251790

Test results:
  No issues identified.

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

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 1f310b2 into main Sep 9, 2024
10 checks passed
@cbartz cbartz deleted the initial-app branch September 10, 2024 07:43
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