Skip to content

Add Webhook for Repository ruleset - #3305

Merged
gmlewis merged 43 commits into
google:masterfrom
unamdev0:feature/add-repositoryrulesetevent
Oct 16, 2024
Merged

Add Webhook for Repository ruleset#3305
gmlewis merged 43 commits into
google:masterfrom
unamdev0:feature/add-repositoryrulesetevent

Conversation

@unamdev0

Copy link
Copy Markdown
Contributor

Added Repository ruleset event
Fixes#3295

@unamdev0

Copy link
Copy Markdown
ContributorAuthor

@gmlewis please ignore the previous PR and review this. This PR contains just my code and hasn't been reabased with master branch.
updated RuleSet to Ruleset everywhere, also improved the comment describing the repository ruleset event

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm going to hold off reviewing this one until comments from the last PR are addressed.
Specifically,

Godocs should always use complete sentences with punctuation so that the auto-generated package documentation formats and reads nicely.

It looks like GitHub ate my other lengthy comment, unfortunately... but the gist of it was that every exported struct needs a Godoc-style comment to explain its purpose and usage for the auto-generated package documentation.

@codecov

codecovBot commented Oct 4, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.39%. Comparing base (2b8c7fa) to head (e125889).
Report is 154 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3305 +/- ##
==========================================
- Coverage 97.72% 93.39% -4.33% 
==========================================
Files 153 172 +19 Lines 13390 11909 -1481 ==========================================
- Hits 13085 11123 -1962 - Misses 215 692 +477 - Partials 90 94 +4 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@unamdev0

Copy link
Copy Markdown
ContributorAuthor

I'm going to hold off reviewing this one until comments from the last PR are addressed.
Specifically,

Godocs should always use complete sentences with punctuation so that the auto-generated package documentation formats and reads nicely.

It looks like GitHub ate my other lengthy comment, unfortunately... but the gist of it was that every exported struct needs a Godoc-style comment to explain its purpose and usage for the auto-generated package documentation.

Got it, will add comments for every new struct added and will let you know

@unamdev0

Copy link
Copy Markdown
ContributorAuthor

@gmlewis please go ahead and review the code, I've added comments for all the new structs generated

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @unamdev0 !
Just a few linter errors to clean up, please, and a few tweaks, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.

Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
@unamdev0

Copy link
Copy Markdown
ContributorAuthor

Done @gmlewis, all the suggestion made have been added and test files have been modified accordingly

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like there are a few more linter errors - you can see them in the GitHub user interface, I believe.

Comment threadgithub/repos_rules.go Outdated
@gmlewis

Copy link
Copy Markdown
Collaborator

You should also be able to see them locally if you follow step 4 of CONTRIBUTING.md.

@unamdev0

Copy link
Copy Markdown
ContributorAuthor

Hi @gmlewis, I'm not able to see any linting issues shown in github interface, when running script/lint.sh. Other than that,I've made the change that was missed last time

Screenshot 2024-10-14 at 8 50 40 PM

@gmlewis

Copy link
Copy Markdown
Collaborator

Ah, to see them locally you probably need to merge the latest master into your PR... but I'll rerun the workflows and see if I can take screenshots for you.

@gmlewis

Copy link
Copy Markdown
Collaborator

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've gone ahead and made suggestions that should clear up the linter errors.

Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
@unamdev0

Copy link
Copy Markdown
ContributorAuthor

@gmlewis added the suggestions, should I add the changes in generated files manually as well as shown in the github UI?

@gmlewis

Copy link
Copy Markdown
Collaborator

@gmlewis added the suggestions, should I add the changes in generated files manually as well as shown in the github UI?

No, you should never edit the auto-generated files. If you find problems in them (which I don't think there are any), then the code that generates them gen-*.go should be modified... but usually, users of this repo can leave maintenance of those up to the maintainers of the repo. Is that what you were asking?

@gmlewis

Copy link
Copy Markdown
Collaborator

Can you please push those changes to the suggested changes? I'm not seeing them yet.

@unamdev0

Copy link
Copy Markdown
ContributorAuthor

No, you should never edit the auto-generated files. If you find problems in them (which I don't think there are any), then the code that generates them gen-*.go should be modified... but usually, users of this repo can leave maintenance of those up to the maintainers of the repo. Is that what you were asking?

Oh okay, I've pushed changes with period at the end of comments, and not modified any other file, can you please review once

Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/event_types.go
Comment threadgithub/event_types_test.go

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll go ahead and apply these as well.

Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 15, 2024
@gmlewis

Copy link
Copy Markdown
Collaborator

Bummer. I didn't get the spacing right. working on it...

Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
@gmlewis

Copy link
Copy Markdown
Collaborator

@unamdev0 - sorry for all the noise - I was trying to make it so that we wouldn't require more changes from you, but alas I was unsuccessful.

Could you please do this for me again?

git checkout feature/add-repositoryrulesetevent
git pull origin feature/add-repositoryrulesetevent
go generate ./...
git commit -am 'Run latest go generate'
git push origin feature/add-repositoryrulesetevent

@unamdev0

Copy link
Copy Markdown
ContributorAuthor

done @gmlewis

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unit tests still failing. I'll see if I can fix them.

Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated
Comment threadgithub/event_types_test.go Outdated

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Merging.

@gmlewis
gmlewis merged commit b93ab91 into google:masterOct 16, 2024
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto 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.

Feature: repository ruleset event type not defined

3 participants

@unamdev0@gmlewis@alexandear