Skip to content

Automatically credit remediation developers and reviewers - #61

Open
sethmlarson wants to merge 3 commits into
python:mainfrom
sethmlarson:auto-credit-reviewers
Open

Automatically credit remediation developers and reviewers#61
sethmlarson wants to merge 3 commits into
python:mainfrom
sethmlarson:auto-credit-reviewers

Conversation

@sethmlarson

Copy link
Copy Markdown
Collaborator

The bot can automatically credit people who participate in creating a patch or reviewing the patch privately. Does not override credits that already exist for an individual.

Comment thread src/psrt_ghsa_bot/app.py Outdated
Comment thread src/psrt_ghsa_bot/app.py Outdated
Comment thread src/psrt_ghsa_bot/app.py Outdated
Comment thread src/psrt_ghsa_bot/app.py Outdated
Comment thread src/psrt_ghsa_bot/app.py
Comment thread src/psrt_ghsa_bot/app.py
Comment thread tests/test_app.py
"cve_id": cve_id,
"collaborating_teams": [{"slug": team} for team in collaborating_teams],
"collaborating_users": [{"login": "octocat", "id": 1, "type": "User"}],
"private_fork": {"name": "repo-ghsa-xxxx-xxxx-xxxx", "owner": {"login": "owner"}},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Won't we loose coverage?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I removed this field to avoid needing to mock out the pull requests response for each test case that didn't process private_fork. All the test cases that use private_fork already set the value.

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you also please update the flow chart in the README for this, TiA!

Comment thread src/psrt_ghsa_bot/app.py
Comment thread src/psrt_ghsa_bot/app.py
Comment thread src/psrt_ghsa_bot/app.py
)
except RequestFailed:
capture_exception()
raise RuntimeError("Request to list pull requests failed") from None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't have coverage for these cases (to ensure we don't leak any other output), but that can be a follow up.

Comment thread src/psrt_ghsa_bot/app.py
Comment thread src/psrt_ghsa_bot/app.py
)
except RequestFailed:
capture_exception()
raise RuntimeError("Request to list pull requests reviews failed") from None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could continue processing the next advisory instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Eh, I worry all this would do is spam up Sentry with multiple failures instead of one. I think we want to keep this as stop-on-failure.

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.

2 participants