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

Support all other GitHub events #154

Merged
merged 13 commits into from
Nov 30, 2023
Merged

Support all other GitHub events #154

merged 13 commits into from
Nov 30, 2023

Conversation

cbartz
Copy link
Collaborator

@cbartz cbartz commented Nov 27, 2023

Applicable spec: n/a

Overview

Support all other GitHub events by using the default repo policy compliance check endpoint, which is supported since canonical/repo-policy-compliance#875 .

An end-to-end test for the issues event is added.

Closes #145

Rationale

Since canonical/repo-policy-compliance#807 has landed, all events other than pull_request will only check collaborator permissions, so we could add support for the rest with just collaborator permissions.

Juju Events Changes

Module Changes

Library Changes

Checklist

@cbartz cbartz changed the title Use push as default repo policy check [WIP] Use push as default repo policy check Nov 27, 2023
@cbartz cbartz changed the title [WIP] Use push as default repo policy check [WIP] Support all other GitHub events Nov 29, 2023
@cbartz cbartz changed the title [WIP] Support all other GitHub events Support all other GitHub events Nov 29, 2023
@cbartz
Copy link
Collaborator Author

cbartz commented Nov 29, 2023

Some integration tests are failing, which should be fixed when #156 lands.

@cbartz cbartz marked this pull request as ready for review November 29, 2023 11:16
@cbartz cbartz requested a review from a team as a code owner November 29, 2023 11:16
jdkandersson
jdkandersson previously approved these changes Nov 30, 2023
Copy link
Contributor

@jdkandersson jdkandersson left a comment

Choose a reason for hiding this comment

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

Thanks!

# Conflicts:
#	templates/pre-job.j2
templates/pre-job.j2 Outdated Show resolved Hide resolved
Copy link
Contributor

Test coverage for 44dffd8

Name                    Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------
src/charm.py              429     98    107     25    75%   79-80, 86-88, 112-113, 117-119, 155-157, 167->179, 177, 220-228, 240-244, 275, 352-357, 378, 395-396, 405-428, 446-448, 456-459, 466, 469-470, 486, 491-496, 541->544, 557-558, 560-561, 595-602, 626-627, 639-641, 656-657, 682-683, 685-686, 688-689, 763->765, 826-827, 843, 861-863, 867
src/charm_state.py         50      6      6      0    86%   76-83
src/errors.py              34      0      0      0   100%
src/event_timer.py         42      8      4      0    74%   94-97, 117-120
src/firewall.py            43     25     10      0    38%   38-42, 64-67, 75-149
src/github_type.py         36      0      0      0   100%
src/lxd_type.py            37      0      2      0   100%
src/metrics.py             68      2     10      1    96%   60->63, 152-153
src/runner.py             334     70    108     26    74%   49->51, 115, 220-227, 233-239, 266-267, 311-320, 344-349, 354, 374, 378-388, 437->440, 443-445, 452, 466, 476, 480, 482, 497, 545-550, 566-579, 590-622, 627, 665, 711-713, 717, 735, 770, 796, 801-813, 827, 847, 863
src/runner_manager.py     268     26    100      9    89%   166, 223-225, 238-239, 251-253, 259-264, 268-269, 279-280, 299, 411, 430-434, 459, 542, 691, 711
src/runner_metrics.py     112      5     22      2    95%   133-134, 146, 215-216
src/runner_type.py         55      0     12      0   100%
src/shared_fs.py           80     10     12      0    89%   73-74, 160-161, 166-167, 173-174, 196-197
src/utilities.py           68      6     20      8    84%   74->76, 78->84, 89-91, 121, 135, 173, 226
-------------------------------------------------------------------
TOTAL                    1656    256    413     71    82%

Static code analysis report

Run started:2023-11-30 11:55:54.069822

Test results:
  No issues identified.

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

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 3a1d0e3 into main Nov 30, 2023
50 checks passed
@cbartz cbartz deleted the use-push-check branch November 30, 2023 13:38
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.

GitHub Action fails with error "issues is not supported yet"
3 participants