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

Enhanced GitHub webhook handler tests. #3370

Merged
merged 2 commits into from
May 21, 2024
Merged

Enhanced GitHub webhook handler tests. #3370

merged 2 commits into from
May 21, 2024

Conversation

blkt
Copy link
Contributor

@blkt blkt commented May 20, 2024

Summary

This PR is only about adding test coverage to GitHub webhook handler.

Fixes #3358

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@blkt blkt self-assigned this May 20, 2024
@blkt blkt force-pushed the issue-3358 branch 3 times, most recently from 48ae4ea to a658174 Compare May 20, 2024 13:53
@blkt blkt marked this pull request as ready for review May 20, 2024 14:00
@blkt blkt requested a review from a team as a code owner May 20, 2024 14:00
Comment on lines +715 to +721
// Previous lookup was done at this path
// ".package.package_version.container_metadata.tag.name",
// which is unfortunately not have available under go-github,
// as field "container_metadata" is missing form its structs.
// I suggest using the following, although it's still to be
// verified whether that's the right one.
tag, err := util.JQReadFrom[string](ctx, ".package.package_version.tag_name", payload)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please have a look at this, I'm not sure this is 100% correct.

Comment on lines +107 to +111
&serverconfig.ProviderConfig{
GitHubApp: &serverconfig.GitHubAppConfig{
WebhookSecret: "test",
},
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not particularly happy about these lines of code, but they do not impact any other test as of now. Ideally, it should be easy to start a simple server just for testing, but I did not want to pollute this PR more than necessary.

Please, let me know your opinions on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

this might not be as necessary with this #3371

@coveralls
Copy link

coveralls commented May 20, 2024

Coverage Status

coverage: 51.473% (+1.5%) from 49.955%
when pulling 38dd674 on issue-3358
into 2d7e6b3 on main.

@JAORMX JAORMX merged commit fb5b6f8 into main May 21, 2024
20 checks passed
@JAORMX JAORMX deleted the issue-3358 branch May 21, 2024 05:26
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.

Enhance test coverage of GitHub webhook handler's tests
4 participants